Fix missing includes
[centerim5.git] / cppconsui / HorizontalListBox.h
blob0edb316e7093713130ab4f7b13a1702049c01fa6
1 /*
2 * Copyright (C) 2007 by Mark Pustjens <pustjens@dds.nl>
3 * Copyright (C) 2010-2012 by CenterIM developers
5 * This file is part of CenterIM.
7 * CenterIM is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * CenterIM is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 /**
23 * @file
24 * HorizontalListBox class.
26 * @ingroup cppconsui
29 #ifndef __HORIZONTALLISTBOX_H__
30 #define __HORIZONTALLISTBOX_H__
32 #include "AbstractListBox.h"
33 #include "VerticalLine.h"
35 namespace CppConsUI
38 /**
39 * Implementation of AbstractListBox class where widgets are placed
40 * horizontally.
42 class HorizontalListBox
43 : public AbstractListBox
45 public:
46 HorizontalListBox(int w, int h);
47 virtual ~HorizontalListBox() {}
49 // Widget
50 virtual void Draw();
52 // AbstractListBox
53 virtual VerticalLine *InsertSeparator(size_t pos);
54 virtual VerticalLine *AppendSeparator();
55 virtual void InsertWidget(size_t pos, Widget& widget);
56 virtual void AppendWidget(Widget& widget);
58 // Container
59 virtual Curses::Window *GetSubPad(const Widget& child, int begin_x,
60 int begin_y, int ncols, int nlines);
62 virtual int GetChildrenWidth() const { return children_width; };
64 sigc::signal<void, HorizontalListBox&, int> signal_children_width_change;
66 protected:
67 int children_width;
68 int autosize_children;
69 int autosize_width;
70 std::set<const Widget*> autosize_extra;
71 bool reposition_widgets;
73 // Container
74 virtual void OnChildMoveResize(Widget& activator, const Rect& oldsize,
75 const Rect& newsize);
76 virtual void OnChildVisible(Widget& widget, bool visible);
78 virtual void UpdateScrollWidth();
80 private:
81 HorizontalListBox(const HorizontalListBox&);
82 HorizontalListBox& operator=(const HorizontalListBox&);
85 } // namespace CppConsUI
87 #endif // __HORIZONTALLISTBOX_H__
89 /* vim: set tabstop=2 shiftwidth=2 textwidth=78 expandtab : */