Update wrt_0.8.85
[platform/framework/web/wrt.git] / src / api_new / core_module.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    core_module.cpp
18  * @author  Przemyslaw Ciezkowski (p.ciezkowski@samsung.com)
19  * @version 1.0
20  * @brief   File contains declarations of wrt core module.
21  */
22
23 #ifndef CORE_MODULE_H_
24 #define CORE_MODULE_H_
25
26 #include <dpl/wrt-dao-ro/wrt_db_types.h>
27 #include "i_runnable_widget_object.h"
28
29 namespace WRT {
30
31 namespace CoreModule {
32     /**
33      * Initialize needed by WRT components (database etc).
34      * Will not throw exception. elm_init() is NOT called in this function.
35      * You MUST call it before running widget.
36      * @return true on success, false when it fails
37      */
38     bool Init();
39     /**
40      * Deinitialize CoreModule. If it called without Init() some internal
41      * asserts will fail.
42      */
43     void Terminate();
44     /**
45      * Create model with given widget handle.
46      * Init must be called earlier. You MUST destroy all
47      * RunnableWidgetObjectPtr before calling Terminate.
48      * @param handle
49      * @return NULL on fail
50      */
51     RunnableWidgetObjectPtr getRunnableWidgetObject(
52             const WidgetHandle& handle);
53     /**
54      * Create model with given package name.
55      * Init must be called earlier.
56      * @param packageName
57      * @return NULL on fail
58      */
59     RunnableWidgetObjectPtr getRunnableWidgetObject(
60             const std::string& packageName);
61 } //namespace CoreModule
62
63 } /* namespace WRT */
64 #endif /* CORE_MODULE_H_ */