]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GToolbar.h
Wrap most of the frontend code up inside namespace lyx::frontend.
[lyx.git] / src / frontends / gtk / GToolbar.h
1 // -*- C++ -*-
2 /**
3  * \file GToolbar.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  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GTOOLBAR_H
14 #define GTOOLBAR_H
15
16 #include <gtkmm.h>
17 #include "frontends/Toolbars.h"
18 #include <boost/scoped_ptr.hpp>
19
20
21 namespace lyx {
22 namespace frontend {
23
24 class GView;
25
26 class GLayoutBox: public LayoutBox, public SigC::Object {
27 public:
28         GLayoutBox(LyXView &, Gtk::Toolbar &, FuncRequest const &);
29
30         /// select the right layout in the combox.
31         void set(std::string const & layout);
32         /// Populate the layout combox.
33         void update();
34         /// Erase the layout list.
35         void clear();
36         /// Display the layout list.
37         void open();
38         ///
39         void setEnabled(bool);
40
41 private:
42         ///
43         void selected();
44
45         Gtk::Combo combo_;
46         LyXView & owner_;
47         bool internal_;
48 };
49
50
51 class GToolbar : public Toolbar, public SigC::Object {
52 public:
53         GToolbar(ToolbarBackend::Toolbar const &, LyXView &);
54         void add(FuncRequest const & func, std::string const & tooltip);
55         void hide(bool);
56         void show(bool);
57         void update();
58         LayoutBox * layout() const { return layout_.get(); }
59
60 private:
61         void clicked(FuncRequest);
62
63         GView & owner_;
64         Gtk::Toolbar toolbar_;
65         boost::scoped_ptr<GLayoutBox> layout_;
66 };
67
68 } // namespace frontend
69 } // namespace lyx
70
71 #endif // NOT GTOOLBAR_H