2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file core_module.cpp
18 * @author Przemyslaw Ciezkowski (p.ciezkowski@samsung.com)
19 * @authir Andrzej Surdej (a.surdej@gmail.com)
21 * @brief File contains declarations of wrt core module.
24 #ifndef CORE_MODULE_H_
25 #define CORE_MODULE_H_
27 #include <dpl/wrt-dao-ro/wrt_db_types.h>
28 #include "i_runnable_widget_object.h"
29 #include <dpl/singleton.h>
30 #include <dpl/optional_typedefs.h>
34 class CoreModuleImpl; // forward declaration
40 * Network access mode enum.
42 enum NetworkAccessMode
50 * Initialize needed by WRT components (database etc).
51 * Will not throw exception. elm_init() is NOT called in this function.
52 * You MUST call it before running widget.
53 * @return true on success, false when it fails
57 * Deinitialize CoreModule. If it called without Init() some internal
62 * Create model with given package name.
63 * Init must be called earlier. You MUST destroy all
64 * RunnableWidgetObjectPtr before calling Terminate.
66 * @return NULL on fail
68 RunnableWidgetObjectPtr getRunnableWidgetObject(
69 const std::string& tizenId);
71 * Gets from database global property of homeNetworkAccess
72 * @return homeNetworkAccess value
74 NetworkAccessMode homeNetworkAccess();
76 * Gets from database global property of roamingNetworkAccess
77 * @return roamingNetworkAccess value
79 NetworkAccessMode roamingNetworkAccess();
84 std::unique_ptr<CoreModuleImpl> m_impl;
86 friend class DPL::Singleton<CoreModule>;
89 typedef DPL::Singleton<CoreModule> CoreModuleSingleton;
91 #endif /* CORE_MODULE_H_ */