cef8163055a8600fcaf885023a14188272183772
[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                 m_notiUpdated = value;
100         }
101         
102         bool getUpdatedFlag()
103         {
104                 return m_notiUpdated;
105         }
106         
107         //virtual function
108         virtual int getID() = 0;
109         virtual time_t getPostedTime() = 0;
110
111         virtual std::string getTitle() = 0;
112         virtual void setTitle(std::string title) = 0;
113         virtual std::string getContent() = 0;
114         virtual void setContent(std::string content) = 0;
115                 
116         virtual std::string getIconPath() = 0;  
117         virtual void setIconPath(const std::string& iconPath) = 0;
118
119         virtual std::string getSoundPath() = 0;
120         virtual void setSoundPath(const std::string& sound) = 0;
121         
122         virtual bool getDefaultVibration() = 0; 
123         virtual void setDefaultVibration(const bool& vibration) = 0;
124
125         virtual double getProgressValue() = 0;
126         virtual void setProgressValue(const double & progressValue) = 0;
127
128         virtual std::string getSubIconPath() = 0;
129         virtual void setSubIconPath(const std::string& subIconPath) = 0;
130         
131         virtual std::vector<std::string> getInformations() = 0;
132         virtual std::string getInformation(int index)  = 0;
133         virtual void setInformations(std::vector<std::string>& infos) = 0;
134         virtual void setInformation( const std::string& info, int index) = 0;
135         
136         virtual std::vector<std::string> getSubInformations() = 0;
137         virtual std::string getSubInformation(int index)  = 0;
138         virtual void setSubInformations(std::vector<std::string>& infos) = 0;
139         virtual void setSubInformation( const std::string& info, int index) = 0;
140
141         //virtual std::vector<std::string> getThumbnails() = 0;
142         virtual std::string getThumbnail(int index) = 0;
143         virtual void setThumbnails(std::vector<std::string>& thumbs) = 0;
144         virtual void setThumbnail( const std::string& info, int index) = 0;
145
146         virtual void setThumbnails(const StringArrayPtr &value) = 0;
147         virtual StringArrayPtr getThumbnails() = 0;
148         
149         virtual std::string getBackground() = 0;
150         virtual void setBackground(const std::string imagePath) = 0;
151         
152         virtual unsigned int getNumber() = 0;
153         virtual void setNumber(const unsigned int number) = 0;
154
155         virtual DeviceAPI::Application::ApplicationControlPtr getApplicationControl() = 0;
156         virtual void setApplicationControl(DeviceAPI::Application::ApplicationControlPtr control) = 0;
157         virtual void setApplicationId(const std::string& appId) = 0;
158         virtual std::string getApplicationId() = 0;
159
160         virtual void* getNotificationHandle() = 0;
161         virtual void setNotificationHandle(void *handle) = 0;
162
163         virtual service_h getService() = 0;
164
165         virtual NotificationLineArrayPtr getLines() const = 0;
166         virtual int getLinesNum() const = 0;
167         virtual void setLines(const NotificationLineArrayPtr &value) = 0;
168         virtual void addLine(const NotificationLinePtr &value) = 0;
169         virtual void clearLines() = 0;
170
171 private:
172         bool m_notiUpdated;
173         NotificationType m_notiType;
174         NotificationStateType m_notiState;
175         NotificationProgressType m_progressType;
176         
177 protected:
178         INotification();
179 };
180
181 typedef DPL::SharedPtr<INotification> INotificationPtr;
182
183 }
184 }
185
186 #endif