]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GToolbar.h
Change glob() API to accept a dir parameter.
[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 <gtkmm.h>
19
20 #include <boost/scoped_ptr.hpp>
21
22 namespace lyx {
23 namespace frontend {
24
25 class GView;
26
27 class stringcolumns : public Gtk::TreeModel::ColumnRecord {
28 public:
29         stringcolumns()
30         {
31                 add(name);
32         }
33
34         Gtk::TreeModelColumn<Glib::ustring> name;
35 };
36
37
38 class GLayoutBox: public LayoutBox, public sigc::trackable {
39 public:
40         GLayoutBox(LyXView &, Gtk::Toolbar &, FuncRequest const &);
41
42         /// select the right layout in the combox.
43         void set(std::string const & layout);
44         /// Populate the layout combox.
45         void update();
46         /// Erase the layout list.
47         void clear();
48         /// Display the layout list.
49         void open();
50         ///
51         void setEnabled(bool);
52 private:
53         ///
54         void selected();
55
56         Gtk::ComboBox combo_;
57         Glib::RefPtr<Gtk::ListStore> model_;
58         stringcolumns cols_;
59
60         LyXView & owner_;
61         bool internal_;
62 };
63
64
65 class GToolbar : public Toolbar, public sigc::trackable {
66 public:
67         GToolbar(ToolbarBackend::Toolbar const &, LyXView &);
68         void add(FuncRequest const & func, std::string const & tooltip);
69         void hide(bool);
70         void show(bool);
71         void update();
72         LayoutBox * layout() const { return layout_.get(); }
73 private:
74         void clicked(FuncRequest);
75
76         GView & owner_;
77         Gtk::Toolbar toolbar_;
78         boost::scoped_ptr<GLayoutBox> layout_;
79 };
80
81 } // namespace frontend
82 } // namespace lyx
83
84 #endif // NOT GTOOLBAR_H