[Release] wrt_0.8.274
[platform/framework/web/wrt.git] / src / wrt-client / widget_state.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 declaration of WidgetState enum.
21  */
22
23 #ifndef WIDGET_STATE_H
24 #define WIDGET_STATE_H
25
26 /**
27  * @brief State of widget
28  *
29  * This enumerator describes a state that widget is in.
30  * Notice, that not all combinations of state changes are correct.
31  * In current architecture, only following state changes are corrent and can
32  * occur:
33  *
34  * oldState: WidgetState_Stopped     -> newState: WidgetState_Authorizing
35  * oldState: WidgetState_Authorizing -> newState: WidgetState_Running
36  * oldState: WidgetState_Authorizing -> newState: WidgetState_Stopped
37  * oldState: WidgetState_Running     -> newState: WidgetState_Stopped
38  * oldState: WidgetState_Running     -> newState: WidgetState_Suspended
39  * oldState: WidgetState_Suspended   -> newState: WidgetState_Running
40  * oldState: WidgetState_Stopped     -> newState: WidgetState_Uninstalling
41  *
42  * WidgetState_Stopped      - Widget is in stopped state. No view is currently
43  *                            attached to WidgetModel.
44  * WidgetState_Authorizing  - Widget is in authorizing state. No view is
45  *                            currently attached to WidgetModel.
46  * WidgetState_Running      - Widget is in running state. There is a view
47  *                            attached to WidgetModel.
48  * WidgetState_Suspended    - Widget is in running state but its java script has
49  *                            been suspended. There is a view attached to
50  *                            WidgetModel.
51  * WidgetState_Uninstalling - Widget is currently being uninstalled.
52  * WidgetState_Running_Nested_Loop - Widget has created nested loop. We cannot
53  *                            close widget in this state. We must wait until
54  *                            widget will be in WidgetState_Running
55  */
56 enum WidgetState
57 {
58     WidgetState_Stopped,
59     WidgetState_Authorizing,
60     WidgetState_Running,
61     WidgetState_Suspended,
62     WidgetState_Uninstalling,
63     WidgetState_Running_Nested_Loop
64 };
65
66 #endif /* WIDGET_STATE_H */
67