aboutsummaryrefslogtreecommitdiff
path: root/src/ToolbarItem.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ToolbarItem.hh')
-rw-r--r--src/ToolbarItem.hh57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/ToolbarItem.hh b/src/ToolbarItem.hh
new file mode 100644
index 0000000..b4087a7
--- /dev/null
+++ b/src/ToolbarItem.hh
@@ -0,0 +1,57 @@
1// ToolbarItem.hh
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
3// and Simon Bowden (rathnor at users.sourceforge.net)
4//
5// Permission is hereby granted, free of charge, to any person obtaining a
6// copy of this software and associated documentation files (the "Software"),
7// to deal in the Software without restriction, including without limitation
8// the rights to use, copy, modify, merge, publish, distribute, sublicense,
9// and/or sell copies of the Software, and to permit persons to whom the
10// Software is furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE.
22
23// $Id: ToolbarItem.hh,v 1.1 2003/08/11 15:44:12 fluxgen Exp $
24
25#ifndef TOOLBARITEM_HH
26#define TOOLBARITEM_HH
27
28/// An item in the toolbar that has either fixed or realive size to the toolbar
29class ToolbarItem {
30public:
31 /// size type in the toolbar
32 enum Type {
33 FIXED, ///< the size can not be changed
34 RELATIVE ///< the size can be changed
35 };
36
37 explicit ToolbarItem(Type type);
38 virtual ~ToolbarItem();
39
40 virtual void move(int x, int y) = 0;
41 virtual void resize(unsigned int width, unsigned int height) = 0;
42 virtual void moveResize(int x, int y,
43 unsigned int width, unsigned int height) = 0;
44
45 virtual void show() = 0;
46 virtual void hide() = 0;
47 virtual unsigned int width() const = 0;
48 virtual unsigned int height() const = 0;
49
50 void setType(Type type) { m_type = type; }
51 Type type() const { return m_type; }
52
53private:
54 Type m_type;
55};
56
57#endif // TOOLBARITEM_HH