e7238a4e744c5f747284a08cde4d15b781f945e0
[platform/core/api/notification.git] / include / notification_ongoing_flag.h
1 /*
2  * Copyright (c) 2015 - 2017 Samsung Electronics Co., Ltd. All rights reserved.
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 #ifndef __NOTIFICATION_ONGOING_FLAG_H__
18 #define __NOTIFICATION_ONGOING_FLAG_H__
19
20 #include <notification.h>
21
22 /**
23  * @brief Sets the ongoing flag of the notification
24  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
25  * @param[in] noti  The notification handle
26  * @param[in] ongoing_flag The ongoing flag
27  * @return #NOTIFICATION_ERROR_NONE on success,
28  *         otherwise any other value on failure
29  * @retval #NOTIFICATION_ERROR_NONE         Success
30  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
31  * @par Sample code:
32  * @code
33 #include <notification.h>
34 ...
35 {
36         notification_h noti = NULL;
37         int noti_err = NOTIFICATION_ERROR_NONE;
38         bundle *b = NULL;
39
40         noti = notification_create(NOTIFICATION_TYPE_NOTI);
41         if (noti == NULL) {
42                 return;
43         }
44
45         noti_err  = notification_set_ongoing_flag(noti, true);
46         if (noti_err != NOTIFICATION_ERROR_NONE) {
47                 notification_free(noti);
48                 return;
49         }
50 }
51  * @endcode
52  */
53 int notification_set_ongoing_flag(notification_h noti, bool ongoing_flag);
54
55 /**
56  * @brief Gets the ongoing flag of the notification
57  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
58  * @param[in]  noti  The notification handle
59  * @param[out] ongoing_flag The ongoing flag
60  * @return #NOTIFICATION_ERROR_NONE on success,
61  *         otherwise any other value on failure
62  * @retval #NOTIFICATION_ERROR_NONE         Success
63  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
64  * @par Sample code:
65  * @code
66 #include <notification.h>
67 ...
68 {
69         notification_h noti = NULL;
70         int noti_err = NOTIFICATION_ERROR_NONE;
71         bool ongoing_flag = 0;
72
73         noti_err  = notification_get_ongoing_flag(noti, &ongoing_flag);
74         if (noti_err != NOTIFICATION_ERROR_NONE) {
75                 return;
76         }
77 }
78  * @endcode
79  */
80 int notification_get_ongoing_flag(notification_h noti, bool *ongoing_flag);
81
82 #endif /* __NOTIFICATION_ONGOING_H__ */
83