]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/XFormsView.h
A layout engine for XForms.
[lyx.git] / src / frontends / xforms / XFormsView.h
1 // -*- C++ -*-
2 /**
3  * \file XFormsView.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LyXView_H
13 #define LyXView_H
14
15 #include "LayoutEngine.h"
16 #include "forms_fwd.h"
17
18 #include "frontends/LyXView.h"
19 #include <X11/Xlib.h> // for Pixmap
20
21 #include <boost/signals/signal0.hpp>
22
23 #include <map>
24
25 class XMiniBuffer;
26
27 /**
28  * XFormsView - xforms implementation of LyXView
29  *
30  * xforms-private implementation of the main LyX window.
31  */
32 class XFormsView : public LyXView {
33 public:
34         enum Position {
35                 Top,
36                 Bottom,
37                 Left,
38                 Right,
39                 Center
40         };
41
42         /// create a main window of the given dimensions
43         XFormsView(int w, int h);
44
45         ~XFormsView();
46
47         /// Accessor to the appropriate layout Box.
48         lyx::frontend::Box & getBox(Position pos) const;
49
50         /**
51          * show - display the top-level window
52          * @param xpos requested x position (or 0)
53          * @param xpos requested y position (or 0)
54          * @param title window title
55          */
56         void show(int xpos, int ypos, std::string const & t = std::string("LyX"));
57
58         /// get the xforms main form
59         FL_FORM * getForm() const;
60         /// redraw the main form.
61         virtual void redraw();
62         /// show busy cursor
63         virtual void busy(bool) const;
64
65         /// callback for close event from window manager
66         static int atCloseMainFormCB(FL_FORM *, void *);
67
68         /// display a status message
69         virtual void message(std::string const & str);
70
71         /// clear back to normal status message
72         virtual void clearMessage();
73
74         boost::signal0<void> metricsUpdated;
75
76 private:
77         /**
78          * setWindowTitle - set title of window
79          * @param t main window title
80          * @param it iconified (short) title
81          */
82         virtual void setWindowTitle(std::string const & t, std::string const & it);
83
84         /// update the minibuffer state message
85         void show_view_state();
86
87         ///
88         void updateMetrics();
89         /// The top-most box of the layout engine containing all other boxes.
90         lyx::frontend::Box window_;
91
92         // Accessors to the various Boxes.
93         std::map<Position, lyx::frontend::Box *> box_map_;
94
95         /// the minibuffer
96         boost::scoped_ptr<XMiniBuffer> minibuffer_;
97         ///
98         boost::signals::connection view_state_con;
99         ///
100         boost::signals::connection focus_con;
101         ///
102         boost::signals::connection redraw_con;
103
104         /// the main form.
105         FL_FORM * form_;
106         /// Passed to the window manager to give a pretty little symbol ;-)
107         Pixmap icon_pixmap_;
108         ///
109         Pixmap icon_mask_;
110 };
111 #endif