Fix sample codes for notification_set/get_led
[platform/core/api/notification.git] / include / notification_text_domain.h
1 /*
2  * Copyright (c) 2015 - 2016 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_TEXT_DOMAIN_H__
18 #define __NOTIFICATION_TEXT_DOMAIN_H__
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /**
25  * @brief Sets the text domain to localize the notification.
26  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
27  * @param[in] noti   The notification handle
28  * @param[in] domain The text domain
29  * @param[in] dir    The text dir
30  * @return #NOTIFICATION_ERROR_NONE on success,
31  *         otherwise any other value on failure
32  * @retval #NOTIFICATION_ERROR_NONE         Success
33  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
34  * @par Sample code:
35  * @code
36 #include <notification.h>
37 ...
38 {
39         notification_h noti = NULL;
40         int noti_err = NOTIFICATION_ERROR_NONE;
41
42         noti = notification_create(NOTIFICATION_TYPE_NOTI);
43         if(noti == NULL) {
44                 return;
45         }
46
47         noti_err  = notification_set_text_domain(noti, PACKAGE, LOCALEDIR);
48         if(noti_err != NOTIFICATION_ERROR_NONE) {
49                 notification_free(noti);
50                 return;
51         }
52 }
53  * @endcode
54  */
55 int notification_set_text_domain(notification_h noti,
56                                                   const char *domain,
57                                                   const char *dir);
58
59 /**
60  * @brief Gets the text domain from the notification handle.
61  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
62  * @remarks Do not free returned domain and dir. They are freed when notification_free() or notification_free_list() is called.
63  * @param[in]  noti   The notification handle
64  * @param[out] domain The domain
65  * @param[out] dir    The locale dir
66  * @return #NOTIFICATION_ERROR_NONE on success,
67  *         otherwise any other value on failure
68  * @retval #NOTIFICATION_ERROR_NONE         Success
69  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
70  * @par Sample code:
71  * @code
72 #include <notification.h>
73 ...
74 {
75         notification_h noti = NULL;
76         int noti_err = NOTIFICATION_ERROR_NONE;
77         char *domain = NULL;
78         char *dir = NULL;
79
80         noti_err  = notification_get_text_domain(noti, &domain, &dir);
81         if(noti_err != NOTIFICATION_ERROR_NONE) {
82                 return;
83         }
84 }
85  * @endcode
86  */
87 int notification_get_text_domain(notification_h noti,
88                                                   char **domain,
89                                                   char **dir);
90
91 #ifdef __cplusplus
92 }
93 #endif /* __cplusplus */
94 #endif /* __NOTIFICATION_TEXT_DOMAIN_H__ */
95