b88af968d71af11c1501cf244b7b7f58200f7d58
[platform/framework/native/shell.git] / inc / FShellAppWidgetPopup.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FShellAppWidgetPopup.h
20  * @brief       This is the header file for the %AppWidgetPopup class.
21  *
22  * This header file contains the declarations of the %AppWidgetPopup class.
23  */
24
25 #ifndef _FSHELL_APPWIDGET_POPUP_H_
26 #define _FSHELL_APPWIDGET_POPUP_H_
27
28 #include <FUiWindow.h>
29
30 namespace Tizen { namespace Shell
31 {
32
33 /**
34  * @class       AppWidgetPopup
35  * @brief       This class provides the popup for a AppWidgetProvider.
36  * @since       2.1
37  *
38  * The %AppWidgetPopup supports detailed screen for a AppWidgetProvider.
39  *
40  */
41 class _OSP_EXPORT_ AppWidgetPopup
42         : public Tizen::Ui::Window
43 {
44 public:
45         /**
46          * The object is not fully constructed after this constructor is called.
47          * For full construction, the Construct() method must be called after calling this constructor.
48          *
49          * @since       2.1
50          */
51         AppWidgetPopup(void);
52
53         /**
54          * This destructor overrides Tizen::Base::Object::~Object().
55          *
56          * @since       2.1
57          */
58         virtual ~AppWidgetPopup(void);
59
60         /**
61          * Initializes this instance of %AppWidgetFrame with the specified parameter.
62          *
63          * @since       2.1
64          * @feature             %http://tizen.org/feature/shell.appwidget
65          * @return      An error code
66          * @param[in]   size                            The new width and height
67          * @exception   E_SUCCESS           The method is successful.
68          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
69          * @exception   E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature.\r
70          *                                                                      For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.\r
71          * remarks              Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
72          * @see AppWidgetProvider::OnAppWidgetPopupProviderInitialize()
73          */
74         result Construct(const Tizen::Graphics::FloatDimension& size);
75
76         /**
77          * Initializes this instance of %AppWidgetFrame with the specified parameter.
78          *
79          * @since       2.1
80          * @feature             %http://tizen.org/feature/shell.appwidget
81          * @return      An error code
82          * @param[in]   layout                          The layout for both the portrait and landscape mode
83          * @param[in]   size                            The new width and height
84          * @exception   E_SUCCESS           The method is successful.
85          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
86          * @exception   E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature.\r
87          *                                                                      For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.\r
88          * remarks              Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
89          * @see AppWidgetProvider::OnAppWidgetPopupProviderInitialize()
90          */
91         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& size);
92
93         /**
94          * Gets the bounds of the client area.
95          *
96          * @since               2.1
97          *
98          * @return              The bounds of the client area in a FloatRectangle instance
99          */
100         Tizen::Graphics::FloatRectangle GetClientAreaBounds(void) const;
101
102         /**
103          * Creates and returns a graphics canvas whose bounds (position and size) are equal to the bounds of the client area of the %AppWidgetPopup.
104          *
105          * @since               2.1
106          *
107          * @return              The graphic canvas of the %AppWidgetPopup, @n
108          *                              else @c null if an error occurs
109          * @exception   E_SUCCESS                                       The method is successful.
110          * @exception   E_RESOURCE_UNAVAILABLE          The required resource is currently unavailable.
111          * @remarks             The method allocates a Tizen::Graphics::Canvas whose bounds are equal to that of the client area of the % AppWidgetPopup. @n
112          *                              It is the responsibility of the developers to deallocate the canvas after use.
113          * @remarks             The canvas is valid only if the properties of the parent control of the canvas remain unchanged. @n
114          *                              Therefore, delete the previously allocated canvas and create a new canvas using the GetClientAreaCanvasN() method if the size or position of the
115          *                              control is changed.
116          * @remarks             The specific error code can be accessed using the GetLastResult() method.
117          */
118         Tizen::Graphics::Canvas* GetClientAreaCanvasN(void) const;
119
120         /**
121          * Translates the specified position to the client coordinates.
122          *
123          * @since       2.1
124          *
125          * @return      The float position in relative to the top-left corner of the client-area, @n
126          *                              else @c (-1.0f,-1.0f) if the instance is invalid
127          * @param[in]   controlPosition       The float position relative to the top-left corner of the %AppWidgetPopup.
128          * @see         TranslateToControlPosition()
129          */
130         Tizen::Graphics::FloatPoint TranslateToClientAreaPosition(const Tizen::Graphics::FloatPoint& controlPosition) const;
131
132         /**
133          * Translates the specified client position to the control coordinate.
134          *
135          * @since       2.1
136          *
137          * @return      The float position in relative to the top-left corner of the %Popup control, @n
138          *                              else @c (-1.0f,-1.0f) if the instance is invalid
139          * @param[in]   clientPosition        The float position relative to the top-left corner of the client area
140          * @see         TranslateToClientAreaPosition()
141          */
142         Tizen::Graphics::FloatPoint TranslateToControlPosition(const Tizen::Graphics::FloatPoint& clientPosition) const;
143
144 protected:
145         //
146         // This method is for internal use only. Using this method can cause behavioral, security-related,
147         // and consistency-related issues in the application.
148         //
149         // Following method is reserved and may change its name at any time without prior notice.
150         //
151         virtual void AppWidgetPopup_Reserved1(void) {}
152
153         //
154         // This method is for internal use only. Using this method can cause behavioral, security-related,
155         // and consistency-related issues in the application.
156         //
157         // Following method is reserved and may change its name at any time without prior notice.
158         //
159         virtual void AppWidgetPopup_Reserved2(void) {}
160
161         //
162         // This method is for internal use only. Using this method can cause behavioral, security-related,
163         // and consistency-related issues in the application.
164         //
165         // Following method is reserved and may change its name at any time without prior notice.
166         //
167         virtual void AppWidgetPopup_Reserved3(void) {}
168
169         //
170         // This method is for internal use only. Using this method can cause behavioral, security-related,
171         // and consistency-related issues in the application.
172         //
173         // Following method is reserved and may change its name at any time without prior notice.
174         //
175         virtual void AppWidgetPopup_Reserved4(void) {}
176
177         //
178         // This method is for internal use only. Using this method can cause behavioral, security-related,
179         // and consistency-related issues in the application.
180         //
181         // Following method is reserved and may change its name at any time without prior notice.
182         //
183         virtual void AppWidgetPopup_Reserved5(void) {}
184
185 private:
186         //
187         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
188         //
189         AppWidgetPopup(const AppWidgetPopup& rhs);
190
191         //
192         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
193         //
194         AppWidgetPopup& operator =(const AppWidgetPopup& rhs);
195 }; // AppWidgetPopup
196
197 }} // Tizen::Shell
198
199 #endif // _FSHELL_APPWIDGET_POPUP_H_