Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_AnimationPresenter.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                FUiCtrl_AnimationPresenter.h
19  * @brief               This is the header file for the _AnimationPresenter class.
20  *
21  * This header file contains the declarations of the %_AnimationPresenter class.
22  */
23 #ifndef _FUI_CTRL_INTERNAL_ANIMATION_PRESENTER_H_
24 #define _FUI_CTRL_INTERNAL_ANIMATION_PRESENTER_H_
25
26 #include <FBaseObject.h>
27 #include <FUiCtrlAnimation.h>
28 #include <FUiCtrlAnimationFrame.h>
29 #include "FUi_ControlImpl.h"
30 #include "FUiAnim_VisualElement.h"
31
32 namespace Tizen { namespace Ui { namespace Controls
33 {
34 class _Animation;
35 class _AnimationModel;
36
37
38 class _AnimationPresenter
39         : public Tizen::Base::Object
40 {
41 public:
42         virtual ~_AnimationPresenter(void);
43
44         result Draw(void);
45         bool IsTimerExpired(Tizen::Base::Runtime::Timer& timer);
46         void SetImageCount(int imageCount);
47         result SetAnimationFrames(const Tizen::Base::Collection::IList* pAnimationFrames);
48         void SetRepeatCount(int count);
49         int GetRepeatCount(void) const;
50         int GetCurrentRepeatedCount(void) const;
51         int GetImageCount(void) const;
52         result Play(void);
53         result Stop(void);
54         result Pause(void);
55         AnimationStatus GetStatus(void) const;
56
57         static _AnimationPresenter* CreateInstanceN(const _Animation& animation);
58
59 private:
60         _AnimationPresenter(void);
61         result Initialize(const _Animation& animation);
62
63         AnimationFrame* GetCurrentFrame(void) const;
64         AnimationFrame* GetNextFrame(void) const;
65         result Dispose(void);
66
67         _AnimationPresenter(const _AnimationPresenter& rhs);
68         _AnimationPresenter& operator =(const _AnimationPresenter& rhs);
69
70 private:
71         _Animation* __pAnimation;
72         _AnimationModel* __pAnimationModel;
73         Tizen::Base::Runtime::Timer* __pTimer;
74         Tizen::Base::Collection::IEnumerator* __pCurrentFrame;
75         bool __isTimerRunning;
76         Tizen::Ui::Animations::_VisualElement* __pVisualElement;
77
78 };  // _AnimationPresenter
79
80 }}} // Tizen::Ui::Controls
81
82 #endif  // _FUI_CTRL_INTERNAL_ANIMATION_PRESENTER_H_