]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/XFormsView.h
Change the semantics of 'none' and 'auto' viewers/editors: 'none' means now
[lyx.git] / src / frontends / xforms / XFormsView.h
index 19aa954542a7312f63236c33a6a5b6f191e2aecd..45e58ff870d738c9bfbc83f22508aeaa5068b01d 100644 (file)
 #ifndef LyXView_H
 #define LyXView_H
 
-
+#include "LayoutEngine.h"
 #include "forms_fwd.h"
 
 #include "frontends/LyXView.h"
 #include <X11/Xlib.h> // for Pixmap
 
+#include <boost/signal.hpp>
+
+#include <map>
+
+namespace lyx {
+namespace frontend {
+
 class XMiniBuffer;
 
 /**
@@ -27,18 +34,29 @@ class XMiniBuffer;
  */
 class XFormsView : public LyXView {
 public:
+       enum Position {
+               Top,
+               Bottom,
+               Left,
+               Right,
+               Center
+       };
+
        /// create a main window of the given dimensions
        XFormsView(int w, int h);
 
        ~XFormsView();
 
+       /// Accessor to the appropriate layout Box.
+       boost::shared_ptr<Box> getBox(Position pos) const;
+
        /**
         * show - display the top-level window
         * @param xpos requested x position (or 0)
         * @param xpos requested y position (or 0)
         * @param title window title
         */
-       void show(int xpos, int ypos, string const & t = string("LyX"));
+       void show(int xpos, int ypos, std::string const & t = std::string("LyX"));
 
        /// get the xforms main form
        FL_FORM * getForm() const;
@@ -48,27 +66,41 @@ public:
        virtual void busy(bool) const;
 
        /// callback for close event from window manager
-       static int atCloseMainFormCB(FL_FORM *, void *);
+       int atCloseMainFormCB();
 
        /// display a status message
-       virtual void message(string const & str);
+       virtual void message(std::string const & str);
 
        /// clear back to normal status message
        virtual void clearMessage();
 
+       ///
+       void updateMetrics(bool resize_form = false);
+       ///
+       boost::signal<void()> metricsUpdated;
+
+       // returns true if this view has the focus.
+       virtual bool hasFocus() const;
+
 private:
        /**
         * setWindowTitle - set title of window
         * @param t main window title
         * @param it iconified (short) title
         */
-       virtual void setWindowTitle(string const & t, string const & it);
+       virtual void setWindowTitle(std::string const & t, std::string const & it);
 
        /// update the minibuffer state message
        void show_view_state();
 
-       /// makes the main form.
-       void create_form_form_main(int width, int height);
+       /// The top-most box of the layout engine containing all other boxes.
+       Box window_;
+
+       typedef std::map<Position, boost::shared_ptr<Box> > BoxMap;
+
+       // Accessors to the various Boxes.
+       BoxMap box_map_;
+
        /// the minibuffer
        boost::scoped_ptr<XMiniBuffer> minibuffer_;
        ///
@@ -85,4 +117,8 @@ private:
        ///
        Pixmap icon_mask_;
 };
+
+} // namespace frontend
+} // namespace lyx
+
 #endif