e761720131ccdec2347825234be541187f6ed67c
[platform/framework/web/wrt-plugins-tizen.git] / src / Notification / INotification.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
19 #ifndef TIZENAPIS_API_INOTIFICATION_H_
20 #define TIZENAPIS_API_INOTIFICATION_H_
21
22 #include <dpl/shared_ptr.h>
23 #include <string>
24 #include <time.h>
25 #include <ApplicationControl.h>
26 #include "NotificationLine.h"
27
28 namespace DeviceAPI {
29 namespace Notification {
30
31 typedef std::vector<std::string> StringArray;
32 typedef DPL::SharedPtr<StringArray> StringArrayPtr;     
33
34 typedef enum 
35 {
36         NOTI_TYPE_NONE = 0,
37         NOTI_TYPE_SIMPLE,
38         NOTI_TYPE_ONGOING,
39         NOTI_TYPE_PROGRESS,
40         NOTI_TYPE_MUTIPLE,
41         NOTI_TYPE_THUMBNAIL,
42         NOTI_TYPE_MAX
43 }NotificationType;
44
45 typedef enum 
46 {
47         NOTI_PROGRESS_TYPE_NONE = 0,
48         NOTI_PROGRESS_TYPE_SIZE,
49         NOTI_PROGRESS_TYPE_PERCENTAGE,
50         NOTI_PROGRESS_TYPE_MAX  
51 } NotificationProgressType;
52
53
54 typedef enum
55 {
56         NOTI_STATE_NONE = 0,
57         NOTI_STATE_CREATED,
58         NOTI_STATE_POSTED,
59         NOTI_STATE_DELETED 
60 }NotificationStateType; 
61
62 class INotification 
63 {
64 public:
65         virtual ~INotification();
66
67         NotificationType getNotiType()
68         {
69                 return m_notiType;
70         }
71         
72         void setNotiType(NotificationType type)
73         {
74                 m_notiType = type;
75         }
76         
77         NotificationStateType getNotificationState()
78         {
79                 return m_notiState;
80         }
81
82         void setNotificationState(NotificationStateType notiState)
83         {
84                 m_notiState = notiState;
85         }
86                 
87         NotificationProgressType getProgressType()
88         {
89                 return m_progressType;
90         }
91
92         void setProgressType( NotificationProgressType type)
93         {
94                 m_progressType = type;
95         }
96         
97         void setUpdatedFlag(bool value)
98         {
99                 if (value)
100                         LogDebug("set True");
101                 m_notiUpdated = value;
102         }
103         
104         bool getUpdatedFlag()
105         {
106                 return m_notiUpdated;
107         }
108         
109         //virtual function
110         virtual int getID() = 0;
111         virtual time_t getPostedTime() = 0;
112
113         virtual std::string getTitle() = 0;
114         virtual void setTitle(std::string title) = 0;
115         virtual std::string getContent() = 0;
116         virtual void setContent(std::string content) = 0;
117                 
118         virtual std::string getIconPath() = 0;  
119         virtual void setIconPath(const std::string& iconPath) = 0;
120
121         virtual std::string getSoundPath() = 0;
122         virtual void setSoundPath(const std::string& sound) = 0;
123         
124         virtual bool getDefaultVibration() = 0; 
125         virtual void setDefaultVibration(const bool& vibration) = 0;
126
127         virtual double getProgressValue() = 0;
128         virtual void setProgressValue(const double & progressValue) = 0;
129
130         virtual std::string getSubIconPath() = 0;
131         virtual void setSubIconPath(const std::string& subIconPath) = 0;
132         
133         virtual std::vector<std::string> getInformations() = 0;
134         virtual std::string getInformation(int index)  = 0;
135         virtual void setInformations(std::vector<std::string>& infos) = 0;
136         virtual void setInformation( const std::string& info, int index) = 0;
137         
138         virtual std::vector<std::string> getSubInformations() = 0;
139         virtual std::string getSubInformation(int index)  = 0;
140         virtual void setSubInformations(std::vector<std::string>& infos) = 0;
141         virtual void setSubInformation( const std::string& info, int index) = 0;
142
143         //virtual std::vector<std::string> getThumbnails() = 0;
144         virtual std::string getThumbnail(int index) = 0;
145         virtual void setThumbnails(std::vector<std::string>& thumbs) = 0;
146         virtual void setThumbnail( const std::string& info, int index) = 0;
147
148         virtual void setThumbnails(const StringArrayPtr &value) = 0;
149         virtual StringArrayPtr getThumbnails() = 0;
150         
151         virtual std::string getBackground() = 0;
152         virtual void setBackground(const std::string imagePath) = 0;
153         
154         virtual unsigned int getNumber() = 0;
155         virtual void setNumber(const unsigned int number) = 0;
156
157         virtual DeviceAPI::Application::ApplicationControlPtr getApplicationControl() = 0;
158         virtual void setApplicationControl(DeviceAPI::Application::ApplicationControlPtr control) = 0;
159         virtual void setApplicationId(const std::string& appId) = 0;
160         virtual std::string getApplicationId() = 0;
161
162         virtual void* getNotificationHandle() = 0;
163         virtual void setNotificationHandle(void *handle) = 0;
164
165         virtual service_h getService() = 0;
166
167         virtual NotificationLineArrayPtr getLines() const = 0;
168         virtual int getLinesNum() const = 0;
169         virtual void setLines(const NotificationLineArrayPtr &value) = 0;
170         virtual void addLine(const NotificationLinePtr &value) = 0;
171         virtual void clearLines() = 0;
172
173 private:
174         bool m_notiUpdated;
175         NotificationType m_notiType;
176         NotificationStateType m_notiState;
177         NotificationProgressType m_progressType;
178         
179 protected:
180         INotification();
181 };
182
183 typedef DPL::SharedPtr<INotification> INotificationPtr;
184
185 }
186 }
187
188 #endif