Debian Codegraph @

engine/core/gui/fifechan/widgets/dockarea.h

raw
1 /***************************************************************************
2 * Copyright (C) 2005-2013 by the FIFE team *
3 * http://www.fifengine.net *
4 * This file is part of FIFE. *
5 * *
6 * FIFE is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2.1 of the License, or (at your option) any later version. *
10 * *
11 * This library 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 GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20 ***************************************************************************/
21
22 #ifndef FIFE_GUI_WIDGETS_DOCKAREA_H
23 #define FIFE_GUI_WIDGETS_DOCKAREA_H
24
25 // Standard C++ library includes
26
27 // 3rd party library includes
28 #include <fifechan.hpp>
29
30 // FIFE includes
31 // These includes are split up in two parts, separated by one empty line
32 // First block: files included from the FIFE root src directory
33 // Second block: files included from the same folder
34 #include "resizablewindow.h"
35
36
37 namespace fcn {
38 class DockArea : public ResizableWindow {
39 public:
40 DockArea();
41 DockArea(bool active);
42 virtual ~DockArea();
43
44 void setActiveDockArea(bool active);
45 bool isActiveDockArea() const;
46
47 void setTopSide(bool side);
48 bool isTopSide() const;
49 void setRightSide(bool side);
50 bool isRightSide() const;
51 void setBottomSide(bool side);
52 bool isBottomSide() const;
53 void setLeftSide(bool side);
54 bool isLeftSide() const;
55
56 void dockWidget(Widget* widget);
57 void undockWidget(Widget* widget);
58 void setHighlighted(bool highlighted);
59 bool isHighlighted() const;
60
61 /**
62 * Sets the highlight color of the widget.
63 *
64 * @param color The highlight color.
65 * @see getHighlightColor
66 */
67 void setHighlightColor(const Color& color);
68
69 /**
70 * Gets the highlight color.
71 *
72 * @return The highlight color.
73 * @see setHighlightColor
74 */
75 const Color& getHighlightColor() const;
76
77 void repositionWidget(Widget* widget);
78
79
80 // Inherited from ResizableWindow
81
82 virtual void add(Widget* widget);
83
84 virtual void remove(Widget* widget);
85
86 virtual void resizeToContent(bool recursiv=true);
87
88 virtual void expandContent(bool recursiv=true);
89
90
91 // Inherited from ResizableWindow / MouseListener
92
93 virtual void mouseEntered(MouseEvent& mouseEvent);
94
95 virtual void mouseExited(MouseEvent& mouseEvent);
96
97 virtual void mousePressed(MouseEvent& mouseEvent);
98
99 virtual void mouseReleased(MouseEvent& mouseEvent);
100
101 virtual void mouseMoved(MouseEvent& mouseEvent);
102
103 virtual void mouseDragged(MouseEvent& mouseEvent);
104
105 protected:
106 void repositionDockAreas();
107 void keepInBounds();
108
109 bool m_activeDockArea;
110
111 bool m_topSide;
112 bool m_rightSide;
113 bool m_bottomSide;
114 bool m_leftSide;
115
116 bool m_highlighted;
117
118 Color m_highlightColor;
119 Color m_savedColor;
120 };
121 }
122
123 #endif