Update wrt_0.8.85
[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     DPL::Event::Property<bool,
56                   DPL::Event::PropertyReadOnly,
57                   DPL::Event::PropertyStorageDynamicCached> SecureByDefault;
58
59     DPL::Event::Property<bool,
60                   DPL::Event::PropertyReadOnly,
61                   DPL::Event::PropertyStorageDynamicCached> ComplianceMode;
62
63     DPL::Event::Property<std::string,
64                   DPL::Event::PropertyReadOnly,
65                   DPL::Event::PropertyStorageDynamicCached> ComplianceFakeImei;
66
67     DPL::Event::Property<std::string,
68                   DPL::Event::PropertyReadOnly,
69                   DPL::Event::PropertyStorageDynamicCached> ComplianceFakeMeid;
70
71     GlobalModel();
72
73   private:
74     // Custom read write delegates
75     static NetworkAccessMode HomeNetworkAccessReadProperty(DPL::Event::Model *model);
76
77     static NetworkAccessMode RoamingNetworkAccessReadProperty(DPL::Event::Model *model);
78
79     static bool ReadDeveloperMode(DPL::Event::Model *model);
80
81     static bool ReadSecureByDefault(DPL::Event::Model *model);
82
83     static bool readComplianceMode(DPL::Event::Model *model);
84
85     static std::string readComplianceFakeImei(DPL::Event::Model *model);
86
87     static std::string readComplianceFakeMeid(DPL::Event::Model *model);
88 };
89
90 #endif // WRT_COMMON_GLOBAL_MODEL_H_