KParts

windowargs.cpp
1 /*
2  This file is part of the KDE project
3  SPDX-FileCopyrightText: 1999 Simon Hausmann <[email protected]>
4  SPDX-FileCopyrightText: 1999 David Faure <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #include "windowargs.h"
10 
11 #include <QRect>
12 
13 using namespace KParts;
14 
15 namespace KParts
16 {
17 class WindowArgsPrivate : public QSharedData
18 {
19 public:
20  WindowArgsPrivate()
21  : x(-1)
22  , y(-1)
23  , width(-1)
24  , height(-1)
25  , fullscreen(false)
26  , menuBarVisible(true)
27  , toolBarsVisible(true)
28  , statusBarVisible(true)
29  , resizable(true)
30  , lowerWindow(false)
31  , scrollBarsVisible(true)
32  {
33  }
34 
35  // Position
36  int x;
37  int y;
38  // Size
39  int width;
40  int height;
41  bool fullscreen; // defaults to false
42  bool menuBarVisible; // defaults to true
43  bool toolBarsVisible; // defaults to true
44  bool statusBarVisible; // defaults to true
45  bool resizable; // defaults to true
46 
47  bool lowerWindow; // defaults to false
48  bool scrollBarsVisible; // defaults to true
49 };
50 
51 }
52 
53 WindowArgs::WindowArgs()
54  : d(new WindowArgsPrivate)
55 {
56 }
57 
58 WindowArgs::WindowArgs(const WindowArgs &args)
59  : d(args.d)
60 {
61 }
62 
63 WindowArgs::~WindowArgs()
64 {
65 }
66 
67 WindowArgs &WindowArgs::operator=(const WindowArgs &args)
68 {
69  if (this == &args) {
70  return *this;
71  }
72 
73  d = args.d;
74  return *this;
75 }
76 
77 WindowArgs::WindowArgs(const QRect &_geometry, bool _fullscreen, bool _menuBarVisible, bool _toolBarsVisible, bool _statusBarVisible, bool _resizable)
78  : d(new WindowArgsPrivate)
79 {
80  d->x = _geometry.x();
81  d->y = _geometry.y();
82  d->width = _geometry.width();
83  d->height = _geometry.height();
84  d->fullscreen = _fullscreen;
85  d->menuBarVisible = _menuBarVisible;
86  d->toolBarsVisible = _toolBarsVisible;
87  d->statusBarVisible = _statusBarVisible;
88  d->resizable = _resizable;
89  d->lowerWindow = false;
90 }
91 
92 WindowArgs::WindowArgs(int _x,
93  int _y,
94  int _width,
95  int _height,
96  bool _fullscreen,
97  bool _menuBarVisible,
98  bool _toolBarsVisible,
99  bool _statusBarVisible,
100  bool _resizable)
101  : d(new WindowArgsPrivate)
102 {
103  d->x = _x;
104  d->y = _y;
105  d->width = _width;
106  d->height = _height;
107  d->fullscreen = _fullscreen;
108  d->menuBarVisible = _menuBarVisible;
109  d->toolBarsVisible = _toolBarsVisible;
110  d->statusBarVisible = _statusBarVisible;
111  d->resizable = _resizable;
112  d->lowerWindow = false;
113 }
114 
115 void WindowArgs::setX(int x)
116 {
117  d->x = x;
118 }
119 
120 int WindowArgs::x() const
121 {
122  return d->x;
123 }
124 
125 void WindowArgs::setY(int y)
126 {
127  d->y = y;
128 }
129 
130 int WindowArgs::y() const
131 {
132  return d->y;
133 }
134 
135 void WindowArgs::setWidth(int w)
136 {
137  d->width = w;
138 }
139 
140 int WindowArgs::width() const
141 {
142  return d->width;
143 }
144 
145 void WindowArgs::setHeight(int h)
146 {
147  d->height = h;
148 }
149 
150 int WindowArgs::height() const
151 {
152  return d->height;
153 }
154 
155 void WindowArgs::setFullScreen(bool fs)
156 {
157  d->fullscreen = fs;
158 }
159 
160 bool WindowArgs::isFullScreen() const
161 {
162  return d->fullscreen;
163 }
164 
165 void WindowArgs::setMenuBarVisible(bool visible)
166 {
167  d->menuBarVisible = visible;
168 }
169 
170 bool WindowArgs::isMenuBarVisible() const
171 {
172  return d->menuBarVisible;
173 }
174 
175 void WindowArgs::setToolBarsVisible(bool visible)
176 {
177  d->toolBarsVisible = visible;
178 }
179 
180 bool WindowArgs::toolBarsVisible() const
181 {
182  return d->toolBarsVisible;
183 }
184 
185 void WindowArgs::setStatusBarVisible(bool visible)
186 {
187  d->statusBarVisible = visible;
188 }
189 
190 bool WindowArgs::isStatusBarVisible() const
191 {
192  return d->statusBarVisible;
193 }
194 
195 void WindowArgs::setResizable(bool resizable)
196 {
197  d->resizable = resizable;
198 }
199 
200 bool WindowArgs::isResizable() const
201 {
202  return d->resizable;
203 }
204 
205 void WindowArgs::setLowerWindow(bool lower)
206 {
207  d->lowerWindow = lower;
208 }
209 
210 bool WindowArgs::lowerWindow() const
211 {
212  return d->lowerWindow;
213 }
214 
215 void WindowArgs::setScrollBarsVisible(bool visible)
216 {
217  d->scrollBarsVisible = visible;
218 }
219 
220 bool WindowArgs::scrollBarsVisible() const
221 {
222  return d->scrollBarsVisible;
223 }
int height() const const
int x() const const
int y() const const
int width() const const
The KParts namespace,.
The WindowArgs are used to specify arguments to the "create new window" call (see the createNewWindow...
Definition: windowargs.h:29
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Dec 2 2021 22:50:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.