1 #ifndef DALI_DEMO_SHADOW_BUTTON_H
2 #define DALI_DEMO_SHADOW_BUTTON_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 #include <dali-toolkit/dali-toolkit.h>
25 // All type registered controls need to have the same name for the body
33 * Button that allows the RGB channels of an image to be altered.
35 class ShadowButton : public Dali::Toolkit::Control
39 * The start and end property ranges for this Control
43 PROPERTY_START_INDEX = Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
44 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000,
45 ANIMATABLE_PROPERTY_START_INDEX = Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
46 ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_START_INDEX + 1000
53 ACTIVE_TRANSITION = PROPERTY_START_INDEX,
66 public: // Construction / destruction
68 * Create an uninitialized handle
73 * Create a new image channel button without an image. Use
74 * SetImage to give this button an image
76 static ShadowButton New();
79 * Create a new image channel button from a given URL
81 static ShadowButton New(const std::string& url);
84 * Destructor. This is non-virtual since derived Handle types must not
85 * contain data or virtual methods
92 ShadowButton(const ShadowButton& shadowButton);
97 ShadowButton& operator=(const ShadowButton& shadowButton);
102 static ShadowButton DownCast(BaseHandle handle);
106 * @brief Set the button to be active or inactive.
108 * The button will perform a transition if there is a state change.
109 * @param[in] active The active state
111 void SetActiveState(bool active);
114 * @brief Get the button's active state
116 * @return The active state
118 bool GetActiveState();
121 * Set the check state
122 * @param[in] checkState The state of the checkbox
124 void SetCheckState(bool checkState);
127 * Get the check state
128 * @return the check state
130 bool GetCheckState();
132 public: // Not for public use
134 * Create a handle from an implementation
136 ShadowButton(Internal::ShadowButton& implementation);
139 * Allow the creation of an ShadowButton handle from an internal CustomActor pointer
141 ShadowButton(Dali::Internal::CustomActor* internal);
146 #endif // DALI_DEMO_SHADOW_BUTTON_H