]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiGraphics.h
Make the InsetInfo dialog a bit less esoteric.
[lyx.git] / src / frontends / qt4 / GuiGraphics.h
index 3ff72533845369ad21b5cbc5a093864c7dc04bd2..6446949daf39d54ab08f8ee7f57ddc67e55c43c5 100644 (file)
@@ -5,7 +5,9 @@
  * Licence details can be found in the file COPYING.
  *
  * \author John Levon
- * \author Herbert Voß
+ * \author Herbert Voß
+ * \author Baruch Even
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS.
  */
 #ifndef GUIGRAPHICS_H
 #define GUIGRAPHICS_H
 
-#include "GuiDialogView.h"
+#include "GuiDialog.h"
 #include "ui_GraphicsUi.h"
-#include "ControlGraphics.h"
 
-#include <QDialog>
+#include "insets/InsetGraphicsParams.h"
 
 #include <vector>
 
 class QString;
 
 namespace lyx {
-namespace frontend {
 
-class GuiGraphics;
+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 changeGroup(int);
+       void changeBB();
+       void on_newGroupPB_clicked();
+       void on_browsePB_clicked();
+       void on_getPB_clicked();
+       void on_scaleCB_toggled(bool);
+       void on_WidthCB_toggled(bool);
+       void on_HeightCB_toggled(bool);
+       void updateAspectRatioStatus();
+       void on_aspectratio_toggled(bool);
+       void on_angle_textChanged(const QString &);
 
-class GuiGraphics : public GuiView<GuiGraphicsDialog>
-{
-public:
+private:
        ///
-       friend class GuiGraphicsDialog;
+       bool isValid();
+       /// Dialog inherited methods
+       //@{
+       void applyView();
+       void updateContents() {}
+       bool initialiseParams(std::string const & data);
+       void clearParams();
+       void dispatchParams();
+       bool isBufferDependent() const { return true; }
+       //@}
+
        ///
-       GuiGraphics(Dialog &);
-       /// parent controller
-       ControlGraphics & controller()
-       { return static_cast<ControlGraphics &>(this->getController()); }
-       /// parent controller
-       ControlGraphics const & controller() const
-       { return static_cast<ControlGraphics const &>(this->getController()); }
-protected:
-       virtual bool isValid();
-private:
-       /// Apply changes
-       virtual void apply();
-       /// update
-       virtual void update_contents();
-       /// build the dialog
-       virtual void build_dialog();
+       void paramsToDialog(InsetGraphicsParams const & params);
+
        /// get bounding box from file
        void getBB();
+       /// Browse for a file
+       QString browse(QString const &) const;
+       /// Read the Bounding Box from a eps or ps-file
+       std::string readBoundingBox(std::string const & file);
+       /// test if file exist
+       bool isFileNameValid(std::string const & fname) const;
 
+       /// Control the bb
+       bool bbChanged;
        /// Store the LaTeX names for the rotation origins.
        std::vector<std::string> origin_ltx;
-
+       ///
+       InsetGraphicsParams params_;
+       /// the current graphics group
+       std::string current_group_;
 };
 
 } // namespace frontend