]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GToolbar.h
* Positionable and dynamically visible toolbars for the XForms 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 class GView;
22
23
24 class GLayoutBox: public LayoutBox, public SigC::Object {
25 public:
26         GLayoutBox(LyXView &, Gtk::Toolbar &, FuncRequest const &);
27
28         /// select the right layout in the combox.
29         void set(std::string const & layout);
30         /// Populate the layout combox.
31         void update();
32         /// Erase the layout list.
33         void clear();
34         /// Display the layout list.
35         void open();
36         ///
37         void setEnabled(bool);
38
39 private:
40         ///
41         void selected();
42
43         Gtk::Combo combo_;
44         LyXView & owner_;
45         bool internal_;
46 };
47
48
49 class GToolbar : public Toolbar, public SigC::Object {
50 public:
51         GToolbar(ToolbarBackend::Toolbar const &, LyXView &);
52         void add(FuncRequest const & func, std::string const & tooltip);
53         void hide(bool);
54         void show(bool);
55         void update();
56         LayoutBox * layout() const { return layout_.get(); }
57
58 private:
59         void clicked(FuncRequest);
60
61         GView & owner_;
62         Gtk::Toolbar toolbar_;
63         boost::scoped_ptr<GLayoutBox> layout_;
64 };
65
66 #endif // NOT GTOOLBAR_H