1 #ifndef DALI_TOOLKIT_TEST_TEST_BUTTON_H
2 #define DALI_TOOLKIT_TEST_TEST_BUTTON_H
5 * Copyright (c) 2016 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>
21 #include <test-animation-data.h>
30 class TestButton : public Dali::Toolkit::Control
35 PROPERTY_START_INDEX = Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX + 1,
36 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000
42 PRESS_TRANSITION = PROPERTY_START_INDEX,
51 TestButton(const TestButton& button);
52 TestButton(Impl::TestButton& impl);
53 TestButton(Dali::Internal::CustomActor* internal);
54 TestButton& operator=( const TestButton& button);
56 static TestButton New();
57 static TestButton DownCast( Dali::BaseHandle handle );
63 class TestButton : public Dali::Toolkit::Internal::Control
66 static Test::TestButton New();
68 static void SetProperty( Dali::BaseObject* object,
69 Dali::Property::Index index,
70 const Dali::Property::Value& value );
72 static Dali::Property::Value GetProperty( Dali::BaseObject* object,
73 Dali::Property::Index propertyIndex );
77 ~TestButton() override;
80 Test::TestAnimationData mPressTransitionData;
81 Test::TestAnimationData mReleaseTransitionData;
82 Test::TestAnimationData mDisabledTransitionData;
83 Test::TestAnimationData mEnabledTransitionData;
84 Dali::Vector4 mBackgroundColor;
85 Dali::Vector4 mForegroundColor;
88 inline TestButton& GetImpl( Test::TestButton& handle )
90 DALI_ASSERT_ALWAYS( handle );
91 Dali::RefObject& object = handle.GetImplementation();
92 return static_cast<TestButton&>( object );
95 inline const TestButton& GetImpl( const Test::TestButton& handle )
97 DALI_ASSERT_ALWAYS( handle );
98 const Dali::RefObject& object = handle.GetImplementation();
99 return static_cast<const TestButton&>( object );
107 #endif // DALI_TOOLKIT_TEST_TEST_BUTTON_H