From bf86f9c32454296d3896e7a85f4a3da29a521ebb Mon Sep 17 00:00:00 2001 From: Michal Makowiecki Date: Mon, 18 Aug 2014 11:31:17 +0200 Subject: [PATCH] Added RadioButton with images. Change-Id: I83b4e323af26d289d70ab7f87fb431bcc1e6c154 --- base/dali-toolkit/images/radio-button-active.png | Bin 0 -> 949 bytes base/dali-toolkit/images/radio-button-inactive.png | Bin 0 -> 795 bytes .../controls/buttons/radio-button-impl.cpp | 222 +++++++++++++++++++++ .../internal/controls/buttons/radio-button-impl.h | 171 ++++++++++++++++ base/dali-toolkit/internal/file.list | 1 + .../public-api/controls/buttons/radio-button.cpp | 122 +++++++++++ .../public-api/controls/buttons/radio-button.h | 186 +++++++++++++++++ base/dali-toolkit/public-api/file.list | 4 +- optional/dali-toolkit/dali-toolkit.h | 1 + 9 files changed, 706 insertions(+), 1 deletion(-) create mode 100644 base/dali-toolkit/images/radio-button-active.png create mode 100644 base/dali-toolkit/images/radio-button-inactive.png create mode 100644 base/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp create mode 100644 base/dali-toolkit/internal/controls/buttons/radio-button-impl.h create mode 100644 base/dali-toolkit/public-api/controls/buttons/radio-button.cpp create mode 100644 base/dali-toolkit/public-api/controls/buttons/radio-button.h diff --git a/base/dali-toolkit/images/radio-button-active.png b/base/dali-toolkit/images/radio-button-active.png new file mode 100644 index 0000000000000000000000000000000000000000..a59c43879303d6ea185ddf63b877153520df1888 GIT binary patch literal 949 zcmV;m14{gfP)ARFP<)5tUMrRtn-F<-m;-hh8c!5u&$Vb4bLYQq==WF*GV%s8ouQ zNKP?Q6D5jc5)9PE_`UJk-e+f599o#w9R7c2=AZe#Zvv+Y*sYF^j$C(lH-?9Y!CS3Xa2$tRE_X~2guA1o zqcM6J|23b_he#yir$X1(*4DnLR;yn*oz6dvT>f25TRNS-ck$B2L94}zX03(&LK?3c z&!OoWj@oy4t_(~dJ|&m3F+W%+)i(TG!buefM5imtA%8*_7WU)$}6P|lZdZ~q4* z4sIi*{DDm+iD%*yL-R{1k zu0yUXrmJ-goM^>b`4KXuEl5on;c(bGI5_wj-`UyOM}R<)RJ^Y5qgW}x!r7of!TZ)w zM7$8v_*jk^jDf(8@CMHswQIPp15H7O&awE=7&H}`;&d}sRaJvxmM0)GL?0xtgy7*` z*klJ9G%LsO|4XMdFglA~Pt?SOG=XxtyvGunkI74_uE6I!iq9kGQ7V?vJZM1{71LV> z5(;mNIMs6&p(A~eHOWw`y0NkG8%OdKwzs!?CMG6MO0tAl@FZ9oVe7?Ts0uYSn@zCv zojWm&tEaA;XPO3!i;E9PJKr-iGc!me68?pSh2;47cz|?+Hg_9x!b|M@vuV;9_D2zH z4?#E(zz{sCR7#kgosAC-4Q=tpa!}Pb7K`Oe`jH@d0-CPE&3Z5zJWa1LkmMFBwX(TH zG;W0;xgg8(ma!+iBuOSnv>Z=q8^>s_n=Y5@Jkjeks4{|##A2~1(Jnj;1OnfZh&D*d z<~<*e$4Ox#R#sLFb!8PrxsuQ4zw>xJ;|9-En=6${&*|=W+QJkSGI5xkoCFCF{|Ybw X%E_eCVxlxU00000NkvXXu0mjfSIe~D literal 0 HcmV?d00001 diff --git a/base/dali-toolkit/images/radio-button-inactive.png b/base/dali-toolkit/images/radio-button-inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..04b05da2372e6c9a6bcffa81288e3861d5875f74 GIT binary patch literal 795 zcmV+$1LXXPP)24*zf!u=pt~=O+z>)Mn32&Dg;(~@)%$Y%XkIpnV zH)n{);}%R3lzcv)X?1n=B}CLS*V95lro@v#3zD$pUz~L?5%2YSJsAv!`AjCWEil3L z#l^*|+@;-W$roAa%W4QZ{7oBf&CbrMT`t#6F)=YQ&towF7t{D>!IfUG$Bq%ib_n*F zx%K;fVpX}z|7tK8$cyg^2$6z)vck+y!uWp!;Y`TQa2c7PYPFgXQ1b(VQL)?YWBv1U zx?(i`0JsE%wfTmNTuAF67K??H2+-GHF!+i!=mCJ0W`4Ywk_t=BduY=Icg_YkKo<7W z>GWqMTZBy@6bj`SxdA%JKAi(hfsWjj`Bo|wInum8I5=o-ZEZbfAi)O+O#$}Zjz*(z zV2_o7+U@plJDK;dM|6CAT*J|QH2A`r2)2X^kK+?wqYu2EAt-lXua0T(M|`ndF846O zp4Do7f)K@+3ZDy)$0K(Ohr^t%EbM$(EEZqDl^g6cuqBM2#@Ty_9R-jabHCqD2q1kI ZU;wD3Xh=4UY$*T$002ovPDHLkV1o2~aSZ?f literal 0 HcmV?d00001 diff --git a/base/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp b/base/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp new file mode 100644 index 0000000..669394a --- /dev/null +++ b/base/dali-toolkit/internal/controls/buttons/radio-button-impl.cpp @@ -0,0 +1,222 @@ +/* + * 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 + +#include "radio-button-impl.h" + +using namespace Dali; +using namespace Dali::Toolkit::Internal; + +namespace Dali +{ +namespace Toolkit +{ +const Property::Index RadioButton::PROPERTY_ACTIVE = Internal::Button::BUTTON_PROPERTY_END_INDEX + 11; +const Property::Index RadioButton::PROPERTY_LABEL_ACTOR = Internal::Button::BUTTON_PROPERTY_END_INDEX + 12; +} +} + +namespace +{ + +BaseHandle Create() +{ + return Toolkit::RadioButton::New(); +} + +TypeRegistration typeRegistration(typeid (Toolkit::RadioButton ), typeid (Toolkit::Button ), Create); + +PropertyRegistration property1(typeRegistration, "active", Toolkit::RadioButton::PROPERTY_ACTIVE, Property::BOOLEAN, &RadioButton::SetProperty, &RadioButton::GetProperty); +PropertyRegistration property2(typeRegistration, "label-actor", Toolkit::RadioButton::PROPERTY_LABEL_ACTOR, Property::MAP, &RadioButton::SetProperty, &RadioButton::GetProperty); +} + +namespace +{ +const char* const INACTIVE_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-inactive.png"; +const char* const ACTIVE_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-active.png"; +const Vector3 IMAGE_WIDTH(16.f, 0.f, 0.f); +const Vector3 DISTANCE_BETWEEN_IMAGE_AND_LABEL(5.f, 0.f, 0.f); +} + +Dali::Toolkit::RadioButton RadioButton::New() +{ + // Create the implementation, temporarily owned on stack + IntrusivePtr< RadioButton > internalRadioButton = new RadioButton(); + + // Pass ownership to CustomActor + Dali::Toolkit::RadioButton radioButton(*internalRadioButton); + + // Second-phase init of the implementation + // This can only be done after the CustomActor connection has been made... + internalRadioButton->Initialize(); + + return radioButton; +} + +RadioButton::RadioButton() + : Button(), + mActive(false) +{ + mInactiveImage = Dali::Image::New(INACTIVE_BUTTON_IMAGE_DIR); + mActiveImage = Dali::Image::New(ACTIVE_BUTTON_IMAGE_DIR); + + mImageActor = Dali::ImageActor::New(mInactiveImage); + mLabel = Actor::New(); +} + +RadioButton::~RadioButton() +{ +} + +void RadioButton::SetLabel(const std::string& label) +{ + mLabel.Reset(); + mLabel = Actor::New(); + + Toolkit::TextView textView = Toolkit::TextView::New(label); + textView.SetWidthExceedPolicy(Toolkit::TextView::ShrinkToFit); // Make sure our text always fits inside the button + textView.SetAnchorPoint(AnchorPoint::TOP_LEFT); + + mLabel.Add(textView); +} + +void RadioButton::SetLabel(Actor label) +{ + if( mLabel != label ) + { + Self().Remove(mLabel); + mLabel = label; + Self().Add(mLabel); + } +} + +Actor RadioButton::GetLabel() const +{ + return mLabel; +} + +void RadioButton::SetActive(bool active) +{ + if( mActive != active ) + { + if( active ) + { + Actor parent = Self().GetParent(); + + if( parent ) + { + for( unsigned int i = 0; i < parent.GetChildCount(); ++i ) + { + Dali::Toolkit::RadioButton rbChild = Dali::Toolkit::RadioButton::DownCast(parent.GetChildAt(i)); + + if( rbChild ) + { + rbChild.SetActive(false); + } + } + } + mActive = true; + mImageActor.SetImage(mActiveImage); + } + else + { + mActive = false; + mImageActor.SetImage(mInactiveImage); + } + } +} + +bool RadioButton::IsActive()const +{ + return mActive; +} + +void RadioButton::ToggleState() +{ + SetActive(!mActive); +} + +void RadioButton::OnInitialize() +{ + mImageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT); + Self().Add(mImageActor); + + mLabel.SetAnchorPoint(AnchorPoint::TOP_LEFT); + mLabel.MoveBy(IMAGE_WIDTH + DISTANCE_BETWEEN_IMAGE_AND_LABEL); + Self().Add(mLabel); +} + +void RadioButton::OnButtonUp() +{ + ToggleState(); +} + +void RadioButton::SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value) +{ + Toolkit::RadioButton radioButton = Toolkit::RadioButton::DownCast(Dali::BaseHandle(object)); + + if( radioButton ) + { + RadioButton & radioButtonImpl(GetImplementation(radioButton)); + + switch ( propertyIndex ) + { + case Toolkit::RadioButton::PROPERTY_ACTIVE: + { + radioButtonImpl.SetActive(value.Get< bool >( )); + break; + } + case Toolkit::RadioButton::PROPERTY_LABEL_ACTOR: + { + radioButtonImpl.SetLabel(Scripting::NewActor(value.Get< Property::Map >( ))); + break; + } + } + } +} + +Property::Value RadioButton::GetProperty(BaseObject* object, Property::Index propertyIndex) +{ + Property::Value value; + + Toolkit::RadioButton radioButton = Toolkit::RadioButton::DownCast(Dali::BaseHandle(object)); + + if( radioButton ) + { + RadioButton & radioButtonImpl(GetImplementation(radioButton)); + + switch ( propertyIndex ) + { + case Toolkit::RadioButton::PROPERTY_ACTIVE: + { + value = radioButtonImpl.mActive; + break; + } + case Toolkit::RadioButton::PROPERTY_LABEL_ACTOR: + { + Property::Map map; + Scripting::CreatePropertyMap(radioButtonImpl.mLabel, map); + value = map; + break; + } + } + } + + return value; +} \ No newline at end of file diff --git a/base/dali-toolkit/internal/controls/buttons/radio-button-impl.h b/base/dali-toolkit/internal/controls/buttons/radio-button-impl.h new file mode 100644 index 0000000..1ee813f --- /dev/null +++ b/base/dali-toolkit/internal/controls/buttons/radio-button-impl.h @@ -0,0 +1,171 @@ +#ifndef __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__ +#define __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__ + +/* + * 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. + * + */ + +// INTERNAL INCLUDES +#include + +#include + +#include + +#include + +#include "button-impl.h" + +namespace Dali +{ +namespace Toolkit +{ +namespace Internal +{ + +/** + * RadioButton implementation class. + * + * \sa Dali::Toolkit::RadioButton + */ +class RadioButton: public Button +{ + public: + + /** + * Create a new RadioButton. + * + * @return A smart-pointer to the newly allocated PushButton. + */ + static Dali::Toolkit::RadioButton New(); + + /** + * Construct a new PushButton. + */ + RadioButton(); + + /** + * Construct a new PushButton with label. + */ + RadioButton(const std::string& label); + + /** + * Construct a new PushButton with label. + */ + RadioButton(Actor label); + + /** + * A reference counted object may only be deleted by calling Unreference() + */ + virtual ~RadioButton(); + + /** + * @copydoc Dali::Toolkit::RadioButton::SetLabel(const std::string& label) + */ + void SetLabel(const std::string& label); + + /** + * @copydoc Dali::Toolkit::RadioButton::SetLabel(Actor label) + */ + void SetLabel(Actor label); + + /** + * @copydoc Dali::Toolkit::RadioButton::GetLabel() + */ + Actor GetLabel() const; + + /** + * @copydoc Dali::Toolkit::RadioButton::SetActive(bool active) + */ + void SetActive(bool active); + + /** + * @copydoc Dali::Toolkit::RadioButton::IsActive() + */ + bool IsActive()const; + + /** + * @copydoc Dali::Toolkit::RadioButton::ToggleState() + */ + void ToggleState(); + + public: + // Properties + + /** + * @copydoc Button::SetProperty + */ + static void SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value); + + /** + * @copydoc Button::GetProperty + */ + static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex); + + protected: // From Control + + /** + * Sets the relative position of image and label. + */ + virtual void OnInitialize(); + + protected: // From Button + /** + * Change button state when the button is pressed. + */ + virtual void OnButtonUp(); + + private: + + // Undefined + RadioButton(const RadioButton& origin); + + // Undefined + RadioButton& operator=(const RadioButton& origin); + + Image mInactiveImage; ///< Stores the inactive image + Image mActiveImage; ///< Stores the active image + ImageActor mImageActor; ///< Stores the current image + Actor mLabel; ///< Stores the button label + bool mActive; ///< Stores the active state +} ; + +} // namespace Internal + +// Helpers for public-api forwarding methods + +inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button) +{ + DALI_ASSERT_ALWAYS(button); + + Dali::RefObject& handle = button.GetImplementation(); + + return static_cast (handle); +} + +inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button) +{ + DALI_ASSERT_ALWAYS(button); + + const Dali::RefObject& handle = button.GetImplementation(); + + return static_cast (handle); +} + +} // namespace Toolkit +} // namespace Dali + +#endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__ \ No newline at end of file diff --git a/base/dali-toolkit/internal/file.list b/base/dali-toolkit/internal/file.list index 75591bd..7b00a3d 100644 --- a/base/dali-toolkit/internal/file.list +++ b/base/dali-toolkit/internal/file.list @@ -10,6 +10,7 @@ toolkit_base_src_files = \ $(toolkit_base_src_dir)/controls/buttons/check-box-button-impl.cpp \ $(toolkit_base_src_dir)/controls/buttons/push-button-default-painter-impl.cpp \ $(toolkit_base_src_dir)/controls/buttons/push-button-impl.cpp \ + $(toolkit_base_src_dir)/controls/buttons/radio-button-impl.cpp \ $(toolkit_base_src_dir)/controls/popup/popup-impl.cpp \ $(toolkit_base_src_dir)/controls/popup/popup-style-impl.cpp \ $(toolkit_base_src_dir)/controls/scroll-bar/scroll-bar-impl.cpp \ diff --git a/base/dali-toolkit/public-api/controls/buttons/radio-button.cpp b/base/dali-toolkit/public-api/controls/buttons/radio-button.cpp new file mode 100644 index 0000000..fbb4f69 --- /dev/null +++ b/base/dali-toolkit/public-api/controls/buttons/radio-button.cpp @@ -0,0 +1,122 @@ +/* + * 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 + +#include + +// INTERNAL INCLUDES + +#include + +namespace Dali +{ + +namespace Toolkit +{ + +RadioButton::RadioButton() + : Button() +{ +} + +RadioButton::RadioButton(Internal::RadioButton& implementation) + : Button(implementation) +{ +} + +RadioButton::RadioButton(const RadioButton& radioButton) + : Button(radioButton) +{ +} + +RadioButton& RadioButton::operator=(const RadioButton& radioButton ) +{ + if( &radioButton != this ) + { + Button::operator=( radioButton ); + } + return *this; +} + +RadioButton::RadioButton(Dali::Internal::CustomActor* internal) + : Button(internal) +{ + VerifyCustomActorPointer( internal ); +} + +RadioButton::~RadioButton() +{ +} + +RadioButton RadioButton::New() +{ + return Internal::RadioButton::New(); +} + +RadioButton RadioButton::New(const std::string& label) +{ + RadioButton radioButton = Internal::RadioButton::New(); + radioButton.SetLabel(label); + return radioButton; +} + +RadioButton RadioButton::New(Actor label) +{ + RadioButton radioButton = Internal::RadioButton::New(); + radioButton.SetLabel(label); + return radioButton; +} + +RadioButton RadioButton::DownCast(BaseHandle handle) +{ + return Control::DownCast( handle ); +} + +void RadioButton::SetLabel(const std::string& label) +{ + Dali::Toolkit::GetImplementation(*this).SetLabel(label); +} + +void RadioButton::SetLabel(Actor label) +{ + Dali::Toolkit::GetImplementation(*this).SetLabel(label); +} + +Actor RadioButton::GetLabel() const +{ + return Dali::Toolkit::GetImplementation(*this).GetLabel(); +} + +void RadioButton::SetActive(bool active) +{ + Dali::Toolkit::GetImplementation(*this).SetActive(active); +} + +bool RadioButton::IsActive()const +{ + return Dali::Toolkit::GetImplementation(*this).IsActive(); +} + +void RadioButton::ToggleState() +{ + Dali::Toolkit::GetImplementation(*this).ToggleState(); +} + +} // namespace Toolkit + +} // namespace Dali diff --git a/base/dali-toolkit/public-api/controls/buttons/radio-button.h b/base/dali-toolkit/public-api/controls/buttons/radio-button.h new file mode 100644 index 0000000..37f3860 --- /dev/null +++ b/base/dali-toolkit/public-api/controls/buttons/radio-button.h @@ -0,0 +1,186 @@ +#ifndef __DALI_TOOLKIT_RADIO_BUTTON_H__ +#define __DALI_TOOLKIT_RADIO_BUTTON_H__ + +/* + * 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. + * + */ + +// INTERNAL INCLUDES +#include "button.h" + +namespace Dali DALI_IMPORT_API +{ + +namespace Toolkit +{ + +// Forward declarations + +namespace Internal DALI_INTERNAL +{ +// Forward declarations + +class RadioButton; +} + +/** + * @brief A RadioButton provides a radio button which two states \e active or \e inactive. + * + * Radio buttons are designed to select one of many option at the same time. + * + * Every button have its own \e label and \e state, which can be modified by RadioButton::SetLabel and RadioBUtton::SetActive. + * + * RadioButton can change its current state using RadioButton::ToggleState. + * + * RadioButtons can be grouped. + * Two or more RadioButtons are in one group when they have this same parent. + * In each groups only one RadioButton can be \e active at a given time. + * So when RadioButton is set to \e active, other RadioButtons in its group are set to \e inactive. + * When \e active RadioButton is set to \e inactive no other RadioButtons in his group is set to \e active. + * + * A Button::ClickedSignal() is emitted when the RadioButton change its state to \e active or \e inactive. + */ +class RadioButton: public Button +{ + public: + + // Properties + static const Property::Index PROPERTY_ACTIVE; ///< name "active", @see SetActive(), type BOOLEAN + static const Property::Index PROPERTY_LABEL_ACTOR; ///< name "label-actor", @see SetLabel(), type MAP + + public: + /** + * @brief Create an uninitialized RadioButton; this can be initialized with RadioButton::New(). + * + * Calling member functions with an uninitialized Dali::Object is not allowed. + */ + RadioButton(); + + /** + * @brief Copy constructor. + */ + RadioButton(const RadioButton& radioButton); + + /** + * @brief Assignment operator. + */ + RadioButton& operator=(const RadioButton& radioButton); + + /** + * @brief Destructor + * + * This is non-virtual since derived Handle types must not contain data or virtual methods. + */ + ~RadioButton(); + + /** + * @brief Create an initialized RadioButton. + * + * @return A handle to a newly allocated Dali resource. + */ + static RadioButton New(); + + /** + * @brief Create an initialized RadioButton with given label. + * + * @param[in] label The button label. + * + * @return A handle to a newly allocated Dali resource. + */ + static RadioButton New(const std::string& label); + + /** + * @brief Create an initialized RadioButton with existing Actor. + * + * @param[in] label An Actor with the label. + * + * @return A handle to a newly allocated Dali resource. + */ + static RadioButton New(Actor label); + + /** + * @brief Downcast an Object handle to RadioButton. + * + * If handle points to a RadioButton the downcast produces valid + * handle. If not the returned handle is left uninitialized. + * + * @param[in] handle Handle to an object + * @return handle to a RadioButton or an uninitialized handle + */ + static RadioButton DownCast(BaseHandle handle); + + /** + * @brief Sets the button label. + * + * @param[in] label The button label. + */ + void SetLabel(const std::string& label); + + /** + * @brief Sets the button label using existing Actor. + * + * @param[in] label An Actor with the label. + */ + void SetLabel(Actor label); + + /** + * @brief Gets the label. + * + * @return An Actor with the label. + */ + Actor GetLabel() const; + + /** + * @brief Sets the button as active or inactive. + * + * @param[in] active property + */ + void SetActive(bool active); + + /** + * @return true if button is active, false if button is inactive. + */ + bool IsActive()const; + + /** + * @brief Change button state. + * + * If button is active deactivate it. If button is inactive activate it. + */ + void ToggleState(); + + public: // Not intended for application developers + + /** + * @brief Creates a handle using the Toolkit::Internal implementation. + * + * @param[in] implementation The Control implementation. + */ + RadioButton(Internal::RadioButton& implementation); + + /** + * @brief Allows the creation of this Control from an Internal::CustomActor pointer. + * + * @param[in] internal A pointer to the internal CustomActor. + */ + RadioButton(Dali::Internal::CustomActor* internal); +} ; + +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_RADIO_BUTTON_H__ diff --git a/base/dali-toolkit/public-api/file.list b/base/dali-toolkit/public-api/file.list index a5e5fea..e46991d 100755 --- a/base/dali-toolkit/public-api/file.list +++ b/base/dali-toolkit/public-api/file.list @@ -8,6 +8,7 @@ public_api_base_src_files = \ $(public_api_base_src_dir)/controls/buttons/button.cpp \ $(public_api_base_src_dir)/controls/buttons/check-box-button.cpp \ $(public_api_base_src_dir)/controls/buttons/push-button.cpp \ + $(public_api_base_src_dir)/controls/buttons/radio-button.cpp \ $(public_api_base_src_dir)/controls/default-controls/solid-color-actor.cpp \ $(public_api_base_src_dir)/controls/default-controls/check-button-factory.cpp \ $(public_api_base_src_dir)/controls/default-controls/push-button-factory.cpp \ @@ -69,7 +70,8 @@ public_api_base_alignment_header_files = \ public_api_base_buttons_header_files = \ $(public_api_base_src_dir)/controls/buttons/check-box-button.h \ $(public_api_base_src_dir)/controls/buttons/button.h \ - $(public_api_base_src_dir)/controls/buttons/push-button.h + $(public_api_base_src_dir)/controls/buttons/push-button.h \ + $(public_api_base_src_dir)/controls/buttons/radio-button.h public_api_base_default_controls_header_files = \ $(public_api_base_src_dir)/controls/default-controls/check-button-factory.h \ diff --git a/optional/dali-toolkit/dali-toolkit.h b/optional/dali-toolkit/dali-toolkit.h index ff72f77..2c838cd 100644 --- a/optional/dali-toolkit/dali-toolkit.h +++ b/optional/dali-toolkit/dali-toolkit.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include -- 2.7.4