1 #ifndef DALI_DEMO_BEAT_CONTROL_H
2 #define DALI_DEMO_BEAT_CONTROL_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>
27 // All type registered types need to have the same name for the body and the handle
29 } // namespace Internal
32 * Control that allows the RGB channels of an image to be altered.
34 class BeatControl : public Dali::Toolkit::Control
38 * The start and end property ranges for this control
42 PROPERTY_START_INDEX = Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
43 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000,
44 ANIMATABLE_PROPERTY_START_INDEX = Dali::ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
45 ANIMATABLE_PROPERTY_END_INDEX = ANIMATABLE_PROPERTY_START_INDEX + 1000
52 BOUNCE_TRANSITION = PROPERTY_START_INDEX,
60 public: // Construction / destruction
62 * Create an uninitialized handle
67 * Create a new image channel control without an image. Use
68 * SetImage to give this control an image
70 static BeatControl New();
73 * Create a new image channel control from a given URL
75 static BeatControl New(const std::string& url);
78 * Destructor. This is non-virtual since derived Handle types must not
79 * contain data or virtual methods
86 BeatControl(const BeatControl& beatControl);
91 BeatControl& operator=(const BeatControl& beatControl);
96 static BeatControl DownCast(BaseHandle handle);
99 void StartBounceAnimation();
101 void StartXAnimation();
103 void StartYAnimation();
105 void StartFadeAnimation();
107 public: // Not for public use
109 * Create a handle from an implementation
111 BeatControl(Internal::BeatControl& implementation);
114 * Allow the creation of an BeatControl handle from an internal CustomActor pointer
116 BeatControl(Dali::Internal::CustomActor* internal);
121 #endif // DALI_DEMO_BEAT_CONTROL_H