summaryrefslogtreecommitdiff
path: root/include/notification_setting.h
blob: ca0d066b29d074b473f4312f8139607eb90b5c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/*
 * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __NOTIFICATION_SETTING_H__
#define __NOTIFICATION_SETTING_H__

#include <stdbool.h>
#include <sys/types.h>

#include "notification.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct notification_setting *notification_setting_h;

int notification_setting_get_setting(notification_setting_h *setting);

/*
 * @internal
 * @brief Gets value which whether information on the notification view is visible.
 * @since_tizen @if wearable 2.3.1 @elseif mobile 2.3 @endif
 * @param[in] setting	The notification setting handle
 * @param[out] value	The visibility_class value
 * @return #NOTIFICATION_ERROR_NONE on success,
 *         otherwise any other value on failure
 * @retval #NOTIFICATION_ERROR_NONE         Success
 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
 * @par sample code:
 * @code
#include <notification_setting_internal.h>
...
{
	int noti_err = 0;
	bool value;
	notification_setting_h setting = NULL;

	...

	noti_err = notification_setting_get_visibility_class(setting, &value);
	if (noti_err != NOTIFICATION_ERROR_NONE) {
		return;
	}

	notification_setting_free_notification(setting);

	return 0;

}
 * @endcode
 */
int notification_setting_get_visibility_class(notification_setting_h setting, int *value);

/*
 * @internal
 * @brief Sets value which whether information on the notification view is visible.
 * @details After notification_setting_update_setting() call, the visibility_class value is not updated.
 * @since_tizen @if wearable 2.3.1 @elseif mobile 2.3 @endif
 * @param[in] setting	The notification setting handle
 * @param[in] value	The visibility_class value
 * @return #NOTIFICATION_ERROR_NONE on success,
 *         otherwise any other value on failure
 * @retval #NOTIFICATION_ERROR_NONE         Success
 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
 * @par sample code:
 * @code
#include <notification_setting_internal.h>
...
{
	int noti_err = 0;
	bool value;
	notification_setting_h setting = NULL;

	...

	value = true;	// or false

	noti_err = notification_setting_set_visibility_class(setting, value);
	if (noti_err != NOTIFICATION_ERROR_NONE) {
		return;
	}

	notification_setting_free_notification(setting);

	return 0;

}
 * @endcode
 */
int notification_setting_set_visibility_class(notification_setting_h setting, int value);

/*
 * @internal
 * @brief Update the notification setting handle.
 * @since_tizen @if wearable 2.3.1 @elseif mobile 2.3 @endif
 * @privlevel public
 * @privilege %http://tizen.org/privilege/notification
 * @param[in] setting	The notification setting handle
 * @return #NOTIFICATION_ERROR_NONE on success,
 *         otherwise any other value on failure
 * @retval #NOTIFICATION_ERROR_NONE         Success
 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
 * @par sample code:
 * @code
#include <notification_setting_internal.h>
...
{
	int noti_err = 0;
	bool value;
	notification_setting_h setting = NULL;

	...

	noti_err = notification_setting_update_setting(setting);
	if (noti_err != NOTIFICATION_ERROR_NONE) {
		return;
	}

	notification_setting_free_notification(setting);

	return 0;

}
 * @endcode
 */
int notification_setting_update_setting(notification_setting_h setting);

/*
 * @internal
 * @brief Frees the internal structure data of a notification setting handle.
 * @since_tizen @if wearable 2.3.1 @elseif mobile 2.3 @endif
 * @param[in] setting	The notification setting handle
 * @return #NOTIFICATION_ERROR_NONE on success,
 *         otherwise any other value on failure
 * @retval #NOTIFICATION_ERROR_NONE         Success
 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
 * @par sample code:
 * @code
#include <notification_setting_internal.h>
...
{
	int noti_err = 0;
	notification_setting_h setting = NULL;

	...

	noti_err = notification_setting_free_notification(setting);
	if (noti_err != NOTIFICATION_ERROR_NONE) {
		return;
	}

	return 0;

}
 * @endcode
 */
int notification_setting_free_notification(notification_setting_h setting);

int notification_setting_refresh_setting_table(uid_t uid);
int notification_system_setting_init_system_setting_table(uid_t uid);

#ifdef __cplusplus
}
#endif
#endif /* __NOTIFICATION_SETTING_H__ */