Update privilege string, PackageAppInfo for wgt
[platform/framework/native/appfw.git] / src / app / FAppNotificationMessage.cpp
1 //
2 // Open Service Platform
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  * @file                FAppNotificationMessage.cpp
20  * @brief               This is the placeholder for NotificationMessage class.
21  */
22
23 #include <new>
24
25 #include <FAppNotificationMessage.h>
26
27 #include <FBaseSysLog.h>
28 #include "FApp_NotificationMessageImpl.h"
29
30 using namespace Tizen::Base;
31 using namespace Tizen::Security;
32
33
34 namespace Tizen { namespace App
35 {
36
37 NotificationMessage::NotificationMessage(bool appBinding)
38         : __pNotificationMessageImpl(null)
39 {
40         __pNotificationMessageImpl = new (std::nothrow) _NotificationMessageImpl(appBinding);
41         SysTryReturnVoidResult(NID_APP, __pNotificationMessageImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
42 }
43
44 NotificationMessage::~NotificationMessage()
45 {
46         delete __pNotificationMessageImpl;
47 }
48
49 NotificationMessage::NotificationMessage(const NotificationMessage& rhs)
50 {
51         __pNotificationMessageImpl = new (std::nothrow) _NotificationMessageImpl(*rhs.__pNotificationMessageImpl);
52         SysTryReturnVoidResult(NID_APP, __pNotificationMessageImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
53 }
54
55 NotificationMessage&
56 NotificationMessage::operator =(const NotificationMessage& rhs)
57 {
58         if (&rhs != this)
59         {
60                 delete __pNotificationMessageImpl;
61
62                 __pNotificationMessageImpl = new (std::nothrow) _NotificationMessageImpl(*rhs.__pNotificationMessageImpl);
63                 SysTryReturn(NID_APP, __pNotificationMessageImpl, *this, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory");
64         }
65
66         return(*this);
67 }
68
69 bool
70 NotificationMessage::Equals(const Object& rhs) const
71 {
72         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
73         return __pNotificationMessageImpl->Equals(rhs);
74 }
75
76 int
77 NotificationMessage::GetHashCode(void) const
78 {
79         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
80         return __pNotificationMessageImpl->GetHashCode();
81 }
82
83 int
84 NotificationMessage::GetBadgeNumber(void) const
85 {
86         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
87
88         return __pNotificationMessageImpl->GetBadgeNumber();
89 }
90
91 result
92 NotificationMessage::SetBadgeNumber(int badgeNumber)
93 {
94         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
95
96         return __pNotificationMessageImpl->SetBadgeNumber(badgeNumber);
97 }
98
99 int
100 NotificationMessage::GetBadgeOffset() const
101 {
102         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
103
104         return __pNotificationMessageImpl->GetBadgeOffset();
105 }
106
107 result
108 NotificationMessage::SetBadgeOffset(int badgeOffset)
109 {
110         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
111
112         return __pNotificationMessageImpl->SetBadgeOffset(badgeOffset);
113 }
114
115 String
116 NotificationMessage::GetAlertText() const
117 {
118         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
119
120         return __pNotificationMessageImpl->GetAlertText();
121 }
122
123 result
124 NotificationMessage::SetAlertText(const String& alertText)
125 {
126         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
127
128         return __pNotificationMessageImpl->SetAlertText(alertText);
129 }
130
131 String
132 NotificationMessage::GetAppMessage() const
133 {
134         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
135
136         return __pNotificationMessageImpl->GetAppMessage();
137 }
138
139
140 result
141 NotificationMessage::SetAppMessage(const String& appMessage)
142 {
143         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
144
145         return __pNotificationMessageImpl->SetAppMessage(appMessage);
146 }
147
148 String
149 NotificationMessage::GetTitleText() const
150 {
151         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
152
153         return __pNotificationMessageImpl->GetTitleText();
154 }
155
156 result
157 NotificationMessage::SetTitleText(const String& titleText)
158 {
159         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
160
161         return __pNotificationMessageImpl->SetTitleText(titleText);
162 }
163
164 String
165 NotificationMessage::GetIconFilePath() const
166 {
167         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
168
169         return __pNotificationMessageImpl->GetIconFilePath();
170 }
171
172 result
173 NotificationMessage::SetIconFilePath(const String& iconFilePath)
174 {
175         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
176
177         return __pNotificationMessageImpl->SetIconFilePath(iconFilePath);
178 }
179
180 String
181 NotificationMessage::GetSoundFilePath() const
182 {
183         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
184
185         return __pNotificationMessageImpl->GetSoundFilePath();
186 }
187
188 result
189 NotificationMessage::SetSoundFilePath(const String& soundFilePath)
190 {
191         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
192
193         return __pNotificationMessageImpl->SetSoundFilePath(soundFilePath);
194 }
195
196 OngoingActivityType
197 NotificationMessage::GetOngoingActivityType() const
198 {
199         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
200
201         return __pNotificationMessageImpl->GetOngoingActivityType();
202 }
203
204 result
205 NotificationMessage::SetOngoingActivityType(OngoingActivityType activityType)
206 {
207         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
208
209         return __pNotificationMessageImpl->SetOngoingActivityType(activityType);
210 }
211
212 int
213 NotificationMessage::GetOngoingActivityProgressValue() const
214 {
215         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
216
217         return __pNotificationMessageImpl->GetOngoingActivityProgressValue();
218 }
219
220 result
221 NotificationMessage::SetOngoingActivityProgressValue(int progressValue)
222 {
223         SysAssertf(__pNotificationMessageImpl != null, "Instance is not constructed properly.");
224
225         return __pNotificationMessageImpl->SetOngoingActivityProgressValue(progressValue);
226 }
227
228 };
229 };    // Tizen::App