DSWindowPrivate: add setPosition method
[platform/core/uifw/libds.git] / src / DSWindow / DSWindowPrivate.h
1 /*
2 * Copyright © 2020 Samsung Electronics co., Ltd. All Rights Reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * 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
24 #ifndef _DS_WINDOW_PRIVATE_H_
25 #define _DS_WINDOW_PRIVATE_H_
26
27 #include "DSCore.h"
28 #include "DSObjectPrivate.h"
29 #include "DSWaylandSurface.h"
30 #include "DSRenderView.h"
31 #include "IDSDisplayDeviceHWCWindow.h"
32
33 namespace display_server
34 {
35
36 class DSWindow;
37
38 class DSWindowPrivate : public DSObjectPrivate, public DSObject
39 {
40         DS_PIMPL_USE_PUBLIC(DSWindow)
41
42 public:
43         DSWindowPrivate() = delete;
44         DSWindowPrivate(DSWindow *p_ptr);
45         ~DSWindowPrivate();
46
47         bool create(std::shared_ptr<DSWaylandSurface> waylandSurface);
48         void destroy(void);
49
50         void setParent(DSWindow *parent);
51         DSWindow *getParent(void);
52
53         bool show(void);
54         bool hide(bool autoFocus);
55         int  showState(void);
56
57         bool setTitle(const std::string &title);
58         const std::string getTitle(void);
59
60         bool setSkipFocus(bool set);
61         bool getSkipFocus(void);
62
63         void allowUserGeometry(bool set);
64         bool isAllowUserGeometry(void);
65
66         bool setLayer(int layer);
67         bool raise(void);
68         bool lower(void);
69         bool raiseToTop();
70         bool lowerToBottom();
71
72         bool unsetFocus(void);
73         bool setFocus(void);
74         bool isCreated();
75
76         void setPosition(int x, int y);
77
78         bool setVkbdFloating(bool set);
79         bool getVkbdFloating();
80
81         void setRenderView(std::shared_ptr<DSRenderView> &renderView);
82         void setDisplayDeviceHWCWindow(std::shared_ptr<IDSDisplayDeviceHWCWindow> &displayDeviceHWCWindow);
83
84 private:
85         void __onSurfaceCommitted(std::shared_ptr<DSWaylandSurfaceCommitInfo> waylandSurfaceCommitInfo);
86
87         DSWindow *__parent;
88         std::list<DSWindow*> __childList;
89         int __x, __y;
90         unsigned int __w;
91         unsigned int __h;
92         unsigned int __zOrder;
93         unsigned int __committedW, __committedH;
94         bool __created;
95         bool __hasFocus;
96         std::shared_ptr<DSWaylandSurface> __waylandSurface;
97         bool __acceptsFocus;
98         bool __allowUserGeometry;
99         std::string __title;
100
101         bool __vkbd_floating;
102
103         std::shared_ptr<DSRenderView> __renderView;
104         std::shared_ptr<IDSDisplayDeviceHWCWindow> __displayDeviceHWCWindow;
105 };
106
107 }
108
109 #endif // _DS_WINDOW_PRIVATE_H_