]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GView.h
WS changes
[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 "frontends/LyXView.h"
16 #include "bufferview_funcs.h"
17
18 #include <map>
19
20 namespace lyx {
21 namespace frontend {
22
23 class GMiniBuffer;
24
25 class GView : public LyXView, public Gtk::Window {
26 public:
27         enum Position {
28                 Top,
29                 Bottom,
30                 Left,
31                 Right,
32                 Center
33         };
34
35         GView();
36         ~GView();
37
38         Gtk::Box & getBox(Position pos);
39
40         virtual void prohibitInput() const;
41         virtual void allowInput() const;
42         virtual void message(std::string const &);
43
44         bool on_delete_event(GdkEventAny * event);
45         void focusWorkArea() { workArea_->grab_focus(); }
46         void setGWorkArea(Gtk::Widget * w) { workArea_ = w; }
47
48         /// show busy cursor
49         virtual void busy(bool) const;
50         /// clear any temporary message and replace with current status
51         virtual void clearMessage();
52 private:
53         void showViewState();
54         bool onFocusIn(GdkEventFocus * event);
55         virtual void setWindowTitle(std::string const & t, std::string const & it);
56
57         // The top-most box containing all other boxes.
58         Gtk::VBox top_box_;
59
60         // The physical store for the boxes making up the layout.
61         typedef boost::shared_ptr<Gtk::Box> BoxPtr;
62         typedef std::vector<BoxPtr> BoxStore;
63         BoxStore box_store_;
64
65         // Accessors to the various Boxes.
66         std::map<Position, BoxPtr> box_map_;
67
68         boost::scoped_ptr<GMiniBuffer> minibuffer_;
69         Gtk::Widget * workArea_;
70 };
71
72 } // namespace frontend
73 } // namespace lyx
74
75 #endif