9951c8ef6da7fc6420cca2fa0a2da47517ace6bb
[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          * @return      An error code
74          * @param[in]   appId                           The AppId of the installed application
75          * @param[in]   providerName            The name of the AppWidget provider
76          * @param[in]   rect                            An instance of the FloatRectangle class @n
77          *                                                                      This instance represents the x and y coordinates of the top-left corner @n
78          *                                                                      of the created window along with its width and height. @n
79          * @exception   E_SUCCESS           The method is successful.
80          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
81          * @exception   E_APP_NOT_INSTALLED     The application is not installed.
82          * @exception   E_OBJ_NOT_FOUND         The specified AppWidget provider is not found.
83          */
84         result Construct(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::FloatRectangle& rect);
85
86         /**
87          * Initializes this instance of %AppWidgetView with the specified parameter.
88          *
89          * @since       2.1
90          * @return      An error code
91          * @param[in]   appId                           The AppId of the installed application
92          * @param[in]   providerName            The name of the AppWidget provider
93          * @param[in]   rect                            An instance of the FloatRectangle class @n
94          *                                                                      This instance represents the x and y coordinates of the top-left corner @n
95          *                                                                      of the created window along with its width and height. @n
96          * @param[in]   userInfo                        Extra data to be delivered to AppWidget provider
97          * @exception   E_SUCCESS           The method is successful.
98          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
99          * @exception   E_APP_NOT_INSTALLED     The application is not installed.
100          * @exception   E_OBJ_NOT_FOUND         The specified AppWidget provider is not found.
101          */
102         result Construct(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Graphics::FloatRectangle& rect, const Tizen::Base::String& userInfo);
103
104         /*
105         * Gets a AppWidgetProviderInfo of the specified AppWidget provider.
106         *
107         * @since                2.1
108         *
109         * @return               A pointer to the AppWidgetProviderInfo of the specified AppWidgetProvider@n
110         *                               else @c null if an error occurs
111         * @exception    E_SUCCESS                       The method is successful.
112         * @exception    E_APP_NOT_INSTALLED     The application is not installed.
113         * @exception    E_OBJ_NOT_FOUND         The specified AppWidget provider is not found.
114         * @remarks              The specific error code can be accessed using the GetLastResult() method.
115         */
116         AppWidgetProviderInfo* GetAppWidgetProviderInfoN(void) const;
117
118         /*
119          * Adds an IAppWidgetViewEventListener instance. @n
120          *
121          * @since               2.1
122          * @return      An error code
123          * @param[in]   listener                        The listener to add @n
124          *                                                                      The listener must be allocated at heap, not stack.
125          * @exception   E_SUCCESS                       The method is successful.
126          * @exception   E_OBJ_ALREADY_EXIST     The listener has already been added.
127          * @see                 RemoveAppWidgetViewEventListener()
128          */
129         result AddAppWidgetViewEventListener(IAppWidgetViewEventListener& listener);
130
131         /*
132          * Removes an IAppWidgetViewEventListener instance. @n
133          * The removed listener cannot listen to the events when they are fired.
134          *
135          * @since               2.1
136          * @return      An error code
137          * @param[in]   listener                        The listener to remove @n
138          *                                                                      The listener should be referring to previously allocated instance which is passed as an argument to AddAppWidgetViewEventListener().
139          * @exception   E_SUCCESS                       The method is successful.
140          * @exception   E_OBJ_NOT_FOUND         The specified listener cannot be found.
141          * @see                 AddAppWidgetViewEventListener()
142          */
143         result RemoveAppWidgetViewEventListener(IAppWidgetViewEventListener& listener);
144
145 protected:
146         //
147         // This method is for internal use only. Using this method can cause behavioral, security-related,
148         // and consistency-related issues in the application.
149         //
150         // Following method is reserved and may change its name at any time without prior notice.
151         //
152         virtual void AppWidgetView_Reserved1(void) {}
153
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_Reserved2(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_Reserved3(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_Reserved4(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_Reserved5(void) {}
185
186 private:
187         //
188         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
189         //
190         AppWidgetView(const AppWidgetView& rhs);
191
192         //
193         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
194         //
195         AppWidgetView& operator =(const AppWidgetView& rhs);
196 }; // AppWidgetView
197
198 }} // Tizen::Shell
199
200 #endif // _FSHELL_APPWIDGET_VIEW_H_