Tizen 2.1 base
[apps/osp/Home.git] / inc / HmHomeItemInfo.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (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        HmHomeItemInfo.h
19  * @brief       Keeps declaration of the HomeItemInfo
20  * Declares the HomeItemInfo class, it keeps the information of all the applications installed.
21  */
22
23 #ifndef _HM_HOME_APP_INFO_H_
24 #define _HM_HOME_APP_INFO_H_
25
26 #include <FApp.h>
27 #include <FBase.h>
28
29 /**
30  * @class       HomeItemInfo
31  * @brief       Keeps all the informations of the applications.
32  */
33 class HomeItemInfo
34         : public Tizen::Base::Object
35 {
36 public:
37         /**
38          * Constructor
39          */
40         HomeItemInfo(void);
41
42         /**
43          * Destructor
44          */
45         virtual ~HomeItemInfo(void);
46
47         /**
48          * Returns applications ID
49          *
50          * @return Tizen::Base::String, Application's id
51          */
52         Tizen::Base::String GetAppId(void) const;
53
54         /**
55          * returns the application icon, the bitmap object to shown in the screen
56          *
57          * @return Bitmap*, the bitmap object for app icon
58          */
59         Tizen::Graphics::Bitmap* GetApplicationIcon(void) const;
60
61         /**
62          * Returns applications Name
63          *
64          * @return Tizen::Base::String*, Application's Name
65          */
66         Tizen::Base::String GetAppName(void) const;
67
68         /**
69          * tell about, the application's icon path
70          *
71          * @return bool, true if can be shown in Home else false.
72          */
73         Tizen::Base::String GetIconPath(void) const;
74
75         /**
76          * Returns package ID
77          *
78          * @return Tizen::Base::String, Package's id
79          */
80         Tizen::Base::String GetPackageId(void) const;
81
82         /**
83          * Gets the position of the application's icon in the home screen.
84          *
85          * @param[out] pageNumber, the page number
86          * @param[out] position, position in that page
87          */
88         void GetPositionInHomeScreen(int& pageNumber, int& position) const;
89
90         /**
91          * Initializes data by fetching information from the PackageInfo
92          *
93          * @return E_SUCCESS, otherwise standard error code
94          * @param[in] pPackInfo, the information of the package
95          */
96         result Initialize(Tizen::App::Package::PackageAppInfo* pPackAppInfo, Tizen::App::Package::PackageInfo* pPackInfo);
97
98         /**
99          * tells about, if the application can be uninstalled or not
100          *
101          * @return bool, true if can be uninstalled else false.
102          */
103         bool IsUnistallable(void) const;
104
105         /**
106          * tell about, if the app icon can be shown in the home screen
107          *
108          * @return bool, true if can be shown in Home else false.
109          */
110         bool IsVisibleInMainMenu(void) const;
111
112         /**
113          * sets the application icon, the bitmap object to shown in the screen
114          *
115          * @param[in] pBitmap, the bitmap object for app icon
116          */
117         void SetApplicationIcon(Tizen::Graphics::Bitmap* pAppIconBitmap);
118
119         /**
120          * sets the application name
121          *
122          * @param[in] newAppName, the name for this application
123          */
124         void SetApplicationName(Tizen::Base::String& newAppName);
125         /**
126          * Sets the index of this item
127          *
128          * @param[in]   newIndex, the new index for this application
129          */
130         void SetItemIndex(int newIndex);
131
132         /**
133          * Sets the position of the app icon in the home screen
134          *
135          * @param[in] pageNumber, the page number
136          * @param[in] position, position in that page
137          */
138         void SetPositionInHomeScreen(int pageNumber, int position);
139
140 private:
141         /**
142          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
143          */
144         HomeItemInfo(const HomeItemInfo&);
145
146         /**
147          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
148          */
149         HomeItemInfo& operator =(const HomeItemInfo&);
150
151 private:
152         bool __isVisibleInMainMenu;     // can be shown in the home screen
153         bool __isUninstallable;     // can be un-installed
154         int __pageNumber;     //Page number of this application in home screen
155         int __position;     // position of the application in home screen page
156         Tizen::Base::String __appId;     //application ID
157         Tizen::Base::String __appIconPath;     // Application's Icon Path
158         Tizen::Base::String __appName;     //Application name
159         Tizen::Graphics::Bitmap* __pAppIcon;     // decoded bitmap for the application Icon
160         Tizen::Base::String __packageId;    //package ID
161 };
162
163 #endif //_HM_HOME_APP_INFO_H_