Fix include name for the ncursesw library
[centerim5.git] / cppconsui / AbstractListBox.h
blob57d29f1da95a1c35936916f93fcc32fc07250aca
1 // Copyright (C) 2007 Mark Pustjens <pustjens@dds.nl>
2 // Copyright (C) 2010-2015 Petr Pavlu <setup@dagobah.cz>
3 //
4 // This file is part of CenterIM.
5 //
6 // CenterIM is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // CenterIM is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with CenterIM. If not, see <http://www.gnu.org/licenses/>.
19 /// @file
20 /// AbstractListBox class.
21 ///
22 /// @ingroup cppconsui
24 #ifndef ABSTRACTLISTBOX_H
25 #define ABSTRACTLISTBOX_H
27 #include "AbstractLine.h"
28 #include "Button.h"
29 #include "Container.h"
31 namespace CppConsUI {
33 /// Abstract class that defines common interface for ListBox and
34 /// HorizontalListBox.
35 class AbstractListBox : public Container {
36 public:
37 AbstractListBox(int w, int h);
38 virtual ~AbstractListBox() override {}
40 /// Inserts a new button into ListBox before a given position.
41 virtual Button *insertItem(std::size_t pos, const char *title,
42 const sigc::slot<void, Button &> &callback);
44 /// Adds a new button in the end of ListBox.
45 virtual Button *appendItem(
46 const char *title, const sigc::slot<void, Button &> &callback);
48 /// Inserts a separator (usually a horizontal or vertical line) into the
49 /// ListBox before a given position.
50 virtual AbstractLine *insertSeparator(std::size_t pos) = 0;
52 /// Appends a separator (usually a horizontal or vertical line) into the
53 /// ListBox.
54 virtual AbstractLine *appendSeparator() = 0;
56 /// Inserts a widget into the ListBox before a given position.
57 virtual void insertWidget(std::size_t pos, Widget &widget) = 0;
59 /// Appends a widget into the ListBox.
60 virtual void appendWidget(Widget &widget) = 0;
62 protected:
63 // Container
64 using Container::addWidget;
66 private:
67 CONSUI_DISABLE_COPY(AbstractListBox);
70 } // namespace CppConsUI
72 #endif // ABSTRACTLISTBOX_H
74 // vim: set tabstop=2 shiftwidth=2 textwidth=80 expandtab: