fix proxy not to set instance when it's failed to construct, check exception for...
[platform/framework/native/shell.git] / src / inc / FShell_AppWidgetProviderInfoImpl.h
1 //
2 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FShell_AppWidgetProviderInfoImpl.h
19  * @brief       This is the header file for the _AppWidgetProviderInfoImpl class.
20  *
21  * This header file contains the declarations of the _AppWidgetProviderInfoImpl class.
22  */
23
24 #ifndef _FSHELL_INTERNAL_APPWIDGET_PROVIDER_INFO_IMPL_H_
25 #define _FSHELL_INTERNAL_APPWIDGET_PROVIDER_INFO_IMPL_H_
26
27 #include <FBaseCol.h>
28 #include <FAppTypes.h>
29 #include <FGrpDimension.h>
30
31 namespace Tizen { namespace Shell {
32
33 class _OSP_EXPORT_ _AppWidgetProviderInfoImpl
34         : public Tizen::Base::Object
35 {
36 public:
37
38         /**
39          * This is the constructor that initializes an instance of %AppWidgetProviderInfo with the specified values.
40          *
41          * @since 2.1
42          */
43         _AppWidgetProviderInfoImpl(const Tizen::App::AppId& appId, const Tizen::Base::String& name);
44
45         /**
46          * This destructor overrides Tizen::Base::Object::~Object().
47          *
48          * @since 2.1
49          */
50         virtual ~_AppWidgetProviderInfoImpl();
51
52         /**
53          * Gets the application ID.
54          *
55          * @since 2.1
56          *
57          * @return      The application ID
58          */
59         Tizen::App::AppId GetAppId() const;
60
61         /**
62          * Gets the AppWidget provider name
63          *
64          * @since 2.1
65          *
66          * @return      The application ID
67          */
68         Tizen::Base::String GetName() const;
69
70         /**
71          * Gets the display name of the Livbox @n
72          * If the system language setting is changed, this method returns the localized application name.
73          * The display name is displayed in applications that showing AppWidget like Launcher, and so on.
74          *
75          * @since 2.1
76          *
77          * @return      The display name of the Livbox
78          */
79         Tizen::Base::String GetDisplayName() const;
80
81         /**
82          * Gets the icon path of the application.
83          *
84          * @since 2.1
85          *
86          * @return      The icon path of the application, @n
87          * An empty string is returned if there is no value.
88          */
89         Tizen::Base::String GetIconPath() const;
90
91         Tizen::Base::String GetConfigurationAppControlAppId() const;
92
93         bool IsDefault() const;
94
95         /**
96          * Gets a list of AppWidgetSizeInfo of the AppWidget
97          *
98          * @since 2.1
99          *
100          * @return      A pointer to the array list that contains all AppWidgetSizeInfo of the AppWidgetProvider@n
101          *          else @c null if an error occurs
102          * @exception   E_SUCCESS                       The method is successful.
103          * @exception   E_SYSTEM                        A system error has occurred.
104          * @remarks     The specific error code can be accessed using the GetLastResult() method.
105          */
106     Tizen::Base::Collection::IList* GetSizeInfoListN() const;
107
108
109     // internal
110     static AppWidgetProviderInfo* GetAppWidgetProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
111     static AppWidgetProviderInfo* GetAppWidgetProviderInfoN(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, bool isDefault);
112
113     static _AppWidgetProviderInfoImpl* GetImpl(const AppWidgetProviderInfo& appwidgetProviderInfo);
114     static int GetPrivilegeLevel(const Tizen::App::AppId& appId);
115     static bool IsValidSize(const Tizen::App::AppId& appId, int w, int h);
116
117 private:
118         /**
119          * This is the default constructor for this class.
120          *
121          * @since 2.1
122          */
123     _AppWidgetProviderInfoImpl();
124
125         /**
126          * This is the copy constructor for the %AppWidgetProviderInfo class.
127          *
128          * @since 2.1
129          *
130          * @param[in]   value   An instance of %AppWidgetProviderInfo
131          */
132         _AppWidgetProviderInfoImpl(const _AppWidgetProviderInfoImpl& rhs);
133
134         /**
135          * Assigns the value of the specified instance of %AppWidgetProviderInfo to the current instance of %AppWidgetProviderInfo.
136          *
137          * @since 2.1
138          *
139          * @param[in]   rhs     An instance of %AppWidgetProviderInfo
140          */
141         _AppWidgetProviderInfoImpl& operator =(const _AppWidgetProviderInfoImpl& rhs);
142
143         static bool IsExist(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
144
145
146 private:
147     Tizen::Base::String __appId;
148     Tizen::Base::String __name;
149     bool __isDefault;
150     Tizen::Base::String __providerId;
151     Tizen::Base::String __displayName; //TODO:temporary public
152     Tizen::Base::String __configurationAppControlAppId; //TODO:temporary public
153
154 //    Tizen::Base::String __iconPath;
155     Tizen::Base::Collection::ArrayList __sizeInfos;
156
157     friend class AppWidgetProviderInfo;
158 //    friend class _AppWidgetManagerImpl;
159 };
160
161 }} // Tizen::Shell
162 #endif // _FSHELL_INTERNAL_APPWIDGET_PROVIDER_INFO_IMPL_H_