Added new method to the NotificationManager Interface
[platform/framework/native/appfw.git] / src / app / inc / FApp_INotificationManagerImpl.h
1 //
2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FApp_INotificationManagerImpl.h
19  * @brief       This is the header file for the _INotificationManagerImpl class.
20  *
21  * This file contains the declarations of _INotificationManagerImpl.
22  */
23
24 #ifndef _FAPP_INTERNAL_INOTIFICATION_MANAGER_IMPL_H_
25 #define _FAPP_INTERNAL_INOTIFICATION_MANAGER_IMPL_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FAppTypes.h>
30
31
32 namespace Tizen { namespace App
33 {
34
35 class _INotificationManagerImpl
36 {
37 public:
38         virtual ~_INotificationManagerImpl(void) {}
39
40         /** 
41          * Gets the badge number of the application icon.
42          *
43          * @return      The current badge number
44          * @exception   E_SUCCESS           The method is successful.
45          * @exception   E_SYSTEM            A system error has occurred.
46          * @exception   E_OBJ_NOT_FOUND     The application is not installed.
47          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
48          *                                  The Construct() method is not called.
49          */
50         virtual int GetBadgeNumber(void) const = 0;
51
52         /**
53          * Notifies the user using a message and badge number. @n
54          * If the user checks the message, @c launchArguments is delivered to the application. @n
55          * @c launchArguments is specified as input parameter for Application::OnUserEventReceivedN() or can be obtained by
56          * invoking Application::GetAppArgumentListN(), especially within Application::OnAppInitializing().
57          *
58          * @return      An error code
59          * @param[in]   messageText         The notification message
60          * @param[in]   badgeNumber         The badge number
61          * @param[in]   launchArguments     The message for application
62          * @exception   E_SUCCESS           The method is successful.
63          * @exception   E_INVALID_ARG       Either of the following conditions has occurred: @n
64          *                                  - A specified input parameter is invalid. @n
65          *                                  - The specified @c badgeNumber is less than @c 0. @n
66          *                                  - The length of the specified @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
67          *                                  - The length of the specified @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUUNCH_ARGUMENTS_LENGTH.
68          * @exception   E_SYSTEM            A system error has occurred.
69          * @exception   E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
70          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
71          *                                      The Construct() method is not called.
72          */
73         virtual result Notify(const Tizen::Base::String& messageText, int badgeNumber, const Tizen::Base::String& launchArguments) = 0;
74
75         /**
76          * Removes the notification message.
77          *
78          * @return      An error code
79          * @exception   E_SUCCESS           The method was successful.
80          * @exception   E_SYSTEM            A system error occurred.
81          * @exception   E_INVALID_STATE     This instance is in an invalid state: @n
82          *                                  - The Construct() method is not called. @n
83          */
84         virtual result RemoveNotification(void) = 0;
85
86         /**
87          * Notifies the user about the ongoing activity using a message.
88          *
89          * @return              An error code
90          * @param[in]   messageText                     The notification message
91          * @exception   E_SUCCESS                       The method is successful.
92          * @exception   E_INVALID_ARG           The specified input parameter is invalid, or
93          *                                                                      the length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH.
94          * @exception   E_SYSTEM                        A system error has occurred.
95          * @exception   E_INVALID_OPERATION     The type of application calling this method is invalid as per the Tizen platform policy.
96          * @exception   E_INVALID_STATE         This instance is in an invalid state. @n
97          *                                  The Construct() method is not called.
98          */
99         virtual result NotifyOngoingActivity(const Tizen::Base::String& messageText) = 0;
100
101         /**
102          * Notifies the user about the ongoing activity using a message. @n
103          * @c launchArguments is specified as input parameter for Application::OnUserEventReceivedN() or can be obtained by
104          * invoking Application::GetAppArgumentListN(), especially within Application::OnAppInitializing().
105          *
106          * @return      An error code
107          * @param[in]   messageText         The notification message
108          * @param[in]  launchArguments  The launch arguments for the application
109          * @exception   E_SUCCESS           The method is successful.
110          * @exception   E_INVALID_ARG       Either of the following conditions has occurred: @n
111          *                                  - A specified input parameter is invalid. @n
112          * @exception   E_SYSTEM            A system error has occurred.
113          * @exception   E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
114          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
115          *                                  The Construct() method is not called.
116          */
117         virtual result NotifyOngoingActivity(const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments) = 0;
118
119         /**
120          * Removes the notification message for the ongoing activity.
121          *
122          * @return      An error code
123          * @exception   E_SUCCESS           The method is successful.
124          * @exception   E_SYSTEM            A system error has occurred.
125          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
126          *                                  The Construct() method is not called.
127          */
128         virtual result RemoveOngoingActivityNotification(void) = 0;
129
130         /**
131          * Gets the badge number of the application icon.
132          *
133          * @return      The current badge number
134          * @param[in]   appId               The application ID
135          * @exception   E_SUCCESS           The method is successful.
136          * @exception   E_SYSTEM            A system error has occurred.
137          * @exception   E_OBJ_NOT_FOUND     The application is not installed.
138          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
139          *                                  The Construct() method is not called.
140          */
141         virtual int GetBadgeNumber(const Tizen::App::AppId& appId) const = 0;
142
143         /**
144          * Notifies the user using a message and badge number on behalf of the specified application. @n
145          * If the user checks the message, the @c launchArguments is delivered to the application.
146          *
147          * @return             An error code
148          * @param[in]  appId             The application ID
149          * @param[in]  messageText       The notification message
150          * @param[in]    badgeNumber         The badge number
151          * @param[in]  launchArguments   The launch arguments for the application
152          * @exception  E_SUCCESS         The method is successful.
153          * @exception  E_INVALID_ARG     Either of the following conditions has occurred: @n
154          *                               - A specified input parameter is invalid. @n
155          *                               - The length of the specified @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
156          *                               - The length of the specified @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
157          * @exception  E_APP_NOT_INSTALLED   The application is not installed.
158          * @exception  E_INVALID_OPERATION   The target application with the specified application ID is not permitted to receive any notification as per the Tizen platform policy.
159          * @exception  E_SYSTEM              A system error has occurred.
160          * @exception  E_INVALID_STATE       This instance is in an invalid state. @n
161          *                                  The Construct() method is not called.
162          */
163         virtual result NotifyByAppId(const Tizen::App::AppId& appId, const Tizen::Base::String& messageText, int badgeNumber, const Tizen::Base::String& launchArguments) = 0;
164
165         /**
166          * Notifies the user about the ongoing activity using a message on behalf of the specified application.
167          *
168          * @return      An error code
169          * @param[in]   appId               The application ID
170          * @param[in]   messageText         The notification message
171          * @param[in]  launchArguments  The launch arguments for application
172          * @exception   E_SUCCESS           The method is successful.
173          * @exception   E_INVALID_ARG       Either of the following conditions has occurred: @n
174          *                                  - A specified input parameter is invalid. @n
175          *                                  - The length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
176          *                                  - The length of @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
177          * @exception   E_APP_NOT_INSTALLED The application is not installed.
178          * @exception   E_SYSTEM            A system error has occurred.
179          * @exception   E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
180          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
181          *                                  The Construct() method is not called.
182          */
183         virtual result NotifyOngoingActivityByAppId(const Tizen::App::AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments) = 0;
184
185         /**
186          * Removes the notification message for ongoing activity on behalf of the specified application.
187          *
188          * @return      An error code
189          * @param[in]   appId               The application ID
190          * @exception   E_SUCCESS           The method is successful.
191          * @exception   E_APP_NOT_INSTALLED The application is not installed.
192          * @exception   E_SYSTEM            A system error has occurred.
193          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
194          *                                  The Construct() method is not called.
195          */
196         virtual result RemoveOngoingActivityNotificationByAppId(const Tizen::App::AppId& appId) = 0;
197
198         /**
199          * Removes the notification message on behalf of the specified application.
200          *
201          * @return      An error code
202          * @param[in]   appId               The application ID
203          * @exception   E_SUCCESS           The method was successful.
204          * @exception   E_APP_NOT_INSTALLED The application is not installed.
205          * @exception   E_SYSTEM            A system error occurred.
206          * @exception   E_INVALID_STATE     This instance is in an invalid state: @n
207          *                                  - The Construct() method is not called. @n
208          */
209         virtual result RemoveNotificationByAppId(const Tizen::App::AppId& appId) = 0;
210
211 };
212
213 } } // Tizen::App
214
215 #endif // _FAPP_INTERNAL_INOTIFICATION_MANAGER_IMPL_H_