01382a3c76916f1c189413155356a8f3efc2c6a8
[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         bool setVkbdFloating(bool set);
77         bool getVkbdFloating();
78
79         void setRenderView(std::shared_ptr<DSRenderView> &renderView);
80         void setDisplayDeviceHWCWindow(std::shared_ptr<IDSDisplayDeviceHWCWindow> &displayDeviceHWCWindow);
81
82 private:
83         void __onSurfaceCommitted(std::shared_ptr<DSWaylandSurfaceCommitInfo> waylandSurfaceCommitInfo);
84
85         DSWindow *__parent;
86         std::list<DSWindow*> __childList;
87         int __x, __y;
88         unsigned int __w;
89         unsigned int __h;
90         unsigned int __zOrder;
91         unsigned int __committedW, __committedH;
92         bool __created;
93         bool __hasFocus;
94         std::shared_ptr<DSWaylandSurface> __waylandSurface;
95         bool __acceptsFocus;
96         bool __allowUserGeometry;
97         std::string __title;
98
99         bool __vkbd_floating;
100
101         std::shared_ptr<DSRenderView> __renderView;
102         std::shared_ptr<IDSDisplayDeviceHWCWindow> __displayDeviceHWCWindow;
103 };
104
105 }
106
107 #endif // _DS_WINDOW_PRIVATE_H_