X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiGraphics.h;h=a80074e70b465abee079bcb3b2817476059cb41a;hb=dd3842505b22a768c9b3f71d7e675f9c06381699;hp=3ff72533845369ad21b5cbc5a093864c7dc04bd2;hpb=fc36725282df43059aee9a821f098309ccdbd523;p=lyx.git diff --git a/src/frontends/qt4/GuiGraphics.h b/src/frontends/qt4/GuiGraphics.h index 3ff7253384..a80074e70b 100644 --- a/src/frontends/qt4/GuiGraphics.h +++ b/src/frontends/qt4/GuiGraphics.h @@ -6,6 +6,8 @@ * * \author John Levon * \author Herbert Voß + * \author Baruch Even + * \author Angus Leeming * * Full author contact details are available in file CREDITS. */ @@ -13,76 +15,84 @@ #ifndef GUIGRAPHICS_H #define GUIGRAPHICS_H -#include "GuiDialogView.h" +#include "GuiDialog.h" #include "ui_GraphicsUi.h" -#include "ControlGraphics.h" -#include +#include "support/docstring.h" +#include "insets/InsetGraphics.h" #include class QString; namespace lyx { -namespace frontend { -class GuiGraphics; +class InsetGraphics; +class InsetGraphicsParams; + +namespace frontend { -class GuiGraphicsDialog : public QDialog, public Ui::GraphicsUi +class GuiGraphics : public GuiDialog, public Ui::GraphicsUi { Q_OBJECT + public: - GuiGraphicsDialog(GuiGraphics * form); - virtual void setAutoText(); - virtual void show(); -protected Q_SLOTS: - virtual void change_adaptor(); - virtual void change_bb(); - virtual void on_browsePB_clicked(); - virtual void on_getPB_clicked(); - virtual void on_editPB_clicked(); - virtual void on_filename_textChanged(const QString &); - virtual void on_scaleCB_toggled(bool); - virtual void on_WidthCB_toggled(bool); - virtual void on_HeightCB_toggled(bool); - virtual void on_angle_textChanged(const QString &); -protected: - virtual void closeEvent(QCloseEvent * e); -private: - GuiGraphics * form_; -}; + GuiGraphics(GuiView & lv); + void setAutoText(); +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 &); -class GuiGraphics : public GuiView -{ -public: - /// - friend class GuiGraphicsDialog; - /// - GuiGraphics(Dialog &); - /// parent controller - ControlGraphics & controller() - { return static_cast(this->getController()); } - /// parent controller - ControlGraphics const & controller() const - { return static_cast(this->getController()); } -protected: - virtual bool isValid(); private: + void closeEvent(QCloseEvent * e); + bool isValid(); /// Apply changes - virtual void apply(); + void applyView(); /// update - virtual void update_contents(); - /// build the dialog - virtual void build_dialog(); + void updateContents(); /// get bounding box from file void getBB(); /// Store the LaTeX names for the rotation origins. std::vector origin_ltx; + /// + 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_; }; + +/// get the units for the bounding box +std::vector const getBBUnits(); + } // namespace frontend } // namespace lyx