X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=18eaeeb33a7a7a7b102b1b18b2b50b4ede77fa31;hb=affc5e6d979f078050d44e1f621a333daabb1d40;hp=bf3d9cc1825d7d5ee2d5fe155e8d2fa1189ca08e;hpb=818994dc0acac601b0b27c0b715259b504ef4ceb;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/control.cpp b/dali-toolkit/public-api/controls/control.cpp index bf3d9cc..18eaeeb 100644 --- a/dali-toolkit/public-api/controls/control.cpp +++ b/dali-toolkit/public-api/controls/control.cpp @@ -1,20 +1,24 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +// CLASS HEADER #include + +// INTERNAL INCLUDES #include namespace Dali @@ -23,20 +27,17 @@ namespace Dali namespace Toolkit { -const char* const Control::ACTION_CONTROL_ACTIVATED = "control-activated"; -const char* const Control::SIGNAL_KEY_EVENT = "key-event"; - Control Control::New() { - return ControlImpl::New(); + return Internal::Control::New(); } Control::Control() { } -Control::Control(const Control& uiControl) -: CustomActor( uiControl ? static_cast( uiControl.GetImplementation() ).GetOwner() : NULL) +Control::Control( const Control& uiControl ) +: CustomActor( uiControl ) { } @@ -55,130 +56,90 @@ Control& Control::operator=( const Control& handle ) Control Control::DownCast( BaseHandle handle ) { - return DownCast(handle); -} - -ControlImpl& Control::GetImplementation() -{ - return static_cast(CustomActor::GetImplementation()); -} - -const ControlImpl& Control::GetImplementation() const -{ - return static_cast(CustomActor::GetImplementation()); -} - -void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy ) -{ - GetImplementation().SetSizePolicy( widthPolicy, heightPolicy ); -} - -void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const -{ - GetImplementation().GetSizePolicy( widthPolicy, heightPolicy ); + return DownCast< Control, Internal::Control >(handle); } -void Control::SetMinimumSize( const Vector3& size ) -{ - GetImplementation().SetMinimumSize( size ); -} - -const Vector3& Control::GetMinimumSize() const -{ - return GetImplementation().GetMinimumSize(); -} - -void Control::SetMaximumSize( const Vector3& size ) +void Control::SetKeyInputFocus() { - GetImplementation().SetMaximumSize( size ); + Internal::GetImplementation(*this).SetKeyInputFocus(); } -const Vector3& Control::GetMaximumSize() const +bool Control::HasKeyInputFocus() { - return GetImplementation().GetMaximumSize(); + return Internal::GetImplementation(*this).HasKeyInputFocus(); } -Vector3 Control::GetNaturalSize() +void Control::ClearKeyInputFocus() { - return GetImplementation().GetNaturalSize(); + Internal::GetImplementation(*this).ClearKeyInputFocus(); } -float Control::GetHeightForWidth( float width ) +PinchGestureDetector Control::GetPinchGestureDetector() const { - return GetImplementation().GetHeightForWidth( width ); + return Internal::GetImplementation(*this).GetPinchGestureDetector(); } -float Control::GetWidthForHeight( float height ) +PanGestureDetector Control::GetPanGestureDetector() const { - return GetImplementation().GetWidthForHeight( height ); + return Internal::GetImplementation(*this).GetPanGestureDetector(); } -void Control::SetKeyInputFocus() +TapGestureDetector Control::GetTapGestureDetector() const { - GetImplementation().SetKeyInputFocus(); + return Internal::GetImplementation(*this).GetTapGestureDetector(); } -bool Control::HasKeyInputFocus() +LongPressGestureDetector Control::GetLongPressGestureDetector() const { - return GetImplementation().HasKeyInputFocus(); + return Internal::GetImplementation(*this).GetLongPressGestureDetector(); } -void Control::ClearKeyInputFocus() +void Control::SetStyleName( const std::string& styleName ) { - GetImplementation().ClearKeyInputFocus(); + Internal::GetImplementation(*this).SetStyleName( styleName ); } -PinchGestureDetector Control::GetPinchGestureDetector() const +const std::string& Control::GetStyleName() const { - return GetImplementation().GetPinchGestureDetector(); + return Internal::GetImplementation(*this).GetStyleName(); } -PanGestureDetector Control::GetPanGestureDetector() const +void Control::SetBackgroundColor( const Vector4& color ) { - return GetImplementation().GetPanGestureDetector(); + Internal::GetImplementation(*this).SetBackgroundColor( color ); } -TapGestureDetector Control::GetTapGestureDetector() const +Vector4 Control::GetBackgroundColor() const { - return GetImplementation().GetTapGestureDetector(); + return Internal::GetImplementation(*this).GetBackgroundColor(); } -LongPressGestureDetector Control::GetLongPressGestureDetector() const +void Control::SetBackgroundImage( Image image ) { - return GetImplementation().GetLongPressGestureDetector(); + Internal::GetImplementation(*this).SetBackgroundImage( image ); } -Control::KeyEventSignalV2& Control::KeyEventSignal() +void Control::ClearBackground() { - return GetImplementation().KeyEventSignal(); + Internal::GetImplementation(*this).ClearBackground(); } -/** - * @copydoc ConnectionTrackerInterface::SignalConnected - */ -void Control::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback ) +Control::KeyEventSignalType& Control::KeyEventSignal() { - GetImplementation().SignalConnected(slotObserver, callback ); + return Internal::GetImplementation(*this).KeyEventSignal(); } -/** - * @copydoc ConnectionTrackerInterface::SignalDisconnected - */ -void Control::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback ) +Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal() { - GetImplementation().SignalDisconnected(slotObserver, callback ); + return Internal::GetImplementation(*this).KeyInputFocusGainedSignal(); } -/** - * @copydoc ConnectionTrackerInterface::GetConnectionCount - */ -std::size_t Control::GetConnectionCount() const +Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal() { - return GetImplementation().GetConnectionCount( ); + return Internal::GetImplementation(*this).KeyInputFocusLostSignal(); } - -Control::Control(ControlImpl& implementation) +Control::Control(Internal::Control& implementation) : CustomActor(implementation) { } @@ -186,7 +147,7 @@ Control::Control(ControlImpl& implementation) Control::Control(Dali::Internal::CustomActor* internal) : CustomActor(internal) { - VerifyCustomActorPointer(internal); + VerifyCustomActorPointer(internal); } } // namespace Toolkit