X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Fdummy-control.cpp;h=fcf6825ab898ae00aeed0992d59f37beb6ea7859;hp=df988c00e85cb95484843b6d9f757b803bd2f555;hb=e14d00568eab69d46e78db427d91e33513fd662b;hpb=fa6279fb2830427d5ab569ca14e6ade1557ef2fa diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp index df988c0..fcf6825 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp @@ -1,21 +1,25 @@ -// -// 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. + * + */ #include "dummy-control.h" +#include +#include + namespace Dali { @@ -23,14 +27,11 @@ namespace Toolkit { DummyControl::DummyControl() -: mCustomSlot1Called(false) { } DummyControl::DummyControl(const DummyControl& control) -: Control( control ), - mCustomSlot1Called(false), - mCustomSlot1Value(Vector3::ZERO) +: Control( control ) { } @@ -50,10 +51,9 @@ DummyControl& DummyControl::operator=(const DummyControl& control) } // Used to test signal connections -void DummyControl::CustomSlot1( Actor actor, const Vector3& value ) +void DummyControlImpl::CustomSlot1( Actor actor ) { mCustomSlot1Called = true; - mCustomSlot1Value = value; } DummyControl DummyControlImpl::New() @@ -65,14 +65,26 @@ DummyControl DummyControlImpl::New() } DummyControlImpl::DummyControlImpl() -: ControlImpl(true) +: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_HOVER_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ), + mCustomSlot1Called(false) { } + DummyControlImpl::~DummyControlImpl() { } +void DummyControlImpl::RegisterVisual( Property::Index index, Actor placementActor, Toolkit::Visual::Base visual ) +{ + Control::RegisterVisual( index, placementActor, visual ); +} + +void DummyControlImpl::UnregisterVisual( Property::Index index ) +{ + Control::UnregisterVisual( index ); +} + DummyControl DummyControlImplOverride::New() { IntrusivePtr< DummyControlImplOverride > impl = new DummyControlImplOverride; @@ -85,7 +97,11 @@ DummyControl DummyControlImplOverride::New() DummyControlImplOverride::DummyControlImplOverride() : DummyControlImpl(), initializeCalled(false), - styleChangeCalled(false), + activatedCalled(false), + onAccTouchedCalled(false), + onAccValueChangeCalled(false), + themeChangeCalled(false), + fontChangeCalled(false), pinchCalled(false), panCalled(false), tapCalled(false), @@ -97,7 +113,8 @@ DummyControlImplOverride::DummyControlImplOverride() sizeSetCalled(false), sizeAnimationCalled(false), touchEventCalled(false), - mouseWheelEventCalled(false), + hoverEventCalled(false), + wheelEventCalled(false), keyEventCalled(false), keyInputFocusGained(false), keyInputFocusLost(false) @@ -108,19 +125,31 @@ DummyControlImplOverride::~DummyControlImplOverride() { } void DummyControlImplOverride::OnInitialize() { initializeCalled = true; } -void DummyControlImplOverride::OnStyleChange(StyleChange change) { styleChangeCalled = true;} -void DummyControlImplOverride::OnPinch(PinchGesture pinch) { pinchCalled = true; } -void DummyControlImplOverride::OnPan(PanGesture pan) { panCalled = true; } -void DummyControlImplOverride::OnTap(TapGesture tap) { tapCalled = true; } -void DummyControlImplOverride::OnLongPress(LongPressGesture longPress) { longPressCalled = true; } -void DummyControlImplOverride::OnStageConnection() { stageConnectionCalled = true; } -void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; } +bool DummyControlImplOverride::OnAccessibilityActivated() { activatedCalled = true; return true; } +bool DummyControlImplOverride::OnAccessibilityTouch(const TouchEvent& touchEvent) { onAccTouchedCalled = true; return true; } +bool DummyControlImplOverride::OnAccessibilityValueChange( bool isIncrease ) +{ + onAccValueChangeCalled = true; return true; +} + +void DummyControlImplOverride::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change ) +{ + themeChangeCalled = change == StyleChange::THEME_CHANGE; + fontChangeCalled = change == StyleChange::DEFAULT_FONT_SIZE_CHANGE; +} +void DummyControlImplOverride::OnPinch(const PinchGesture& pinch) { pinchCalled = true; } +void DummyControlImplOverride::OnPan(const PanGesture& pan) { panCalled = true; } +void DummyControlImplOverride::OnTap(const TapGesture& tap) { tapCalled = true; } +void DummyControlImplOverride::OnLongPress(const LongPressGesture& longPress) { longPressCalled = true; } +void DummyControlImplOverride::OnStageConnection( int depth ) { Control::OnStageConnection( depth ); stageConnectionCalled = true; } +void DummyControlImplOverride::OnStageDisconnection() { stageDisconnectionCalled = true; Control::OnStageDisconnection(); } void DummyControlImplOverride::OnChildAdd(Actor& child) { childAddCalled = true; } void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled = true; } -void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { sizeSetCalled = true; } -void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { sizeAnimationCalled = true; } +void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { Control::OnSizeSet( targetSize ); sizeSetCalled = true; } +void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { Control::OnSizeAnimation( animation, targetSize ); sizeAnimationCalled = true; } bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; } -bool DummyControlImplOverride::OnMouseWheelEvent(const MouseWheelEvent& event) { mouseWheelEventCalled = true; return false; } +bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; } +bool DummyControlImplOverride::OnWheelEvent(const WheelEvent& event) { wheelEventCalled = true; return false; } bool DummyControlImplOverride::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;} void DummyControlImplOverride::OnKeyInputFocusGained() { keyInputFocusGained = true; } void DummyControlImplOverride::OnKeyInputFocusLost() { keyInputFocusLost = true; } @@ -142,16 +171,12 @@ DummyControl DummyControl::New( bool override ) } DummyControl::DummyControl( DummyControlImpl& implementation ) -: Control( implementation ), - mCustomSlot1Called(false), - mCustomSlot1Value(Vector3::ZERO) +: Control( implementation ) { } DummyControl::DummyControl( Dali::Internal::CustomActor* internal ) -: Control( internal ), - mCustomSlot1Called(false), - mCustomSlot1Value(Vector3::ZERO) +: Control( internal ) { VerifyCustomActorPointer(internal); }