Update change log and spec for wrt-plugins-tizen_0.4.29
[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 #if 0   
46         NotificationProgressType getProgressType()
47         {
48                 return m_progressType;
49         }
50         void setProgressType( NotificationProgressType type)
51         {
52                 m_progressType = type;
53         }
54 #endif
55
56         std::string getEnumProgressType();
57         
58
59         void setUpdatedFlag(bool value)
60         {
61              if (value)
62                 LoggerD("set True");
63              m_notiUpdated = value;
64         }
65         
66         bool getUpdatedFlag()
67         {
68              return m_notiUpdated;
69         }
70
71         bool getLaunchFlag()
72         {
73             return m_launchFlag;
74         }
75
76         void setLaunchFlag(bool value)
77         {
78             m_launchFlag = value;
79         }
80
81         NotificationType getNotiType()
82         {
83                 return m_notiType;
84         }
85
86         void setNotiType(NotificationType type)
87         {
88                 m_notiType = type;
89         }
90         
91         int getID();
92         std::string getStatusType();
93         void setStatusType(std::string type);
94         
95         time_t getPostedTime();
96         std::string getTitle();
97         void setTitle(std::string title);
98         
99         std::string getContent();
100         char* getStrContent();
101         void setContent(std::string content);
102                 
103         std::string getIconPath() ;     
104         void setIconPath(const std::string& iconPath) ;
105
106         std::string getSoundPath() ;
107         void setSoundPath(const std::string& sound) ;
108         
109         bool getDefaultVibration() ;    
110         void setDefaultVibration(const bool& vibration) ;
111
112         NotificationProgressType getProgressType();
113         void setProgressType(NotificationProgressType type);
114
115         double getProgressValue() ;
116         void setProgressValue(const double & progressValue);
117         
118         std::string getSubIconPath() ;
119         void setSubIconPath(const std::string& subIconPath) ;
120
121 #if 0   
122         std::vector<std::string> getInformations() ;
123         std::string getInformation(int index)  ;
124         void setInformations(std::vector<std::string>& infos) ;
125         void setInformation( const std::string& info, int index) ;
126         
127         std::vector<std::string> getSubInformations() ;
128         std::string getSubInformation(int index)  ;
129         void setSubInformations(std::vector<std::string>& infos) ;
130         void setSubInformation( const std::string& info, int index) ;
131 #endif
132
133         std::vector<std::string> getThumbnails();
134         void setThumbnails(std::vector<std::string> thumbs);
135         
136         std::string getBackground() ;
137         void setBackground(const std::string imagePath) ;
138         
139         long getNumber() ;
140         const char* getStrNumber() ;
141         void setNumber(const long number) ;
142         
143         //void setStatusType(NotificationType type);
144         DeviceAPI::Application::ApplicationControlPtr getApplicationControl();
145         void setApplicationControl(DeviceAPI::Application::ApplicationControlPtr control);
146         void setApplicationId(const std::string& appId);
147         std::string getApplicationId();
148
149         void* getNotificationHandle();
150         void setNotificationHandle(void *handle);
151
152         service_h getService();
153
154         //Detail Info
155         std::vector<NotificationDetailInfo*> getDetailInfos() const;
156         void setDetailInfos(const std::vector<NotificationDetailInfo*> value);
157         int getDetailInfosNum() const;
158         void addDetailInfo(NotificationDetailInfo* value);
159         void clearDetailInfos();
160
161 private:
162                 
163         void loadThumbnails();
164         void setThumbnail( const std::string& info, int index);
165         std::string getThumbnail(int index);
166
167         std::string getInformation(int index)  ;
168         void setInformation( const std::string& info, int index) ;
169
170         std::string getSubInformation(int index)  ;
171         void setSubInformation( const std::string& info, int index) ;   
172         
173         void loadDetailInfos();
174                 
175 protected:
176
177         NotificationType m_notiType;
178         service_h m_service;
179         notification_h m_notiHandle;
180         NotificationProgressType m_progressType;
181         bool m_notiUpdated;
182         bool m_launchFlag;
183         
184         std::vector<std::string> m_thumbs;                              //thumbnail images path
185         std::vector<NotificationDetailInfo*> m_detailInfos;   // detail Info
186         
187 };
188
189 } // Notification
190 } // DeviceAPI
191
192 #endif // __TIZEN_STATUS_NOTIFICATION_H__