Update change log and spec for wrt-plugins-tizen_0.4.20
[platform/framework/web/wrt-plugins-tizen.git] / src / Notification / StatusNotification.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 #ifndef __TIZEN_STATUS_NOTIFICATION_H__
19 #define __TIZEN_STATUS_NOTIFICATION_H__
20
21 #include <MultiCallbackUserData.h>
22
23 #include <app.h>
24 #include <notification.h>
25
26 #include <JSApplicationControl.h>
27 #include "NotificationTypes.h"
28 #include "NotificationDetailInfo.h"
29
30 using namespace DeviceAPI::Common;
31
32 namespace DeviceAPI {
33 namespace Notification {
34
35 class StatusNotification
36 {
37
38 public:
39         StatusNotification(NotificationType type);              //type.
40         StatusNotification(void* noti);                                 // notification 
41         StatusNotification(int privID);                         //private ID of Notification.
42         
43         ~StatusNotification();
44         
45         NotificationProgressType getProgressType()
46         {
47                 return m_progressType;
48         }
49
50         std::string getEnumProgressType();
51         
52         void setProgressType( NotificationProgressType type)
53         {
54                 m_progressType = type;
55         }
56         void setUpdatedFlag(bool value)
57         {
58              if (value)
59                 LogDebug("set True");
60              m_notiUpdated = value;
61         }
62         
63         bool getUpdatedFlag()
64         {
65              return m_notiUpdated;
66         }
67
68         bool getLaunchFlag()
69         {
70             return m_launchFlag;
71         }
72
73         void setLaunchFlag(bool value)
74         {
75             m_launchFlag = value;
76         }
77
78         NotificationType getNotiType()
79         {
80                 return m_notiType;
81         }
82
83         void setNotiType(NotificationType type)
84         {
85                 m_notiType = type;
86         }
87         
88         int getID();
89         std::string getStatusType();
90         void setStatusType(std::string type);
91         
92         time_t getPostedTime();
93         std::string getTitle();
94         void setTitle(std::string title);
95         std::string getContent();
96         void setContent(std::string content);
97                 
98         std::string getIconPath() ;     
99         void setIconPath(const std::string& iconPath) ;
100
101         std::string getSoundPath() ;
102         void setSoundPath(const std::string& sound) ;
103         
104         bool getDefaultVibration() ;    
105         void setDefaultVibration(const bool& vibration) ;
106         
107         double getProgressValue() ;
108         void setProgressValue(const double & progressValue) ;
109         
110         std::string getSubIconPath() ;
111         void setSubIconPath(const std::string& subIconPath) ;
112
113 #if 0   
114         std::vector<std::string> getInformations() ;
115         std::string getInformation(int index)  ;
116         void setInformations(std::vector<std::string>& infos) ;
117         void setInformation( const std::string& info, int index) ;
118         
119         std::vector<std::string> getSubInformations() ;
120         std::string getSubInformation(int index)  ;
121         void setSubInformations(std::vector<std::string>& infos) ;
122         void setSubInformation( const std::string& info, int index) ;
123 #endif
124
125         std::vector<std::string> getThumbnails();
126         void setThumbnails(std::vector<std::string> thumbs);
127         
128         std::string getBackground() ;
129         void setBackground(const std::string imagePath) ;
130         
131         unsigned int getNumber() ;
132         void setNumber(const unsigned int number) ;
133
134         
135         //void setStatusType(NotificationType type);
136         DeviceAPI::Application::ApplicationControlPtr getApplicationControl();
137         void setApplicationControl(DeviceAPI::Application::ApplicationControlPtr control);
138         void setApplicationId(const std::string& appId);
139         std::string getApplicationId();
140
141         void* getNotificationHandle();
142         void setNotificationHandle(void *handle);
143
144         service_h getService();
145
146         //Detail Info
147         std::vector<NotificationDetailInfo*> getDetailInfos() const;
148         void setDetailInfos(const std::vector<NotificationDetailInfo*> value);
149         int getDetailInfosNum() const;
150         void addDetailInfo(NotificationDetailInfo* value);
151         void clearDetailInfos();
152
153 private:
154                 
155         void loadThumbnails();
156         void setThumbnail( const std::string& info, int index);
157         std::string getThumbnail(int index);
158
159         std::string getInformation(int index)  ;
160         void setInformation( const std::string& info, int index) ;
161
162         std::string getSubInformation(int index)  ;
163         void setSubInformation( const std::string& info, int index) ;   
164         
165         void loadDetailInfos();
166                 
167 protected:
168
169         //NotificationType m_notiType;
170         NotificationType m_notiType;
171         service_h m_service;
172         notification_h m_notiHandle;
173         NotificationProgressType m_progressType;
174         bool m_notiUpdated;
175         bool m_launchFlag;
176         
177         std::vector<std::string> m_thumbs;                              //thumbnail images path
178         std::vector<NotificationDetailInfo*> m_detailInfos;   // detail Info
179
180 #if 0
181 public:
182     StatusNotification();
183     virtual ~StatusNotification();
184
185     std::string getStatusType() const;
186     void setStatusType(std::string statusType);
187
188     std::string getIconPath() const;
189     void setIconPath(std::string iconPath);
190
191     std::string getSubIconPath() const;
192     void setSubIconPath(std::string subIconPath);
193
194     long getNumber() const;
195     void setNumber(long number);
196
197     std::vector<NotificationDetailInfo*> getDetailInfo() const;
198     void setDetailInfo(std::vector<NotificationDetailInfo*> detailInfo);
199
200     std::string getBackgroundImagePath() const;
201     void setBackgroundImagePath(std::string backgroundImagePath);
202
203     std::vector<std::string> getThumbnails() const;
204     void setThumbnails(std::vector<std::string> thumbnails);
205
206     std::string getSoundPath() const;
207     void setSoundPath(std::string soundPath);
208
209     bool getVibration() const;
210     void setVibration(bool vibration);
211
212     ApplicationControl getAppControl() const;
213     void setAppControl(ApplicationControl appControl);
214
215     ApplicationId getAppId() const;
216     void setAppId(ApplicationId appId);
217
218     std::string getProgressType() const;
219     void setProgressType(std::string progressType);
220
221     unsigned long getProgressValue() const;
222     void setProgressValue(unsigned long progressValue);
223
224 private:
225     std::string m_statusType;
226     std::string m_iconPath;
227     std::string m_subIconPath;
228     long m_number;
229     std::vector<NotificationDetailInfo*> m_detailInfo;
230     std::string m_backgroundImagePath;
231     std::vector<std::string> m_thumbnails;
232     std::string m_soundPath;
233     bool m_vibration;
234     ApplicationControl m_appControl;
235     ApplicationId m_appId;
236     std::string m_progressType;
237     unsigned long m_progressValue;
238
239 #endif
240         
241 };
242
243 } // Notification
244 } // DeviceAPI
245
246 #endif // __TIZEN_STATUS_NOTIFICATION_H__