Debian Codegraph @

src/display.h

raw
1 // Copyright © 2002 Rob Kaper <[email protected]>
2 // 2010-2015 Sylvain Rochet <[email protected]>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // version 2 as published by the Free Software Foundation.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; see the file COPYING. If not, see
15 // <http://www.gnu.org/licenses/>.
16
17 #ifndef __MONOPD_DISPLAY_H__
18 #define __MONOPD_DISPLAY_H__
19
20 #include <string>
21 #include <vector>
22
23 class Estate;
24
25 class DisplayButton
26 {
27 public:
28 DisplayButton(const std::string command, const std::string caption, const bool enabled);
29 DisplayButton(const DisplayButton *button);
30 const std::string command();
31 const std::string caption();
32 bool enabled();
33
34 private:
35 std::string m_command, m_caption;
36 bool m_enabled;
37 };
38
39 class Display
40 {
41 public:
42 Display();
43 Display(const Display *display);
44 ~Display();
45
46 void setEstate(Estate *estate);
47 Estate *estate();
48 void setText(const std::string text);
49 void setText(const char *fmt, ...);
50 const std::string text();
51 void addButton(const std::string command, const std::string caption, const bool enabled);
52 void resetButtons();
53 void resetText();
54 void resetEstate();
55 bool clearButtons();
56 bool clearText();
57 bool clearEstate();
58 std::vector<DisplayButton *> buttons();
59
60 private:
61 Estate *m_estate;
62 std::string m_text;
63 std::vector<DisplayButton *> m_buttons;
64 bool m_clearText, m_clearButtons, m_clearEstate;
65 };
66
67
68 #endif // MONOP_ESTATE_H