Tizen 2.0 Release
[apps/core/preloaded/myfiles.git] / src / include / mf-cancel.h
1 /*
2  * Copyright 2013         Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.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://floralicense.org/license/
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
18
19
20
21 #ifndef _MF_CANCEL_DEF_H_
22 #define _MF_CANCEL_DEF_H_
23
24 #include <glib.h>
25
26 /**
27  * mf_cancel:
28  * <structname>mf_cancel</structname> is an opaque structure whose members
29  * cannot be accessed directly.
30  */
31 typedef struct _mf_cancel mf_cancel;
32
33 struct _mf_cancel {
34         gboolean is_cancel;
35         gboolean do_cancel;
36         GStaticMutex s_mutex;
37 };
38
39 /**
40  * mf_cancel_new:
41  * Creates a new #mf_cancel.
42  * Return value: This function returns a new #mf_cancel on success, or %NULL.
43  **/
44 mf_cancel *mf_cancel_new(void);
45
46 /**
47  * mf_cancel_free:
48  * @cancel : a #mf_cancel
49  * Release all allocated memory for @cancel.
50  **/
51 void mf_cancel_free(mf_cancel *cancel);
52
53 /**
54  * mf_cancel_do_cancel:
55  * @cancel : a #mf_cancel
56  * Request to cancel operation related on @cancel.
57  * This function should be called by conductor at most case
58  **/
59 void mf_cancel_do_cancel(mf_cancel *cancel);
60
61 /**
62  * mf_cancel_check_cancel:
63  * Check request of @cancel
64  * Return value: This function returns TRUE, if cancel is requested, or FALSE.
65  **/
66 gboolean mf_cancel_check_cancel(mf_cancel *cancel);
67
68 /**
69  * mf_cancel_is_cancelled:
70  * Check status of @cancel
71  * Return value: This function returns TRUE, if cancel is done, or FALSE.
72  **/
73 gboolean mf_cancel_is_cancelled(mf_cancel *cancel);
74
75
76 /**
77  * mf_cancel_set_cancelled:
78  * set status of @cancel after cancel is done
79  * This function should be called by operator
80  **/
81 void mf_cancel_set_cancelled(mf_cancel *cancel);
82
83 #endif