X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fbutton.cpp;h=3b251da39fc9dc85b1860249be26ae09a53d4e00;hb=3b16ae16f01bd50a26e6c44e6e20ebb8499b4f91;hp=aa03116180291802132606c2e0f241f2075fe89a;hpb=e2eda444afbe82e9591fe198eef339227f90a616;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/buttons/button.cpp b/dali-toolkit/public-api/controls/buttons/button.cpp index aa03116..3b251da 100644 --- a/dali-toolkit/public-api/controls/buttons/button.cpp +++ b/dali-toolkit/public-api/controls/buttons/button.cpp @@ -1,18 +1,19 @@ -// -// 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) 2014 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 @@ -28,8 +29,12 @@ namespace Dali namespace Toolkit { +const char* const Button::SIGNAL_PRESSED = "pressed"; +const char* const Button::SIGNAL_RELEASED = "released"; const char* const Button::SIGNAL_CLICKED = "clicked"; -const char* const Button::PROPERTY_DIMMED = "dimmed"; +const char* const Button::SIGNAL_STATE_CHANGED = "state-changed"; + +const char* const Button::ACTION_BUTTON_CLICK = "button-click"; Button::Button() {} @@ -57,14 +62,64 @@ Button Button::DownCast( BaseHandle handle ) return Control::DownCast(handle); } -void Button::SetDimmed( bool dimmed ) +void Button::SetDisabled( bool disabled ) +{ + Dali::Toolkit::GetImplementation( *this ).SetDisabled( disabled ); +} + +bool Button::IsDisabled() const +{ + return Dali::Toolkit::GetImplementation( *this ).IsDisabled(); +} + +void Button::SetAutoRepeating( bool autoRepeating ) +{ + Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating ); +} + +bool Button::IsAutoRepeating() const +{ + return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating(); +} + +void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ) +{ + Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay ); +} + +float Button::GetInitialAutoRepeatingDelay() const +{ + return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay(); +} + +void Button::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ) +{ + Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay ); +} + +float Button::GetNextAutoRepeatingDelay() const +{ + return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay(); +} + +void Button::SetTogglableButton( bool togglable ) { - Dali::Toolkit::GetImplementation( *this ).SetDimmed( dimmed ); + Dali::Toolkit::GetImplementation( *this ).SetTogglableButton( togglable ); } -bool Button::IsDimmed() const +bool Button::IsTogglableButton() const { - return Dali::Toolkit::GetImplementation( *this ).IsDimmed(); + return Dali::Toolkit::GetImplementation( *this ).IsTogglableButton(); +} + +void Button::SetSelected( bool selected ) +{ + Dali::Toolkit::GetImplementation( *this ).SetSelected( selected ); +} + +bool Button::IsSelected() const +{ + return Dali::Toolkit::GetImplementation( *this ).IsSelected(); } void Button::SetAnimationTime( float animationTime ) @@ -77,11 +132,41 @@ float Button::GetAnimationTime() const return Dali::Toolkit::GetImplementation( *this ).GetAnimationTime(); } -Button::ClickedSignalV2& Button::ClickedSignal() +void Button::SetLabel( const std::string& label ) +{ + Dali::Toolkit::GetImplementation( *this ).SetLabel( label ); +} + +void Button::SetLabel( Actor label ) +{ + Dali::Toolkit::GetImplementation( *this ).SetLabel( label ); +} + +Actor Button::GetLabel() const +{ + return Dali::Toolkit::GetImplementation( *this ).GetLabel(); +} + +Button::ButtonSignalType& Button::PressedSignal() +{ + return Dali::Toolkit::GetImplementation( *this ).PressedSignal(); +} + +Button::ButtonSignalType& Button::ReleasedSignal() +{ + return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal(); +} + +Button::ButtonSignalType& Button::ClickedSignal() { return Dali::Toolkit::GetImplementation( *this ).ClickedSignal(); } +Button::ButtonSignalType& Button::StateChangedSignal() +{ + return Dali::Toolkit::GetImplementation( *this ).StateChangedSignal(); +} + Button::Button( Internal::Button& implementation ) : Control( implementation ) {