]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GToolbar.h
WS changes
[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 "frontends/Toolbars.h"
17
18 #include <boost/scoped_ptr.hpp>
19
20 #include <gtkmm.h>
21
22 namespace lyx {
23 namespace frontend {
24
25 class GView;
26
27 class GLayoutBox: public LayoutBox, public SigC::Object {
28 public:
29         GLayoutBox(LyXView &, Gtk::Toolbar &, FuncRequest const &);
30
31         /// select the right layout in the combox.
32         void set(std::string const & layout);
33         /// Populate the layout combox.
34         void update();
35         /// Erase the layout list.
36         void clear();
37         /// Display the layout list.
38         void open();
39         ///
40         void setEnabled(bool);
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 private:
60         void clicked(FuncRequest);
61
62         GView & owner_;
63         Gtk::Toolbar toolbar_;
64         boost::scoped_ptr<GLayoutBox> layout_;
65 };
66
67 } // namespace frontend
68 } // namespace lyx
69
70 #endif // NOT GTOOLBAR_H