]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GView.h
more compile fixes
[lyx.git] / src / frontends / gtk / GView.h
1 // -*- C++ -*-
2 /**
3  * \file gtk/GView.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Huang Ying
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GVIEW_H
13 #define GVIEW_H
14
15 #include "bufferview_funcs.h"
16
17 #include "frontends/LyXView.h"
18
19 #include <gtkmm.h>
20
21 #include <map>
22
23 namespace lyx {
24 namespace frontend {
25
26 class GMiniBuffer;
27
28 class GView : public LyXView, public Gtk::Window {
29 public:
30         enum Position {
31                 Top,
32                 Bottom,
33                 Left,
34                 Right,
35                 Center
36         };
37
38         GView();
39         ~GView();
40
41         /// initialize the object
42         virtual void init();
43
44         /// FIXME: not implemented!
45         virtual void setGeometry(
46                 unsigned int width,
47                 unsigned int height,
48                 int posx, int posy,
49                 bool maximize);
50
51         Gtk::Box & getBox(Position pos);
52
53         virtual void prohibitInput() const;
54         virtual void allowInput() const;
55         virtual void message(lyx::docstring const &);
56
57         bool on_delete_event(GdkEventAny * event);
58         void focusWorkArea() { workArea_->grab_focus(); }
59         void setGWorkArea(Gtk::Widget * w) { workArea_ = w; }
60
61         /// show busy cursor
62         virtual void busy(bool) const;
63
64         ///
65         Toolbars::ToolbarPtr makeToolbar(ToolbarBackend::Toolbar const & tbb);
66
67         /// clear any temporary message and replace with current status
68         virtual void clearMessage();
69
70         /// returns true if this view has the focus.
71         virtual bool hasFocus() const;
72         ///
73         void updateStatusBar();
74
75 private:
76         bool onFocusIn(GdkEventFocus * event);
77         virtual void setWindowTitle(lyx::docstring const & t, lyx::docstring const & it);
78
79         // The top-most box containing all other boxes.
80         Gtk::VBox top_box_;
81
82         // The physical store for the boxes making up the layout.
83         typedef boost::shared_ptr<Gtk::Box> BoxPtr;
84         typedef std::vector<BoxPtr> BoxStore;
85         BoxStore box_store_;
86
87         // Accessors to the various Boxes.
88         std::map<Position, BoxPtr> box_map_;
89
90         boost::scoped_ptr<GMiniBuffer> minibuffer_;
91         Gtk::Widget * workArea_;
92 };
93
94 } // namespace frontend
95 } // namespace lyx
96
97 #endif