2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
18 * @file FUiCtrl_SplitPanelPresenter.h
19 * @brief This is the header file for the _SplitPanelPresenter class.
21 * This header file contains the declarations of the %_SplitPanelPresenter class.
24 #ifndef _FUICTRL_INTERNAL_SPLIT_PANEL_PRESENTER_H_
25 #define _FUICTRL_INTERNAL_SPLIT_PANEL_PRESENTER_H_
27 #include <FBaseObject.h>
28 #include "FUi_Control.h"
29 #include "FUiCtrl_SplitPanelModel.h"
30 #include "FUi_ITouchTapGestureEventListener.h"
31 #include "FUiAnimations.h"
33 namespace Tizen { namespace Ui { namespace Controls
37 enum _SplitPanelAnimationDirection
39 _SPLIT_PANEL_ANIMATION_RIGHT = 0,
40 _SPLIT_PANEL_ANIMATION_LEFT,
41 _SPLIT_PANEL_ANIMATION_TOP,
42 _SPLIT_PANEL_ANIMATION_BOTTOM,
43 _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL,
44 _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL,
45 _SPLIT_PANEL_ANIMATION_MAX
48 const long ANIMATION_DURATION = 1000;
49 const float ANIMATION_ALPHA_HIDE = 0.0;
50 const float ANIMATION_ALPHA_SHOW = 1.0;
52 class _SplitPanelPresenter
53 : public Tizen::Base::Object
54 , public Tizen::Ui::_ITouchTapGestureEventListener
58 _SplitPanelPresenter(void);
59 virtual ~_SplitPanelPresenter(void);
62 virtual result Construct(const _SplitPanel& splitPanel, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection);
63 bool CheckDividerTouchRegion(int positionX, int positionY);
65 virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
66 virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
67 virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
68 virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
70 virtual bool OnTapGestureDetected(_TouchTapGestureDetector& gesture);
71 virtual bool OnTapGestureCanceled(_TouchTapGestureDetector& gesture);
73 result SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle);
74 SplitPanelDividerStyle GetDividerStyle(void) const;
76 Tizen::Graphics::Rectangle GetDividerRectangle(void) const;
78 result MaximizePane(SplitPanelPaneOrder paneOrder);
79 bool IsPaneMaximized(SplitPanelPaneOrder paneOrder) const;
80 result RestorePane(void);
84 result LoadBitmap(SplitPanelDividerDirection splitPanelDividerDirection);
86 void RecalcSplitPanel(void);
88 void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
90 void OnBoundsChanged(void);
93 result SetModel(const _SplitPanelModel& splitPanelModel);
96 result SetPaneBounds(void);
97 void AdjustDividerRectangle(void);
100 void ChangePaneOrder(SplitPanelPaneOrder paneOrder);
101 result AnimateDivider(int destination);
102 result AnimatePane(int destination);
103 Tizen::Ui::Control* GetPaneControl(SplitPanelPaneOrder paneOrder);
104 Tizen::Ui::Animations::AnimatorStatus GetAnimationStatus(void);
105 Tizen::Graphics::Rectangle GetRestorePaneBounds(SplitPanelPaneOrder paneOrder);
108 _SplitPanelPresenter(const _SplitPanelPresenter& value);
109 _SplitPanelPresenter& operator =(const _SplitPanelPresenter& value);
112 _SplitPanel* __pSplitPanel;
113 _SplitPanelModel* __pSplitPanelModel;
115 int __dividerMaximumPosition;
116 int __dividerMinimumPosition;
117 bool __splitPanelDividerPressed;
118 bool __setFirstDividerPositionChangeEvent;
120 Tizen::Graphics::Rectangle __dividerRectangle;
121 Tizen::Graphics::Rectangle __dividerThumbRectangle;
122 Tizen::Graphics::Bitmap* __pDividerPressedBackgroundBitmap;
123 Tizen::Graphics::Bitmap* __pDividerBackgroundBitmap;
124 Tizen::Graphics::Bitmap* __pDividerBackgroundEffectBitmap;
125 Tizen::Graphics::Bitmap* __pDividerThumbBitmap;
126 Tizen::Graphics::Color __dividerBackgroundColor;
127 Tizen::Graphics::Color __dividerPressedBackgroundColor;
130 int __transactionIdMaximize;
131 int __transactionIdRestore;
133 Tizen::Ui::Animations::AnimationInterpolatorType __controlAnimatorAnimationInterpolator;
134 Tizen::Base::String __visualElementAnimationInterpolator;
136 }; // _SplitPanelPresenter;
138 }}} // Tizen::Ui::Controls
140 #endif // _FUICTRL_INTERNAL_SPLIT_PANEL_PRESENTER_H_