]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiImplementation.h
Whitespace cleanup
[features.git] / src / frontends / qt4 / GuiImplementation.h
index d31437cfa59617dbafd4b00133a06d56540b7511..0b30d572ca38ddff5842c45abb364adb47d1f9bc 100644 (file)
 #define GUI_H
 
 #include "frontends/Gui.h"
-#include "GuiClipboard.h"
-#include "GuiSelection.h"
 
-#include <boost/shared_ptr.hpp>
+#include <QObject>
 
 #include <map>
 
@@ -32,37 +30,49 @@ class GuiView;
 /**
  * The GuiImplementation class is the interface to all Qt4 components.
  */
-class GuiImplementation: public Gui
+class GuiImplementation: public QObject, public Gui
 {
+       Q_OBJECT
+
 public:
        GuiImplementation();
        virtual ~GuiImplementation() {}
 
-       Clipboard& clipboard();
-       Selection& selection();
 
-       int newView(unsigned int width, unsigned int height);
-       LyXView& view(int id);
-       void destroyView(int id);
-       int newWorkArea(unsigned int width, unsigned int height, int view_id);
-       int newWorkArea(int w, int h);
-       WorkArea& workArea(int id);
-       void destroyWorkArea(int id);
+       virtual LyXView& createRegisteredView();
+       virtual bool closeAllViews();
+       virtual bool unregisterView(int id);
+
+       virtual LyXView& view(int id) const;
 
+       virtual int newWorkArea(unsigned int width, unsigned int height, int view_id);
+       virtual WorkArea& workArea(int id);
 
 private:
+
+       /// Multiple views container.
+       /**
+       * Warning: This must not be a smart pointer as the destruction of the
+       * object is handled by Qt when the view is closed
+       * \sa Qt::WA_DeleteOnClose attribute.
+       */
+       std::map<int, GuiView *> views_;
+
+       /// Multiple workareas container.
+       /**
+       * Warning: This must not be a smart pointer as the destruction of the
+       * object is handled by Qt when its parent view is closed.
+       */
+       std::map<int, GuiWorkArea *> work_areas_;
        ///
-       GuiClipboard clipboard_;
-       ///
-       GuiSelection selection_;
-       ///
-       std::map<int, boost::shared_ptr<GuiView> > views_;
-       ///
-       std::map<int, boost::shared_ptr<GuiWorkArea> > work_areas_;
-       ///
-       size_t max_view_id_;
-       ///
-       size_t max_wa_id_;
+
+       /// view of a buffer. Eventually there will be several.
+       std::map<int, boost::shared_ptr<BufferView> > buffer_views_;
+
+
+       std::vector<int> const & workAreaIds();
+
+       std::vector<int> work_area_ids_;
 };
 
 } // namespace frontend