065ca3b8693b4b546a47244744376225aa49f9f1
[platform/framework/web/wrt.git] / src / global_logic / global_model.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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  * @file        global_model.h
18  * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
19  */
20 #ifndef WRT_COMMON_GLOBAL_MODEL_H_
21 #define WRT_COMMON_GLOBAL_MODEL_H_
22
23 #include <string>
24 #include <dpl/event/model.h>
25 #include <dpl/event/property.h>
26 #include <dpl/type_list.h>
27 #include <dpl/shared_ptr.h>
28
29 class GlobalModel : public DPL::Event::Model
30 {
31   public:
32
33     /**
34      * Network access mode enum.
35      */
36     enum NetworkAccessMode
37     {
38         NEVER_CONNECT,
39         ALWAYS_ASK,
40         CONNECT_AUTOMATICALLY
41     };
42
43     DPL::Event::Property<NetworkAccessMode,
44                   DPL::Event::PropertyReadOnly,
45                   DPL::Event::PropertyStorageDynamicCached> HomeNetworkAccess;
46
47     DPL::Event::Property<NetworkAccessMode,
48                   DPL::Event::PropertyReadOnly,
49                   DPL::Event::PropertyStorageDynamicCached> RoamingNetworkAccess;
50
51     DPL::Event::Property<bool,
52                   DPL::Event::PropertyReadOnly,
53                   DPL::Event::PropertyStorageDynamicCached> DeveloperMode;
54
55     GlobalModel();
56
57   private:
58     // Custom read write delegates
59     static NetworkAccessMode HomeNetworkAccessReadProperty(DPL::Event::Model *model);
60
61     static NetworkAccessMode RoamingNetworkAccessReadProperty(DPL::Event::Model *model);
62
63     static bool ReadDeveloperMode(DPL::Event::Model *model);
64 };
65
66 #endif // WRT_COMMON_GLOBAL_MODEL_H_