Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUiCtrl_Animation.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_Animation.h
19  * @brief               This is the header file for the _Animation class.
20  *
21  * This header file contains the declarations of the %_Animation class.
22  */
23 #ifndef _FUI_CTRL_INTERNAL_ANIMATION_H_
24 #define _FUI_CTRL_INTERNAL_ANIMATION_H_
25
26 #include <FBaseRtTimer.h>
27 #include <FBaseRtITimerEventListener.h>
28 #include <FUiCtrlAnimation.h>
29 #include <FUiCtrlAnimationFrame.h>
30 #include <FUiIAnimationEventListener.h>
31 #include "FUi_Control.h"
32 #include "FUiCtrl_AnimationEvent.h"
33 #include "FUiCtrl_IAnimationEventListener.h"
34
35 namespace Tizen { namespace Ui
36 {
37 class _AccessibilityElement;
38 }} // Tizen::Ui
39
40 namespace Tizen { namespace Ui { namespace Controls
41 {
42
43 class _AnimationPresenter;
44
45
46 class _Animation
47         : public Tizen::Ui::_Control
48         , public Tizen::Base::Runtime::ITimerEventListener
49         , virtual public Tizen::Base::Runtime::IEventListener
50         , virtual public Tizen::Ui::_IUiEventListener
51         , virtual public Tizen::Ui::_IUiEventPreviewer
52 {
53         DECLARE_CLASS_BEGIN(_Animation, Tizen::Ui::_Control);
54         DECLARE_PROPERTY("repeatCount", GetPropertyRepeatCount, SetPropertyRepeatCount);
55         DECLARE_CLASS_END();
56
57 public:
58         _Animation(void);
59         virtual ~_Animation(void);
60
61         result SetPropertyRepeatCount(const Tizen::Ui::Variant& repeatCount);
62         Tizen::Ui::Variant GetPropertyRepeatCount(void) const;
63
64         result AddAnimationEventListener(const _IAnimationEventListener& listener);
65         result RemoveAnimationEventListener(const _IAnimationEventListener& listener);
66         result SetAnimationFrames(const Tizen::Base::Collection::IList& animationFrames);
67         void SetImageCount(int imageCount);
68         result SetRepeatCount(int count);
69         Tizen::Base::Collection::IList* GetAnimationFrames(void) const;
70         int GetRepeatCount(void) const;
71         int GetImageCount(void) const;
72         int GetCurrentRepeatedCount(void) const;
73         result Play(void);
74         result Stop(void);
75         result Pause(void);
76         AnimationStatus GetStatus(void) const;
77
78         virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
79         virtual void OnDraw(void);
80         virtual result OnAttachedToMainTree(void);
81         virtual void OnBoundsChanged(void);
82
83         static _Animation* CreateAnimationN(void);
84
85 private:
86         _Animation(const _Animation& rhs);
87         _Animation& operator =(const _Animation& rhs);
88
89 private:
90         _AnimationPresenter* __pAnimationPresenter;
91         Tizen::Ui::Control* __pControlAnimation;
92         _AnimationEvent* __pAnimationEvent;
93         Tizen::Base::Collection::IList* __pAnimationFrames;
94         Tizen::Ui::_AccessibilityElement* __pAccessibilityElement;
95
96 };  // _Animation
97
98 }}} // Tizen::Ui::Controls
99
100 #endif  // _FUI_CTRL_INTERNAL_ANIMATION_H_