2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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.
19 * @file FUiCtrl_SplitPanel.cpp
20 * @brief This is the implementation file for the _SplitPanel class.
23 #include <FBaseErrorDefine.h>
24 #include <FBaseString.h>
25 #include <FBaseSysLog.h>
26 #include <FGrp_BitmapImpl.h>
27 #include <FGrp_CoordinateSystemUtils.h>
28 #include "FUi_ResourceManager.h"
29 #include "FUi_UiTouchEvent.h"
30 #include "FUi_TouchTapGestureDetector.h"
31 #include "FUiCtrl_SplitPanel.h"
32 #include "FUiCtrl_SplitPanelPresenter.h"
34 using namespace Tizen::Ui;
35 using namespace Tizen::Graphics;
36 using namespace Tizen::Ui::Animations;
37 using namespace Tizen::Base;
38 using namespace Tizen::Base::Runtime;
40 namespace Tizen { namespace Ui { namespace Controls
43 _SplitPanel::_SplitPanel()
44 : __pSplitPanelPresenter(null)
46 , __pFirstPaneParent(null)
47 , __pSecondPaneParent(null)
50 , __splitPanelDividerDirection(SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
51 , __pSplitPanelEvent(null)
52 , __dividerTapCount(0)
53 , __pDividerVisualElement(null)
55 for (int i=0; i < _SPLIT_PANEL_DIVIDER_STATE; i++)
57 __dividerPosition[i] = 0.0f;
58 __minimumDividerPosition[i] = 0.0f;
59 __maximumDividerPosition[i] = 0.0f;
64 _SplitPanel::CreateSplitPanelN(const FloatRectangle& rect, SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection)
67 float dividerThickness = 0.0f;
68 _SplitPanel* pSplitPanel = null;
69 _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
71 pSplitPanel = new (std::nothrow) _SplitPanel;
72 SysTryReturn(NID_UI_CTRL, pSplitPanel, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
74 r = pSplitPanel->Construct(splitPanelDividerStyle, splitPanelDividerDirection);
81 pSplitPanel->AcquireHandle();
82 pSplitPanel->SetDividerDirection(splitPanelDividerDirection);
84 orientation = _ControlManager::GetInstance()->GetOrientation();
86 if (splitPanelDividerStyle == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
88 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, dividerThickness);
92 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, dividerThickness);
95 pSplitPanel->__maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.width - dividerThickness;
96 pSplitPanel->__maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.width - dividerThickness;
97 pSplitPanel->__maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.height - dividerThickness;
98 pSplitPanel->__maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.width - dividerThickness;
100 pSplitPanel->__dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.width / 2.0f;
101 pSplitPanel->__dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.width / 2.0f;
102 pSplitPanel->__dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = rect.height / 2.0f;
103 pSplitPanel->__dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.height / 2.0f;
105 pSplitPanel->__pTapGesture = new (std::nothrow) _TouchTapGestureDetector;
106 SysTryCatch(NID_UI_CTRL, pSplitPanel->__pTapGesture, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
108 pSplitPanel->AddGestureDetector(*(pSplitPanel->__pTapGesture));
109 r = pSplitPanel->__pTapGesture->AddGestureListener(*pSplitPanel);
110 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
112 pSplitPanel->SetFocusable(false);
113 pSplitPanel->SetBackgroundColor(Color(0,0,0,0));
118 if (pSplitPanel->__pTapGesture != null)
120 pSplitPanel->__pTapGesture->RemoveGestureListener(*pSplitPanel);
121 pSplitPanel->RemoveGestureDetector(*pSplitPanel->__pTapGesture);
123 delete pSplitPanel->__pTapGesture;
124 pSplitPanel->__pTapGesture = null;
132 _SplitPanel::Construct(SplitPanelDividerStyle splitPanelDividerStyle, SplitPanelDividerDirection splitPanelDividerDirection)
134 result r = E_SUCCESS;
136 __pDividerVisualElement = new (std::nothrow) VisualElement();
137 SysTryReturnResult(NID_UI_CTRL, __pDividerVisualElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
138 r = __pDividerVisualElement->Construct();
139 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct divider visual element.", GetErrorMessage(r));
141 __pDividerVisualElement->SetShowState(true);
142 __pDividerVisualElement->SetImplicitAnimationEnabled(false);
143 __pDividerVisualElement->SetClipChildrenEnabled(false);
145 r = GetVisualElement()->AttachChild(*__pDividerVisualElement);
146 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to attach divider visual element.", GetErrorMessage(r));
148 __pSplitPanelPresenter = new (std::nothrow) _SplitPanelPresenter;
149 SysTryCatch(NID_UI_CTRL, __pSplitPanelPresenter != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
151 r = __pSplitPanelPresenter->Construct(*this, splitPanelDividerStyle, splitPanelDividerDirection);
152 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct presenter.", GetErrorMessage(r));
154 __pFirstPaneParent = _Control::CreateControlN();
156 SysTryCatch(NID_UI_CTRL, __pFirstPaneParent != null, , r, "[%s] Propagating.", GetErrorMessage(r));
158 __pSecondPaneParent = _Control::CreateControlN();
160 SysTryCatch(NID_UI_CTRL, __pSecondPaneParent != null, , r, "[%s] Propagating.", GetErrorMessage(r));
162 __pFirstPaneParent->SetFocusable(false);
163 __pSecondPaneParent->SetFocusable(false);
165 __pFirstPaneParent->SetBackgroundColor(Color(0,0,0,0));
166 __pSecondPaneParent->SetBackgroundColor(Color(0,0,0,0));
168 r = AttachChild(*__pFirstPaneParent);
169 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
171 r = AttachChild(*__pSecondPaneParent);
172 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
178 if (__pDividerVisualElement != null)
180 __pDividerVisualElement->Destroy();
181 __pDividerVisualElement = null;
184 delete __pSplitPanelPresenter;
185 __pSplitPanelPresenter = null;
187 if (__pFirstPaneParent != null)
189 DetachChild(*__pFirstPaneParent);
191 delete __pFirstPaneParent;
192 __pFirstPaneParent = null;
195 if (__pSecondPaneParent != null)
197 DetachChild(*__pSecondPaneParent);
199 delete __pSecondPaneParent;
200 __pSecondPaneParent = null;
206 _SplitPanel::~_SplitPanel(void)
208 delete __pSplitPanelPresenter;
209 __pSplitPanelPresenter = null;
211 delete __pSplitPanelEvent;
212 __pSplitPanelEvent = null;
214 if (__pTapGesture != null)
216 __pTapGesture->RemoveGestureListener(*this);
217 RemoveGestureDetector(*__pTapGesture);
219 delete __pTapGesture;
220 __pTapGesture = null;
223 if (__pDividerVisualElement != null)
225 GetVisualElement()->DetachChild(*__pDividerVisualElement);
227 __pDividerVisualElement->Destroy();
228 __pDividerVisualElement = null;
231 if (__pFirstPaneParent != null)
233 DetachChild(*__pFirstPaneParent);
235 delete __pFirstPaneParent;
236 __pFirstPaneParent = null;
239 if (__pSecondPaneParent != null)
241 DetachChild(*__pSecondPaneParent);
243 delete __pSecondPaneParent;
244 __pSecondPaneParent = null;
251 _SplitPanel::SetPresenter(const _SplitPanelPresenter& splitPanelPresenter)
253 __pSplitPanelPresenter = const_cast<_SplitPanelPresenter*>(&splitPanelPresenter);
258 _SplitPanel::AddSplitPanelEventListener(const _ISplitPanelEventListener& listener)
260 result r = E_SUCCESS;
262 if (__pSplitPanelEvent == null)
264 __pSplitPanelEvent = _SplitPanelEvent::CreateInstanceN(*this);
266 SysTryReturn(NID_UI_CTRL, __pSplitPanelEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
268 __pSplitPanelEvent->AddListener(listener);
275 _SplitPanel::RemoveSplitPanelEventListener(const _ISplitPanelEventListener& listener)
277 SysTryReturn(NID_UI_CTRL, __pSplitPanelEvent, E_SYSTEM, E_SYSTEM,
278 "[E_SYSTEM] System error occurred.");
280 __pSplitPanelEvent->RemoveListener(listener);
286 _SplitPanel::OnDraw(void)
288 __pSplitPanelPresenter->Draw();
294 _SplitPanel::OnChangeLayout(_ControlOrientation orientation)
296 __pSplitPanelPresenter->OnChangeLayout(orientation);
302 _SplitPanel::OnBoundsChanged(void)
304 FloatRectangle bounds = GetBoundsF();
305 float dividerThickness = 0.0f;
306 _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
308 orientation = _ControlManager::GetInstance()->GetOrientation();
310 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, dividerThickness);
312 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
314 if (GetMaximumDividerPosition() > (bounds.width - dividerThickness))
316 SetMaximumDividerPosition(bounds.width - dividerThickness);
321 if (GetMaximumDividerPosition() > (bounds.height - dividerThickness))
323 SetMaximumDividerPosition(bounds.height - dividerThickness);
327 __pSplitPanelPresenter->OnBoundsChanged();
332 _UiTouchEventDelivery
333 _SplitPanel::OnPreviewTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
335 if (__pSplitPanelPresenter->OnTouchPressed(source, touchinfo))
337 return _UI_TOUCH_EVENT_DELIVERY_NO;
340 return _UI_TOUCH_EVENT_DELIVERY_YES;
343 _UiTouchEventDelivery
344 _SplitPanel::OnPreviewTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
346 if (__pSplitPanelPresenter->OnTouchReleased(source, touchinfo))
348 return _UI_TOUCH_EVENT_DELIVERY_NO;
351 return _UI_TOUCH_EVENT_DELIVERY_YES;
354 _UiTouchEventDelivery
355 _SplitPanel::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
357 if (__pSplitPanelPresenter->OnTouchMoved(source, touchinfo))
359 return _UI_TOUCH_EVENT_DELIVERY_NO;
362 return _UI_TOUCH_EVENT_DELIVERY_YES;
365 _UiTouchEventDelivery
366 _SplitPanel::OnPreviewTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
368 if (__pSplitPanelPresenter->OnTouchCanceled(source, touchinfo))
370 return _UI_TOUCH_EVENT_DELIVERY_NO;
373 return _UI_TOUCH_EVENT_DELIVERY_YES;
377 _SplitPanel::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
383 return __pSplitPanelPresenter->OnTouchPressed(source, touchinfo);
387 _SplitPanel::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
393 return __pSplitPanelPresenter->OnTouchReleased(source, touchinfo);
397 _SplitPanel::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
403 return __pSplitPanelPresenter->OnTouchMoved(source, touchinfo);
407 _SplitPanel::OnTouchCanceled(const _Control & source, const _TouchInfo & touchinfo)
409 return __pSplitPanelPresenter->OnTouchCanceled(source, touchinfo);
413 _SplitPanel::OnTapGestureDetected(_TouchTapGestureDetector& gesture)
415 if (__pSplitPanelPresenter == null)
420 return __pSplitPanelPresenter->OnTapGestureDetected(gesture);
424 _SplitPanel::OnTapGestureCanceled(_TouchTapGestureDetector& gesture)
426 return __pSplitPanelPresenter->OnTapGestureCanceled(gesture);
430 _SplitPanel::SetPane(_Control* pControl, SplitPanelPaneOrder paneOrder)
432 result r = E_SUCCESS;
434 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
436 if (pControl != null)
438 r = __pFirstPaneParent->AttachChild(*pControl);
439 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
442 __pFirstPane = pControl;
446 if (pControl != null)
448 r = __pSecondPaneParent->AttachChild(*pControl);
449 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
452 __pSecondPane = pControl;
455 __pSplitPanelPresenter->RecalcSplitPanel();
461 _SplitPanel::GetPane(SplitPanelPaneOrder paneOrder) const
463 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
465 return const_cast <_Control*>(__pFirstPane);
468 return const_cast <_Control*>(__pSecondPane);
472 _SplitPanel::GetPaneParent(SplitPanelPaneOrder paneOrder) const
474 if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
476 return const_cast <_Control*>(__pFirstPaneParent);
479 return const_cast <_Control*>(__pSecondPaneParent);
483 _SplitPanel::SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle)
485 __pSplitPanelPresenter->SetDividerStyle(splitPanelDividerStyle);
490 SplitPanelDividerStyle
491 _SplitPanel::GetDividerStyle(void) const
493 return __pSplitPanelPresenter->GetDividerStyle();
497 _SplitPanel::SetDividerPosition(float position)
499 const float width = GetBoundsF().width;
500 const float height = GetBoundsF().height;
503 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
505 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
507 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
511 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
514 margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
516 if ((0.0f > position) ||
517 ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
518 ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)))
520 return E_OUT_OF_RANGE;
523 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
525 if ((GetMinimumDividerPosition() > position) || (GetMaximumDividerPosition() < position))
527 return E_OUT_OF_RANGE;
531 if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
533 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
535 __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position;
539 __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position;
544 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
546 __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position;
550 __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position;
554 __pSplitPanelPresenter->RecalcSplitPanel();
560 _SplitPanel::GetDividerPosition(void) const
562 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
564 if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
566 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
568 return __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE];
572 return __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE];
577 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
579 return __dividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT];
583 return __dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT];
589 _SplitPanel::SetMaximumDividerPosition(float position)
591 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
593 SysLog(NID_UI_CTRL, "[E_SYSTEM] System error occurred. This functionality is not supported for divider style fixed.");
597 const float width = GetBoundsF().width;
598 const float height = GetBoundsF().height;
601 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
603 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
605 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
609 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
612 margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
614 if ((0.0f > position) ||
615 ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
616 ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)) ||
617 (position < GetMinimumDividerPosition()))
619 return E_OUT_OF_RANGE;
622 if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
624 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
626 __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position;
630 __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position;
635 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
637 __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position;
641 __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position;
645 if (GetDividerPosition() > position)
647 SetDividerPosition(position);
654 _SplitPanel::GetMaximumDividerPosition(void) const
656 if (GetDividerStyle() != SPLIT_PANEL_DIVIDER_STYLE_FIXED)
658 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
660 if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
662 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
664 return __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE];
668 return __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE];
673 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
675 return __maximumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT];
679 return __maximumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT];
685 return GetBounds().width;
689 _SplitPanel::SetMinimumDividerPosition(float position)
691 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
693 SysLog(NID_UI_CTRL, "[E_SYSTEM] System error occurred. This functionality is not supported for divider style fixed");
697 const float width = GetBoundsF().width;
698 const float height = GetBoundsF().height;
701 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
703 if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
705 GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
709 GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
712 margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
714 if ((0.0f > position) ||
715 ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
716 ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)) ||
717 (position > GetMaximumDividerPosition()))
719 return E_OUT_OF_RANGE;
722 if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
724 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
726 __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE] = position;
730 __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = position;
735 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
737 __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT] = position;
741 __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT] = position;
745 if (GetDividerPosition() < position)
747 SetDividerPosition(position);
754 _SplitPanel::GetMinimumDividerPosition(void) const
756 if (GetDividerStyle() != SPLIT_PANEL_DIVIDER_STYLE_FIXED)
758 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
760 if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
762 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
764 return __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_LANDSCAPE];
768 return __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE];
773 if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
775 return __minimumDividerPosition[_SPLIT_PANEL_VERTICAL_DIVIDER_ORIENTATION_PORTRAIT];
779 return __minimumDividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_PORTRAIT];
789 _SplitPanel::SetDividerDirection(SplitPanelDividerDirection dividerDirection)
791 __splitPanelDividerDirection = dividerDirection;
796 SplitPanelDividerDirection
797 _SplitPanel::GetDividerDirection(void) const
799 SetLastResult(E_SUCCESS);
801 return __splitPanelDividerDirection;
805 _SplitPanel::MaximizePane(SplitPanelPaneOrder paneOrder)
807 return __pSplitPanelPresenter->MaximizePane(paneOrder);
811 _SplitPanel::IsPaneMaximized(SplitPanelPaneOrder paneOrder) const
813 return __pSplitPanelPresenter->IsPaneMaximized(paneOrder);
817 _SplitPanel::RestorePane(void)
819 return __pSplitPanelPresenter->RestorePane();
823 _SplitPanel::SendSplitPanelEvent(_SplitPanelEventStatus status)
825 result r = E_SUCCESS;
826 IEventArg* pEventArg = null;
828 if (__pSplitPanelEvent != null)
830 pEventArg = _SplitPanelEvent::CreateSplitPanelEventArgN(status);
832 SysTryReturn(NID_UI_CTRL, pEventArg, r, r, "[%s] Propagating.", GetErrorMessage(r));
834 __pSplitPanelEvent->Fire(*pEventArg);
841 _SplitPanel::SetTapCount(int count)
843 __dividerTapCount = count;
849 _SplitPanel::GetTapCount(void) const
851 return __dividerTapCount;
855 _SplitPanel::GetDividerVisualElement(void)
857 return __pDividerVisualElement;
861 _SplitPanel::SetDividerVisualElementBounds(Tizen::Graphics::FloatRectangle& bounds)
863 if (__pDividerVisualElement != null)
865 __pDividerVisualElement->SetBounds(bounds);
871 }}} // Tizen::Ui::Controls