Add ObjectView::SetVisibilityState() API.
[platform/core/uifw/pepper-dali.git] / pepper-dali / public-api / object-view / object-view.h
1 #ifndef __DALI_PEPPER_OBJECT_VIEW_H__
2 #define __DALI_PEPPER_OBJECT_VIEW_H__
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23
24 namespace Dali
25 {
26
27 namespace Pepper
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 class ObjectView;
33 }
34
35 /**
36  * @addtogroup dali_pepper_compositor
37  * @{
38  */
39
40 /**
41  * @brief ObjectView is a container for images of client surfaces. It displays the images.
42  * And input events that ObjectView gets are delivered to the client.
43  *
44  * @since_tizen 3.0
45  */
46 class DALI_IMPORT_API ObjectView : public Toolkit::Control
47 {
48 public:
49
50   /**
51    * @brief Visibility state
52    * @since_tizen 3.0
53    */
54   enum VisibilityState
55   {
56     UNOBSCURED,           ///< ObjectView is unobscured @since_tizen 3.0
57     PARTIALLY_OBSCURED,   ///< ObjectView is partially obscured @since_tizen 3.0
58     FULLY_OBSCURED        ///< ObjectView is fully obscured @since_tizen 3.0
59   };
60
61   /**
62    * @brief Create object view.
63    *
64    * @since_tizen 3.0
65    * @return A handle to ObjectView.
66    */
67   static ObjectView New();
68
69   /**
70    * @brief Downcast a handle to ObjectView handle.
71    *
72    * If the BaseHandle points is a ObjectView the downcast returns a valid handle.
73    * If not the returned handle is left empty.
74    *
75    * @since_tizen 3.0
76    * @param[in] handle Handle to an object
77    * @return handle to a ObjectView or an empty handle
78    */
79   static ObjectView DownCast( BaseHandle handle );
80
81   /**
82    * @brief Creates an empty handle.
83    * @since_tizen 3.0
84    */
85   ObjectView();
86
87   /**
88    * @brief Copy constructor.
89    *
90    * @since_tizen 3.0
91    * @param[in] handle The handle to copy from.
92    */
93   ObjectView( const ObjectView& handle );
94
95   /**
96    * @brief Assignment operator.
97    *
98    * @since_tizen 3.0
99    * @param[in] handle The handle to copy from.
100    * @return A reference to this.
101    */
102   ObjectView& operator=( const ObjectView& handle );
103
104   /**
105    * @brief Destructor
106    *
107    * This is non-virtual since derived Handle types must not contain data or virtual methods.
108    * @since_tizen 3.0
109    */
110   ~ObjectView();
111
112   /**
113    * @brief Sets this ObjectView from an Image.
114    *
115    * If the handle is empty, ObjectView will display nothing.
116    * @since_tizen 3.0
117    * @param[in] image The Image to display.
118    */
119   void SetImage( Image image );
120
121   /**
122    * @brief Gets pid of the client.
123    *
124    * @since_tizen 3.0
125    * @return pid on success, otherwise 0.
126    */
127   pid_t GetPid() const;
128
129   /**
130    * @brief Gets title of the client.
131    *
132    * @since_tizen 3.0
133    * @return title on success, otherwise empty string.
134    */
135   std::string GetTitle() const;
136
137   /**
138    * @brief Gets app id of the client.
139    *
140    * @since_tizen 3.0
141    * @return app id on success, otherwise empty string.
142    */
143   std::string GetAppId() const;
144
145   /**
146    * @brief Cancels touch event procedure.
147    *
148    * @since_tizen 3.0
149    * @return true on success, false otherwise.
150    */
151   bool CancelTouchEvent();
152
153   /**
154    * @brief Shows the ObjectView
155    *
156    * @since_tizen 3.0
157    */
158   void Show();
159
160   /**
161    * @brief Hides the ObjectView
162    *
163    * @since_tizen 3.0
164    */
165   void Hide();
166
167   /**
168    * @brief Set visibility state of the client.
169    * The client will get window visibility change event if this function is called.
170    *
171    * @since_tizen 3.0
172    * @param[in] state The state of visibility.
173    */
174   void SetVisibilityState( VisibilityState state );
175
176 public: // Not intended for application developers
177
178   /**
179    * @brief Creates a handle using the ObjectView::Internal implementation.
180    *
181    * @since_tizen 3.0
182    * @param[in] implementation The ObjectView implementation.
183    */
184   DALI_INTERNAL ObjectView( Internal::ObjectView& implementation );
185
186   /**
187    * @brief Allows the creation of this control from an Internal::CustomActor pointer.
188    *
189    * @since_tizen 3.0
190    * @param[in] internal A pointer to the internal CustomActor.
191    */
192   DALI_INTERNAL ObjectView( Dali::Internal::CustomActor* internal );
193 };
194
195 /**
196  * @}
197  */
198 } // namespace Pepper
199
200 } // namespace Dali
201
202 #endif // __DALI_PEPPER_OBJECT_VIEW_H__