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