tizen 2.4 release
[framework/context/context-common.git] / include / context_mgr.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 #ifndef __CONTEXT_MANAGER_H__
18 #define __CONTEXT_MANAGER_H__
19
20 namespace ctx {
21         /* Forward Declaration */
22         class json;
23         class context_provider_iface;
24         class context_provider_info;
25
26         enum operation_type_e {
27                 OPS_SUBSCRIBE   = 1,
28                 OPS_READ                = 2,
29                 OPS_WRITE               = 4,
30         };
31
32         namespace context_manager {
33                 /*
34                  */
35                 bool register_provider(const char *subject, context_provider_info &provider_info);
36
37                 /*
38                  */
39                 bool register_trigger_item(const char *subject, int operation, ctx::json attributes, ctx::json options);
40
41                 /*
42                  */
43                 bool publish(const char *subject, ctx::json option, int error, ctx::json data_updated);
44
45                 /*
46                  */
47                 bool reply_to_read(const char *subject, ctx::json option, int error, ctx::json data_read);
48
49         }       /* namespace ctx::context_manager */
50 }       /* namespace ctx */
51
52 #endif  /* End of __CONTEXT_MANAGER_H__ */