Tizen 2.1 base
[platform/core/system/sync-agent.git] / include / utility / fw_mainloop.h
1 /*
2  * sync-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef FW_MAINLOOP_H_
19 #define FW_MAINLOOP_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif                          /* __cplusplus */
24
25 /**
26  * @file fw_mainloop.h
27  * @brief Provides main-loop manipulation functionality
28  */
29
30 /** @addtogroup utility
31  *      @{
32  */
33
34 /**
35  * API to create and run the main loop
36  *
37  * @par Usage:
38  * @code
39                 int use_thread = 0;
40                 ...
41                 sync_agent_run_main_loop(use_thread);
42  *
43  * @endcode
44  *
45  * @param[in] use_thread 1 creating thread to run the main loop, otherwise (run the main loop on same thread) 0
46  *
47  * @par Since:
48  *
49  *
50  * @see sync_agent_run_main_loop(int)
51  *
52  */
53         void sync_agent_run_main_loop(int use_thread);
54
55 /**
56  * API to stop the main loop which is running currently
57  *
58  * @par Usage:
59  * @code
60                  int use_thread = 0;
61                  ...
62                  sync_agent_run_main_loop(use_thread);
63                  ...
64                  sync_agent_stop_main_loop(use_thread);
65  *
66  * @endcode
67  *
68  * @param[in] use_thread same parameter value used at sync_agent_run_main_loop()
69  *
70  * @par Since:
71  *
72  *
73  * @see sync_agent_stop_main_loop(int)
74  *
75  */
76         void sync_agent_stop_main_loop(int use_thread);
77
78 /**
79  * API to get the main loop object
80  *
81  * @par Usage:
82  * @code
83                 GMainLoop *loop = NULL;
84                 ...
85                 loop = (GMainLoop *)sync_agent_get_main_loop();
86  *
87  * @endcode
88  *
89  * @return main loop object which is running currently on success, NULL on error
90  *
91  * @par Since:
92  *
93  *
94  * @see sync_agent_get_main_loop()
95  *
96  */
97         void *sync_agent_get_main_loop();
98
99 /**
100  *      @}
101  */
102
103 #ifdef __cplusplus
104 }
105 #endif                          /* __cplusplus */
106 #endif                          /* FW_MAINLOOP_H_ */