WindowType.h
1 /* Copyright (C) 2015 Marc Boris Duerner
2  Copyright (C) 2015 Laurentiu-Gheorghe Crisan
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  As a special exception, you may use this file as part of a free
10  software library without restriction. Specifically, if other files
11  instantiate templates or use macros or inline functions from this
12  file, or you compile this file and link it with other files to
13  produce an executable, this file does not by itself cause the
14  resulting executable to be covered by the GNU General Public
15  License. This exception does not however invalidate any other
16  reasons why the executable file might be covered by the GNU Library
17  General Public License.
18 
19  This library is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  Lesser General Public License for more details.
23 
24  You should have received a copy of the GNU Lesser General Public
25  License along with this library; if not, write to the Free Software
26  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27  02110-1301 USA
28 */
29 
30 #ifndef PT_FORMS_WINDOWHOST_H
31 #define PT_FORMS_WINDOWHOST_H
32 
33 #include <Pt/Forms/Api.h>
34 #include <Pt/Forms/Widget.h>
35 #include <Pt/Gfx/Point.h>
36 #include <Pt/Gfx/Size.h>
37 #include <Pt/Gfx/Rect.h>
38 #include <Pt/Signal.h>
39 #include <Pt/Connectable.h>
40 
41 namespace Pt {
42 
43 namespace Forms {
44 
53 {
54  public:
57  enum Type
58  {
61  Default = 0,
62 
66 
72 
78  };
79 
83  : _type(type)
84  {}
85 
89  {
90  _type = type;
91  return *this;
92  }
93 
96  operator Pt::uint32_t() const
97  {
98  return _type;
99  }
100 
101  private:
102  Pt::uint32_t _type;
103 };
104 
112 {
113  public:
116  enum State
117  {
120  Normal = 0,
121 
125 
128  Maximized = 2
129  };
130 
134  : _state(state)
135  {}
136 
140  {
141  _state = state;
142  return *this;
143  }
144 
147  operator Pt::uint32_t() const
148  {
149  return _state;
150  }
151 
152  private:
153  Pt::uint32_t _state;
154 };
155 
156 } // namespace
157 
158 } // namespace
159 
160 #endif // include guard
Core module.
Definition: Allocator.h:33
Presentation state of a window.
Definition: WindowType.h:112
WindowType(Type type=Default)
Creates a window type with type.
Definition: WindowType.h:82
State
Defines a window presentation state.
Definition: WindowType.h:117
Type
Defines a window frame style.
Definition: WindowType.h:58
@ Minimized
Uses the minimized window state.
Definition: WindowType.h:124
uint_type uint32_t
Unsigned 32-bit integer type.
Definition: Api-Types.h:48
@ Default
Uses the default decorated frame.
Definition: WindowType.h:61
Frame style of a window.
Definition: WindowType.h:53
WindowState & operator=(State state)
Sets the window state to state and returns this object.
Definition: WindowType.h:139
WindowType & operator=(Type type)
Sets the window type to type and returns this object.
Definition: WindowType.h:88
@ Normal
Uses the normal window state.
Definition: WindowType.h:120
@ Borderless
Uses a frame without decoration.
Definition: WindowType.h:65
WindowState(State state=Normal)
Creates a window state with state.
Definition: WindowType.h:133
@ Frameless
Alias for Borderless.
Definition: WindowType.h:71
@ Maximized
Uses the maximized window state.
Definition: WindowType.h:128
Represents a borderless transient window.
Definition: Popup.h:48