Fixed the uts-app failed testcases
[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. @n
88          * @c launchArguments is specified as input parameter for Application::OnUserEventReceivedN() or can be obtained by
89          * invoking Application::GetAppArgumentListN(), especially within Application::OnAppInitializing().
90          *
91          * @return      An error code
92          * @param[in]   messageText         The notification message
93          * @param[in]  launchArguments  The launch arguments for the application
94          * @exception   E_SUCCESS           The method is successful.
95          * @exception   E_INVALID_ARG       Either of the following conditions has occurred: @n
96          *                                  - A specified input parameter is invalid. @n
97          * @exception   E_SYSTEM            A system error has occurred.
98          * @exception   E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
99          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
100          *                                  The Construct() method is not called.
101          */
102         virtual result NotifyOngoingActivity(const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments) = 0;
103
104         /**
105          * Removes the notification message for the ongoing activity.
106          *
107          * @return      An error code
108          * @exception   E_SUCCESS           The method is successful.
109          * @exception   E_SYSTEM            A system error has occurred.
110          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
111          *                                  The Construct() method is not called.
112          */
113         virtual result RemoveOngoingActivityNotification(void) = 0;
114
115         /**
116          * Gets the badge number of the application icon.
117          *
118          * @return      The current badge number
119          * @param[in]   appId               The application ID
120          * @exception   E_SUCCESS           The method is successful.
121          * @exception   E_SYSTEM            A system error has occurred.
122          * @exception   E_OBJ_NOT_FOUND     The application is not installed.
123          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
124          *                                  The Construct() method is not called.
125          */
126         virtual int GetBadgeNumber(const Tizen::App::AppId& appId) const = 0;
127
128         /**
129          * Notifies the user using a message and badge number on behalf of the specified application. @n
130          * If the user checks the message, the @c launchArguments is delivered to the application.
131          *
132          * @return             An error code
133          * @param[in]  appId             The application ID
134          * @param[in]  messageText       The notification message
135          * @param[in]    badgeNumber         The badge number
136          * @param[in]  launchArguments   The launch arguments for the application
137          * @exception  E_SUCCESS         The method is successful.
138          * @exception  E_INVALID_ARG     Either of the following conditions has occurred: @n
139          *                               - A specified input parameter is invalid. @n
140          *                               - The length of the specified @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
141          *                               - The length of the specified @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
142          * @exception  E_APP_NOT_INSTALLED   The application is not installed.
143          * @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.
144          * @exception  E_SYSTEM              A system error has occurred.
145          * @exception  E_INVALID_STATE       This instance is in an invalid state. @n
146          *                                  The Construct() method is not called.
147          */
148         virtual result NotifyByAppId(const Tizen::App::AppId& appId, const Tizen::Base::String& messageText, int badgeNumber, const Tizen::Base::String& launchArguments) = 0;
149
150         /**
151          * Notifies the user about the ongoing activity using a message on behalf of the specified application.
152          *
153          * @return      An error code
154          * @param[in]   appId               The application ID
155          * @param[in]   messageText         The notification message
156          * @param[in]  launchArguments  The launch arguments for application
157          * @exception   E_SUCCESS           The method is successful.
158          * @exception   E_INVALID_ARG       Either of the following conditions has occurred: @n
159          *                                  - A specified input parameter is invalid. @n
160          *                                  - The length of @c messageText is greater than Shell::MAX_NOTIFICATION_MESSAGE_LENGTH. @n
161          *                                  - The length of @c launchArguments is greater than Shell::MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.
162          * @exception   E_APP_NOT_INSTALLED The application is not installed.
163          * @exception   E_SYSTEM            A system error has occurred.
164          * @exception   E_INVALID_OPERATION The type of application calling this method is invalid as per the Tizen platform policy.
165          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
166          *                                  The Construct() method is not called.
167          */
168         virtual result NotifyOngoingActivityByAppId(const Tizen::App::AppId& appId, const Tizen::Base::String& messageText, const Tizen::Base::String& launchArguments) = 0;
169
170         /**
171          * Removes the notification message for ongoing activity on behalf of the specified application.
172          *
173          * @return      An error code
174          * @param[in]   appId               The application ID
175          * @exception   E_SUCCESS           The method is successful.
176          * @exception   E_APP_NOT_INSTALLED The application is not installed.
177          * @exception   E_SYSTEM            A system error has occurred.
178          * @exception   E_INVALID_STATE     This instance is in an invalid state. @n
179          *                                  The Construct() method is not called.
180          */
181         virtual result RemoveOngoingActivityNotificationByAppId(const Tizen::App::AppId& appId) = 0;
182
183         /**
184          * Removes the notification message on behalf of the specified application.
185          *
186          * @return      An error code
187          * @param[in]   appId               The application ID
188          * @exception   E_SUCCESS           The method was successful.
189          * @exception   E_APP_NOT_INSTALLED The application is not installed.
190          * @exception   E_SYSTEM            A system error occurred.
191          * @exception   E_INVALID_STATE     This instance is in an invalid state: @n
192          *                                  - The Construct() method is not called. @n
193          */
194         virtual result RemoveNotificationByAppId(const Tizen::App::AppId& appId) = 0;
195
196 };
197
198 } } // Tizen::App
199
200 #endif // _FAPP_INTERNAL_INOTIFICATION_MANAGER_IMPL_H_