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