[ACR][Add] Add appwidget feature, and add exception for optional feature.
[platform/framework/native/shell.git] / inc / FShellAppWidgetView.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                FShellAppWidgetView.h
20  * @brief       This is the header file for the %AppWidgetView class.
21  *
22  * This header file contains the declarations of the %AppWidgetView class.
23  */
24
25 #ifndef _FSHELL_APPWIDGET_VIEW_H_
26 #define _FSHELL_APPWIDGET_VIEW_H_
27
28 #include <FAppTypes.h>
29 #include <FUiContainer.h>
30
31 namespace Tizen { namespace Base
32 {
33 class String;
34 }} // Tizen::Base
35
36 namespace Tizen { namespace Shell
37 {
38
39 class IAppWidgetViewEventListener;
40 class AppWidgetProviderInfo;
41
42 /**
43  * @class       AppWidgetView
44  * @brief       This class provides the view control for a AppWidgetViewer.
45  * @since       2.1
46  *
47  * The %AppWidgetView shows a drawn buffer by AppWidgetProvider.
48  *
49  */
50 class _OSP_EXPORT_ AppWidgetView
51         : public Tizen::Ui::Container
52 {
53 public:
54         /**
55          * The object is not fully constructed after this constructor is called.
56          * For full construction, the Construct() method must be called after calling this constructor.
57          *
58          * @since       2.1
59          */
60         AppWidgetView(void);
61
62         /**
63          * This destructor overrides Tizen::Base::Object::~Object().
64          *
65          * @since       2.1
66          */
67         virtual ~AppWidgetView(void);
68
69         /**
70          * Initializes this instance of %AppWidgetView with the specified parameter.
71          *
72          * @since       2.1
73          * @feature             %http://tizen.org/feature/shell.appwidget\r
74          * @return      An error code
75          * @param[in]   appId                           The AppId of the installed application
76          * @param[in]   providerName            The name of the AppWidget provider
77          * @param[in]   rect                            An instance of the FloatRectangle class @n
78          *                                                                      This instance represents the x and y coordinates of the top-left corner @n
79          *                                                                      of the created window along with its width and height. @n
80          * @exception   E_SUCCESS           The method is successful.
81          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
82          * @exception   E_APP_NOT_INSTALLED     The application is not installed.
83          * @exception   E_OBJ_NOT_FOUND         The specified AppWidget provider is not found.
84          * @exception   E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature.\r
85          *                                                                      For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.\r
86          * remarks              Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.\r
87          */
88         result Construct(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::FloatRectangle& rect);
89
90         /**
91          * Initializes this instance of %AppWidgetView with the specified parameter.
92          *
93          * @since       2.1
94          * @feature             %http://tizen.org/feature/shell.appwidget
95          * @return      An error code
96          * @param[in]   appId                           The AppId of the installed application
97          * @param[in]   providerName            The name of the AppWidget provider
98          * @param[in]   rect                            An instance of the FloatRectangle class @n
99          *                                                                      This instance represents the x and y coordinates of the top-left corner @n
100          *                                                                      of the created window along with its width and height. @n
101          * @param[in]   userInfo                        Extra data to be delivered to AppWidget provider
102          * @exception   E_SUCCESS           The method is successful.
103          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
104          * @exception   E_APP_NOT_INSTALLED     The application is not installed.
105          * @exception   E_OBJ_NOT_FOUND         The specified AppWidget provider is not found.
106          * @exception   E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature.\r
107          *                                                                      For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.\r
108          * remarks              Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
109          */
110         result Construct(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::FloatRectangle& rect, const Tizen::Base::String& userInfo);
111
112         /*
113         * Gets a AppWidgetProviderInfo of the specified AppWidget provider.
114         *
115         * @since                2.1
116         *
117         * @return               A pointer to the AppWidgetProviderInfo of the specified AppWidgetProvider@n
118         *                               else @c null if an error occurs
119         * @exception    E_SUCCESS                       The method is successful.
120         * @exception    E_APP_NOT_INSTALLED     The application is not installed.
121         * @exception    E_OBJ_NOT_FOUND         The specified AppWidget provider is not found.
122         * @remarks              The specific error code can be accessed using the GetLastResult() method.
123         */
124         AppWidgetProviderInfo* GetAppWidgetProviderInfoN(void) const;
125
126         /*
127          * Adds an IAppWidgetViewEventListener instance. @n
128          *
129          * @since               2.1
130          * @return      An error code
131          * @param[in]   listener                        The listener to add @n
132          *                                                                      The listener must be allocated at heap, not stack.
133          * @exception   E_SUCCESS                       The method is successful.
134          * @exception   E_OBJ_ALREADY_EXIST     The listener has already been added.
135          * @see                 RemoveAppWidgetViewEventListener()
136          */
137         result AddAppWidgetViewEventListener(IAppWidgetViewEventListener& listener);
138
139         /*
140          * Removes an IAppWidgetViewEventListener instance. @n
141          * The removed listener cannot listen to the events when they are fired.
142          *
143          * @since               2.1
144          * @return      An error code
145          * @param[in]   listener                        The listener to remove @n
146          *                                                                      The listener should be referring to previously allocated instance which is passed as an argument to AddAppWidgetViewEventListener().
147          * @exception   E_SUCCESS                       The method is successful.
148          * @exception   E_OBJ_NOT_FOUND         The specified listener cannot be found.
149          * @see                 AddAppWidgetViewEventListener()
150          */
151         result RemoveAppWidgetViewEventListener(IAppWidgetViewEventListener& listener);
152
153 protected:
154         //
155         // This method is for internal use only. Using this method can cause behavioral, security-related,
156         // and consistency-related issues in the application.
157         //
158         // Following method is reserved and may change its name at any time without prior notice.
159         //
160         virtual void AppWidgetView_Reserved1(void) {}
161
162         //
163         // This method is for internal use only. Using this method can cause behavioral, security-related,
164         // and consistency-related issues in the application.
165         //
166         // Following method is reserved and may change its name at any time without prior notice.
167         //
168         virtual void AppWidgetView_Reserved2(void) {}
169
170         //
171         // This method is for internal use only. Using this method can cause behavioral, security-related,
172         // and consistency-related issues in the application.
173         //
174         // Following method is reserved and may change its name at any time without prior notice.
175         //
176         virtual void AppWidgetView_Reserved3(void) {}
177
178         //
179         // This method is for internal use only. Using this method can cause behavioral, security-related,
180         // and consistency-related issues in the application.
181         //
182         // Following method is reserved and may change its name at any time without prior notice.
183         //
184         virtual void AppWidgetView_Reserved4(void) {}
185
186         //
187         // This method is for internal use only. Using this method can cause behavioral, security-related,
188         // and consistency-related issues in the application.
189         //
190         // Following method is reserved and may change its name at any time without prior notice.
191         //
192         virtual void AppWidgetView_Reserved5(void) {}
193
194 private:
195         //
196         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
197         //
198         AppWidgetView(const AppWidgetView& rhs);
199
200         //
201         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
202         //
203         AppWidgetView& operator =(const AppWidgetView& rhs);
204 }; // AppWidgetView
205
206 }} // Tizen::Shell
207
208 #endif // _FSHELL_APPWIDGET_VIEW_H_