cbbe31efa91a94cd74641cd823cb211addc1cb4f
[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 Create object view.
52    *
53    * @since_tizen 3.0
54    * @return A handle to ObjectView.
55    */
56   static ObjectView New();
57
58   /**
59    * @brief Downcast a handle to ObjectView handle.
60    *
61    * If the BaseHandle points is a ObjectView the downcast returns a valid handle.
62    * If not the returned handle is left empty.
63    *
64    * @since_tizen 3.0
65    * @param[in] handle Handle to an object
66    * @return handle to a ObjectView or an empty handle
67    */
68   static ObjectView DownCast( BaseHandle handle );
69
70   /**
71    * @brief Creates an empty handle.
72    * @since_tizen 3.0
73    */
74   ObjectView();
75
76   /**
77    * @brief Copy constructor.
78    *
79    * @since_tizen 3.0
80    * @param[in] handle The handle to copy from.
81    */
82   ObjectView( const ObjectView& handle );
83
84   /**
85    * @brief Assignment operator.
86    *
87    * @since_tizen 3.0
88    * @param[in] handle The handle to copy from.
89    * @return A reference to this.
90    */
91   ObjectView& operator=( const ObjectView& handle );
92
93   /**
94    * @brief Destructor
95    *
96    * This is non-virtual since derived Handle types must not contain data or virtual methods.
97    * @since_tizen 3.0
98    */
99   ~ObjectView();
100
101   /**
102    * @brief Sets this ObjectView from an Image.
103    *
104    * If the handle is empty, ObjectView will display nothing.
105    * @since_tizen 3.0
106    * @param[in] image The Image to display.
107    */
108   void SetImage( Image image );
109
110   /**
111    * @brief Gets pid of the client.
112    *
113    * @since_tizen 3.0
114    * @return pid on success, otherwise 0.
115    */
116   pid_t GetPid() const;
117
118   /**
119    * @brief Gets title of the client.
120    *
121    * @since_tizen 3.0
122    * @return title on success, otherwise empty string.
123    */
124   std::string GetTitle() const;
125
126   /**
127    * @brief Gets app id of the client.
128    *
129    * @since_tizen 3.0
130    * @return app id on success, otherwise empty string.
131    */
132   std::string GetAppId() const;
133
134   /**
135    * @brief Cancels touch event procedure.
136    *
137    * @since_tizen 3.0
138    * @return true on success, false otherwise.
139    */
140   bool CancelTouchEvent();
141
142 public: // Not intended for application developers
143
144   /**
145    * @brief Creates a handle using the ObjectView::Internal implementation.
146    *
147    * @since_tizen 3.0
148    * @param[in] implementation The ObjectView implementation.
149    */
150   DALI_INTERNAL ObjectView( Internal::ObjectView& implementation );
151
152   /**
153    * @brief Allows the creation of this control from an Internal::CustomActor pointer.
154    *
155    * @since_tizen 3.0
156    * @param[in] internal A pointer to the internal CustomActor.
157    */
158   DALI_INTERNAL ObjectView( Dali::Internal::CustomActor* internal );
159 };
160
161 /**
162  * @}
163  */
164 } // namespace Pepper
165
166 } // namespace Dali
167
168 #endif // __DALI_PEPPER_OBJECT_VIEW_H__