]> git.lyx.org Git - features.git/blob - src/frontends/gtk/GToolbar.h
418e564430a04b02163b23ab5284f9b10daca765
[features.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  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef TOOLBAR_PIMPL_H
13 #define TOOLBAR_PIMPL_H
14
15 #include <gtkmm.h>
16 #include "frontends/Toolbar.h"
17 #include "ToolbarBackend.h"
18 #include <map>
19
20
21 class GToolbar : public Toolbar, public SigC::Object
22 {
23 public:
24         GToolbar(LyXView * o, int x, int y);
25
26         ~GToolbar();
27
28         // add a new toolbar
29         void add(ToolbarBackend::Toolbar const & tb);
30
31         /// add a new button to the toolbar.
32         void add(Gtk::Toolbar * toolbar,
33                  ToolbarBackend::Item const & item);
34
35         /// display toolbar, not implemented
36         void displayToolbar(ToolbarBackend::Toolbar const & tb, bool show);
37
38         /// update the state of the icons
39         void update();
40
41         /// select the right layout in the combox
42         void setLayout(std::string const & layout);
43
44         /// Populate the layout combox; re-do everything if force is true.
45         void updateLayoutList();
46
47         /// Drop down the layout list
48         void openLayoutList();
49
50         /// Erase the layout list
51         void clearLayoutList();
52 private:
53         void onButtonClicked(FuncRequest);
54         void onLayoutSelected();
55         typedef std::map<std::string, Gtk::Toolbar*> ToolbarMap;
56         ToolbarMap toolbars_;
57         Gtk::Combo combo_;
58         LyXView * view_;
59         bool internal_;
60 };
61
62 #endif