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 
45 class WindowType
46 {
47  public:
48  enum Type
49  {
50  Default = 0, // default window style
51  Borderless = 1, // no decoration
52  Frameless = Borderless, // TODO: deprecated
53  Popup = Borderless // TODO: deprecated
54  };
55 
56  WindowType(Type t = Default)
57  : _type(t)
58  {}
59 
60  WindowType& operator=(Type t)
61  {
62  _type = t;
63  return *this;
64  }
65 
66  operator Pt::uint32_t() const
67  {
68  return _type;
69  }
70 
71  private:
72  Pt::uint32_t _type;
73 };
74 
75 class WindowState
76 {
77  public:
78  enum State
79  {
80  Normal = 0,
81  Minimized = 1,
82  Maximized = 2
83  };
84 
85  WindowState(State t = Normal)
86  : _state(t)
87  {}
88 
89  WindowState& operator=(State t)
90  {
91  _state = t;
92  return *this;
93  }
94 
95  operator Pt::uint32_t() const
96  {
97  return _state;
98  }
99 
100  private:
101  Pt::uint32_t _state;
102 };
103 
104 } // namespace
105 
106 } // namespace
107 
108 #endif // include guard
uint_type uint32_t
Unsigned 32-bit integer type.
Definition: Types.h:42