Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / scenes / FUiScenes_SceneImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        FUiScenes_SceneImpl.h
19  * @brief       This is the header file of the _SceneImpl class.
20  *
21  * This header file contains the declarations of the _SceneImpl class.
22  */
23
24 #ifndef _FUI_SCENES_INTERNAL_SCENE_IMPL_H_
25 #define _FUI_SCENES_INTERNAL_SCENE_IMPL_H_
26
27 #include <FBaseTypes.h>
28 #include <FBaseString.h>
29 #include <FBaseColIList.h>
30 #include <FBaseColLinkedListT.h>
31 #include <FUiScenesScene.h>
32
33
34 namespace Tizen { namespace Ui { namespace Scenes
35 {
36
37 class ISceneAnimationProvider;
38
39 class _SceneImpl
40         : public Tizen::Base::Object
41 {
42 public:
43         _SceneImpl(void);
44         virtual ~_SceneImpl(void);
45         virtual bool Equals(const Object& rhs) const;
46         virtual int GetHashCode(void) const;
47
48         SceneId GetSceneId(void) const;
49         Tizen::Base::String GetFormId(void) const;
50         Tizen::Base::String GetPanelId(void) const;
51         Tizen::Ui::Controls::Form* GetForm(void) const;
52         void SetForm(Tizen::Ui::Controls::Form* pForm);
53         Tizen::Ui::Controls::Panel* GetPanel(void) const;
54         void SetPanel(Tizen::Ui::Controls::Panel* pPanel);
55         Tizen::Base::Collection::IList* GetArgs(void);
56         void SetArgs(Tizen::Base::Collection::IList* pArgs = null);
57
58         result AddSceneEventListener(const ISceneEventListener& sceneEventlistener);
59         result RemoveSceneEventListener(const ISceneEventListener& sceneEventlistener);
60         result SetSceneAnimationProvider(ISceneAnimationProvider* pSceneAnimationProvider);
61
62         bool OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId,
63                                                    Tizen::Base::Collection::IList* pArgs);
64         bool OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId);
65         bool PrepareAnimation(const SceneId& sceneId, Tizen::Base::Collection::IList* pArgs,
66                                                         SceneTransitionAnimationType type, bool formTransition);
67
68         bool IsPanelCreatedFromFormResource(void) const;
69         void SetPanelCreatedFromFormResource(bool createFromFormResource);
70
71         //
72         // Create a new Scene instance
73         //
74         // @return              The Scene instance
75         // @since       2.0
76         //
77         static Tizen::Ui::Scenes::Scene* CreateSceneN(const SceneId& sceneId, const Tizen::Base::String& formId,
78                                                                                                 const Tizen::Base::String& panelId);
79
80         //
81         // Gets the implementation.
82         //
83         // @return              The implementation
84         // @param[in]   The interface instance pointer
85         // @since       2.0
86         //
87         static _SceneImpl* GetInstance(Scene& scene);
88
89         //
90         // Gets the implementation.
91         //
92         // @return              The implementation
93         // @param[in]   The interface instance pointer
94         // @since       2.0
95         //
96         static const _SceneImpl* GetInstance(const Scene& scene);
97
98 private:
99         _SceneImpl(const Scene& rhs);
100         _SceneImpl& operator =(const Scene& rhs);
101
102 private:
103         SceneId __sceneId;
104         Tizen::Base::String __formId;
105         Tizen::Base::String __panelId;
106         Tizen::Ui::Controls::Form* __pForm;
107         Tizen::Ui::Controls::Panel* __pPanel;
108         Tizen::Base::Collection::IList* __pArgs;
109         Tizen::Base::Collection::LinkedListT <ISceneEventListener*> __sceneEventListenerList;
110         ISceneAnimationProvider* __pSceneAnimationProvider;
111         bool __panelCreatedFromFormResource;
112 }; // _SceneImpl
113 } } } // Tizen::Ui::Scenes
114
115 #endif // _FUI_SCENES_INTERNAL_SCENE_IMPL_H_