summaryrefslogtreecommitdiff
path: root/lib/include/media-util-noti.h
blob: 3ebb97b2d7eef4a12d881bfc829bc431e6c24ed5 (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
/*
 *  Media Utility
 *
 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
 *
 * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
 *
 * 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.
 *
 */

/**
 * This file defines api utilities of contents manager engines.
 *
 * @file		media-util-noti.h
 * @author	Yong Yeon Kim(yy9875.kim@samsung.com)
 * @version	1.0
 * @brief
 */
 #ifndef _MEDIA_UTIL_NOTI_H_
#define _MEDIA_UTIL_NOTI_H_

#ifdef __cplusplus
extern "C" {
#endif

/**
* @fn 		int ms_noti_db_update_complete(void);
* @brief 		This function announce media database is updated to other applications.<br>
* @return	This function returns 0 on success, and -1 on failure.
* @param[in]	none
* @remark  	This function is recommandation for other application being aware of database updating.<br>
* @par example
* @code

#include <stdio.h>
#include <string.h>
#include <media-service-noti.h>

	int main()
	{
		int result;

		....
		file operation (copy/move/delete)
		....

		result = ms_noti_db_update_complete();
		if( result < 0 )
		{
			printf("FAIL to ms_noti_db_update_complete\n");
			return 0;
		}
		else
		{
			printf("SUCCESS to ms_noti_db_update_complete\n");
		}

		return 0;
	}

* @endcode
*/

int ms_noti_update_complete(void);

/**
* @fn 		int ms_noti_db_update_complete(void);
* @brief 		This function announce media database is updated to other applications.<br>
* @return	This function returns 0 on success, and -1 on failure.
* @param[in]	none
* @remark  	This function is recommandation for other application being aware of database updating.<br>
* @par example
* @code

#include <stdio.h>
#include <glib.h>
#include <media-util-noti.h>

void callback()
{
        printf("listen dbus from media-server\n");
}

int
main (int argc, char **argv)
{
	GMainLoop *loop;

	loop = g_main_loop_new (NULL, FALSE);

	media_db_update_subscribe(callback);

	g_main_loop_run (loop);

	return 0;
}

*/

typedef void (*db_update_cb)(void);

int media_db_update_subscribe(db_update_cb user_cb);


/**
* @}
*/

#ifdef __cplusplus
}
#endif

#endif /*_MEDIA_UTIL_NOTI_H_*/