X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=18eaeeb33a7a7a7b102b1b18b2b50b4ede77fa31;hb=1844e9a1b878629f4987aea536660e3a70962c8c;hp=2022ce59d4a672540f203ded3add801b2eebba29;hpb=e2eda444afbe82e9591fe198eef339227f90a616;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 2022ce5..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,110 +56,90 @@ Control& Control::operator=( const Control& handle ) Control Control::DownCast( BaseHandle handle ) { - return DownCast(handle); -} - -ControlImpl& Control::GetImplementation() -{ - return static_cast(CustomActor::GetImplementation()); + return DownCast< Control, Internal::Control >(handle); } -const ControlImpl& Control::GetImplementation() const -{ - return static_cast(CustomActor::GetImplementation()); -} - -void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy ) +void Control::SetKeyInputFocus() { - GetImplementation().SetSizePolicy( widthPolicy, heightPolicy ); + Internal::GetImplementation(*this).SetKeyInputFocus(); } -void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const +bool Control::HasKeyInputFocus() { - GetImplementation().GetSizePolicy( widthPolicy, heightPolicy ); + return Internal::GetImplementation(*this).HasKeyInputFocus(); } -void Control::SetMinimumSize( const Vector3& size ) +void Control::ClearKeyInputFocus() { - GetImplementation().SetMinimumSize( size ); + Internal::GetImplementation(*this).ClearKeyInputFocus(); } -const Vector3& Control::GetMinimumSize() const +PinchGestureDetector Control::GetPinchGestureDetector() const { - return GetImplementation().GetMinimumSize(); + return Internal::GetImplementation(*this).GetPinchGestureDetector(); } -void Control::SetMaximumSize( const Vector3& size ) +PanGestureDetector Control::GetPanGestureDetector() const { - GetImplementation().SetMaximumSize( size ); + return Internal::GetImplementation(*this).GetPanGestureDetector(); } -const Vector3& Control::GetMaximumSize() const +TapGestureDetector Control::GetTapGestureDetector() const { - return GetImplementation().GetMaximumSize(); + return Internal::GetImplementation(*this).GetTapGestureDetector(); } -Vector3 Control::GetNaturalSize() +LongPressGestureDetector Control::GetLongPressGestureDetector() const { - return GetImplementation().GetNaturalSize(); + return Internal::GetImplementation(*this).GetLongPressGestureDetector(); } -float Control::GetHeightForWidth( float width ) +void Control::SetStyleName( const std::string& styleName ) { - return GetImplementation().GetHeightForWidth( width ); + Internal::GetImplementation(*this).SetStyleName( styleName ); } -float Control::GetWidthForHeight( float height ) +const std::string& Control::GetStyleName() const { - return GetImplementation().GetWidthForHeight( height ); + return Internal::GetImplementation(*this).GetStyleName(); } -void Control::SetKeyInputFocus() +void Control::SetBackgroundColor( const Vector4& color ) { - GetImplementation().SetKeyInputFocus(); + Internal::GetImplementation(*this).SetBackgroundColor( color ); } -bool Control::HasKeyInputFocus() +Vector4 Control::GetBackgroundColor() const { - return GetImplementation().HasKeyInputFocus(); + return Internal::GetImplementation(*this).GetBackgroundColor(); } -void Control::ClearKeyInputFocus() +void Control::SetBackgroundImage( Image image ) { - GetImplementation().ClearKeyInputFocus(); + 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) { } @@ -166,7 +147,7 @@ Control::Control(ControlImpl& implementation) Control::Control(Dali::Internal::CustomActor* internal) : CustomActor(internal) { - VerifyCustomActorPointer(internal); + VerifyCustomActorPointer(internal); } } // namespace Toolkit