tizen 2.3.1 release
[framework/telephony/libtcore.git] / include / co_ps.h
1 /*
2  * libtcore
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef __TCORE_CO_PS_H__
22 #define __TCORE_CO_PS_H__
23
24 #include <core_object.h>
25 #include <co_context.h>
26
27 __BEGIN_DECLS
28
29
30 #define PS_MAX_CID  4
31
32 struct tcore_ps_operations {
33         TReturn (*define_context)(CoreObject *co_ps, CoreObject *context, void *user_data);
34         TReturn (*activate_context)(CoreObject *co_ps, CoreObject *context, void *user_data);
35         TReturn (*deactivate_context)(CoreObject *co_ps, CoreObject *context, void *user_data);
36 };
37
38 CoreObject*  tcore_ps_new(TcorePlugin *p, const char *name, struct tcore_ps_operations *ops, TcoreHal *hal);
39 void         tcore_ps_free(CoreObject *o);
40
41 void tcore_ps_set_ops(CoreObject *o, struct tcore_ps_operations *ops);
42
43 TReturn      tcore_ps_add_context(CoreObject *o, CoreObject *ctx_o);
44 TReturn      tcore_ps_remove_context(CoreObject *o, CoreObject *ctx_o);
45 CoreObject*  tcore_ps_ref_context_by_role(CoreObject *o, enum co_context_role role);
46 GSList*      tcore_ps_ref_context_by_id(CoreObject *o, unsigned int id);
47 gboolean tcore_ps_any_context_activating_activated(CoreObject *o, int * state);
48
49 TReturn      tcore_ps_set_online(CoreObject *o, gboolean state);
50 TReturn      tcore_ps_set_num_of_pdn(CoreObject *o, gint numbers);
51 unsigned int tcore_ps_get_num_of_pdn(CoreObject *o);
52 unsigned int tcore_ps_set_cid_active(CoreObject *o, unsigned int cid, unsigned int enable);
53 unsigned int tcore_ps_get_cid_active(CoreObject *o, unsigned int cid);
54 GSList*      tcore_ps_get_active_cids(CoreObject *o);
55 unsigned int tcore_ps_set_cid_connected(CoreObject *o, unsigned int cid, unsigned int connected);
56 unsigned int tcore_ps_get_cid_connected(CoreObject *o, unsigned int cid);
57 GSList*      tcore_ps_get_connected_cids(CoreObject *o);
58 unsigned int tcore_ps_is_active_apn(CoreObject *o, const char* apn);
59 TReturn      tcore_ps_assign_context_id(CoreObject *o, CoreObject *context, unsigned char cid);
60 TReturn      tcore_ps_clear_context_id(CoreObject *o, CoreObject *context);
61
62 TReturn      tcore_ps_define_context(CoreObject *o, CoreObject *context, void *user_data);
63 TReturn      tcore_ps_activate_context(CoreObject *o, CoreObject *context, void *user_data);
64 TReturn      tcore_ps_deactivate_context(CoreObject *o, CoreObject *context, void *user_data);
65 TReturn      tcore_ps_deactivate_contexts(CoreObject *o);
66 TReturn      tcore_ps_deactivate_cid(CoreObject *o, unsigned int cid);
67
68 __END_DECLS
69
70 #endif