]> git.lyx.org Git - lyx.git/blob - src/ToolbarBackend.h
7e609ac8c4ecbf941c3e990138321f6b13bc7378
[lyx.git] / src / ToolbarBackend.h
1 // -*- C++ -*-
2 /**
3  * \file ToolbarBackend.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef TOOLBAR_BACKEND_H
13 #define TOOLBAR_BACKEND_H
14
15 #include <vector>
16
17 #include "LString.h"
18
19 class LyXLex;
20
21 ///
22 class ToolbarBackend {
23 public:
24         /// The special toolbar actions
25         enum  ItemType {
26                 /// adds space between buttons in the toolbar
27                 SEPARATOR = -3,
28                 /// a special combox insead of a button
29                 LAYOUTS = -2,
30                 /// begin a new line of button (not working)
31                 NEWLINE = -1
32         };
33
34         ///
35         typedef std::vector<int> Items;
36         ///
37         typedef Items::iterator iterator;
38         ///
39         typedef Items::const_iterator const_iterator;
40         ///
41         ToolbarBackend();
42         ///
43         iterator begin() {
44                 return items.begin();
45         }
46         ///
47         const_iterator begin() const {
48                 return items.begin();
49         }
50         ///
51         iterator end() {
52                 return items.end();
53         }
54         ///
55         const_iterator end() const {
56                 return items.end();
57         }
58         ///
59         void read(LyXLex &);
60 private:
61         /// This func is just to make it easy for me...
62         void add(int);
63         ///
64         void add(string const &);
65         ///
66         Items items;
67 };
68
69 /// The global instance
70 extern ToolbarBackend toolbarbackend;
71
72
73 #endif // TOOLBAR_BACKEND_H