X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol.cpp;h=5bbc4e72ac3dfb48c715e4fe960acdc33e8ac859;hb=e7b15762891519cef36d531c100eb6382fec773c;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..5bbc4e7 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,12 +27,9 @@ 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() @@ -36,7 +37,7 @@ Control::Control() } Control::Control(const Control& uiControl) -: CustomActor( uiControl ? static_cast( uiControl.GetImplementation() ).GetOwner() : NULL) +: CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL) { } @@ -55,110 +56,105 @@ Control& Control::operator=( const Control& handle ) Control Control::DownCast( BaseHandle handle ) { - return DownCast(handle); + return DownCast< Control, Internal::Control >(handle); } -ControlImpl& Control::GetImplementation() +Internal::Control& Control::GetImplementation() { - return static_cast(CustomActor::GetImplementation()); + return static_cast(CustomActor::GetImplementation()); } -const ControlImpl& Control::GetImplementation() const +const Internal::Control& Control::GetImplementation() const { - return static_cast(CustomActor::GetImplementation()); + return static_cast(CustomActor::GetImplementation()); } -void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy ) +void Control::SetKeyInputFocus() { - GetImplementation().SetSizePolicy( widthPolicy, heightPolicy ); + GetImplementation().SetKeyInputFocus(); } -void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const +bool Control::HasKeyInputFocus() { - GetImplementation().GetSizePolicy( widthPolicy, heightPolicy ); + return GetImplementation().HasKeyInputFocus(); } -void Control::SetMinimumSize( const Vector3& size ) +void Control::ClearKeyInputFocus() { - GetImplementation().SetMinimumSize( size ); + GetImplementation().ClearKeyInputFocus(); } -const Vector3& Control::GetMinimumSize() const +PinchGestureDetector Control::GetPinchGestureDetector() const { - return GetImplementation().GetMinimumSize(); + return GetImplementation().GetPinchGestureDetector(); } -void Control::SetMaximumSize( const Vector3& size ) +PanGestureDetector Control::GetPanGestureDetector() const { - GetImplementation().SetMaximumSize( size ); + return GetImplementation().GetPanGestureDetector(); } -const Vector3& Control::GetMaximumSize() const +TapGestureDetector Control::GetTapGestureDetector() const { - return GetImplementation().GetMaximumSize(); + return GetImplementation().GetTapGestureDetector(); } -Vector3 Control::GetNaturalSize() +LongPressGestureDetector Control::GetLongPressGestureDetector() const { - return GetImplementation().GetNaturalSize(); + return GetImplementation().GetLongPressGestureDetector(); } -float Control::GetHeightForWidth( float width ) +void Control::SetStyleName( const std::string& styleName ) { - return GetImplementation().GetHeightForWidth( width ); + GetImplementation().SetStyleName( styleName ); } -float Control::GetWidthForHeight( float height ) +const std::string& Control::GetStyleName() const { - return GetImplementation().GetWidthForHeight( height ); + return GetImplementation().GetStyleName(); } -void Control::SetKeyInputFocus() +void Control::SetBackgroundColor( const Vector4& color ) { - GetImplementation().SetKeyInputFocus(); + GetImplementation().SetBackgroundColor( color ); } -bool Control::HasKeyInputFocus() +Vector4 Control::GetBackgroundColor() const { - return GetImplementation().HasKeyInputFocus(); + return GetImplementation().GetBackgroundColor(); } -void Control::ClearKeyInputFocus() +void Control::SetBackgroundImage( Image image ) { - GetImplementation().ClearKeyInputFocus(); + GetImplementation().SetBackgroundImage( image ); } -Control::KeyEventSignalV2& Control::KeyEventSignal() +void Control::ClearBackground() { - return GetImplementation().KeyEventSignal(); + GetImplementation().ClearBackground(); } -/** - * @copydoc ConnectionTrackerInterface::SignalConnected - */ -void Control::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback ) +Actor Control::GetBackgroundActor() const { - GetImplementation().SignalConnected(slotObserver, callback ); + return GetImplementation().GetBackgroundActor(); } -/** - * @copydoc ConnectionTrackerInterface::SignalDisconnected - */ -void Control::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback ) +Control::KeyEventSignalType& Control::KeyEventSignal() { - GetImplementation().SignalDisconnected(slotObserver, callback ); + return GetImplementation().KeyEventSignal(); } -/** - * @copydoc ConnectionTrackerInterface::GetConnectionCount - */ -std::size_t Control::GetConnectionCount() const +Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal() { - return GetImplementation().GetConnectionCount( ); + return GetImplementation().KeyInputFocusGainedSignal(); } +Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal() +{ + return GetImplementation().KeyInputFocusLostSignal(); +} -Control::Control(ControlImpl& implementation) +Control::Control(Internal::Control& implementation) : CustomActor(implementation) { } @@ -166,7 +162,7 @@ Control::Control(ControlImpl& implementation) Control::Control(Dali::Internal::CustomActor* internal) : CustomActor(internal) { - VerifyCustomActorPointer(internal); + VerifyCustomActorPointer(internal); } } // namespace Toolkit