2006-03-05 17:24:44 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
|
* \file GuiGraphics.h
|
2006-03-05 17:24:44 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Herbert Vo<EFBFBD>
|
2007-10-06 22:16:14 +00:00
|
|
|
|
* \author Baruch Even
|
|
|
|
|
* \author Angus Leeming
|
2006-03-05 17:24:44 +00:00
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
#ifndef GUIGRAPHICS_H
|
|
|
|
|
#define GUIGRAPHICS_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
#include "GuiDialog.h"
|
|
|
|
|
#include "ui_GraphicsUi.h"
|
2007-02-13 18:27:46 +00:00
|
|
|
|
|
2007-10-06 22:16:14 +00:00
|
|
|
|
#include "support/docstring.h"
|
|
|
|
|
#include "insets/InsetGraphics.h"
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include <vector>
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
class QString;
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace lyx {
|
2007-10-06 22:16:14 +00:00
|
|
|
|
|
|
|
|
|
class InsetGraphics;
|
|
|
|
|
class InsetGraphicsParams;
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-10-06 22:16:14 +00:00
|
|
|
|
class LyXView;
|
|
|
|
|
|
2007-10-09 19:34:27 +00:00
|
|
|
|
class GuiGraphics : public GuiDialog, public Ui::GraphicsUi
|
2007-08-31 22:16:11 +00:00
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2007-10-06 22:16:14 +00:00
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
public:
|
2007-10-06 22:16:14 +00:00
|
|
|
|
GuiGraphics(LyXView & lv);
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void setAutoText();
|
2007-10-06 22:16:14 +00:00
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
private Q_SLOTS:
|
|
|
|
|
void change_adaptor();
|
|
|
|
|
void change_bb();
|
|
|
|
|
void on_browsePB_clicked();
|
|
|
|
|
void on_getPB_clicked();
|
|
|
|
|
void on_editPB_clicked();
|
|
|
|
|
void on_filename_textChanged(const QString &);
|
|
|
|
|
void on_scaleCB_toggled(bool);
|
|
|
|
|
void on_WidthCB_toggled(bool);
|
|
|
|
|
void on_HeightCB_toggled(bool);
|
|
|
|
|
void on_angle_textChanged(const QString &);
|
2007-10-06 22:16:14 +00:00
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
private:
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void closeEvent(QCloseEvent * e);
|
|
|
|
|
bool isValid();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
/// Apply changes
|
2007-09-05 20:33:29 +00:00
|
|
|
|
void applyView();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
/// update
|
2007-09-11 18:33:42 +00:00
|
|
|
|
void updateContents();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
/// get bounding box from file
|
|
|
|
|
void getBB();
|
|
|
|
|
|
|
|
|
|
/// Store the LaTeX names for the rotation origins.
|
|
|
|
|
std::vector<std::string> origin_ltx;
|
2007-10-06 22:16:14 +00:00
|
|
|
|
///
|
|
|
|
|
bool initialiseParams(std::string const & data);
|
|
|
|
|
/// clean-up on hide.
|
|
|
|
|
void clearParams();
|
|
|
|
|
/// clean-up on hide.
|
|
|
|
|
void dispatchParams();
|
|
|
|
|
///
|
|
|
|
|
bool isBufferDependent() const { return true; }
|
|
|
|
|
|
|
|
|
|
/// Browse for a file
|
|
|
|
|
docstring const browse(docstring const &) const;
|
|
|
|
|
/// Read the Bounding Box from a eps or ps-file
|
|
|
|
|
std::string const readBB(std::string const & file);
|
|
|
|
|
/// Control the bb
|
|
|
|
|
bool bbChanged;
|
|
|
|
|
/// test if file exist
|
|
|
|
|
bool isFilenameValid(std::string const & fname) const;
|
|
|
|
|
/// edit file
|
|
|
|
|
void editGraphics();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
///
|
|
|
|
|
InsetGraphicsParams params_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-10-06 22:16:14 +00:00
|
|
|
|
|
|
|
|
|
/// get the units for the bounding box
|
|
|
|
|
std::vector<std::string> const getBBUnits();
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
#endif // GUIGRAPHICS_H
|