2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
22 #include <dali/integration-api/debug.h>
23 #include <dali/public-api/actors/actor.h>
24 #include <dali/public-api/adaptor-framework/timer.h>
25 #include <dali/public-api/actors/image-actor.h>
26 #include <dali/public-api/actors/layer.h>
27 #include <dali/devel-api/actors/mesh-actor.h>
28 #include <dali/public-api/animation/constraint.h>
29 #include <dali/public-api/common/constants.h>
30 #include <dali/public-api/common/stage.h>
31 #include <dali/public-api/events/tap-gesture.h>
32 #include <dali/public-api/events/tap-gesture-detector.h>
33 #include <dali/public-api/events/touch-event.h>
34 #include <dali/public-api/events/pan-gesture.h>
35 #include <dali/public-api/events/pan-gesture-detector.h>
36 #include <dali/devel-api/geometry/mesh.h>
37 #include <dali/devel-api/geometry/mesh-data.h>
38 #include <dali/public-api/images/resource-image.h>
39 #include <dali/public-api/math/rect.h>
40 #include <dali/public-api/math/vector2.h>
41 #include <dali/public-api/math/vector4.h>
42 #include <dali/public-api/object/property-notification.h>
43 #include <dali/public-api/signals/connection-tracker.h>
46 #include <dali-toolkit/public-api/controls/control.h>
47 #include <dali-toolkit/public-api/controls/control-impl.h>
48 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
49 #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
50 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
51 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
54 #define DECORATOR_DEBUG
64 #ifdef DECORATOR_DEBUG
65 Integration::Log::Filter* gLogFilter( Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_TEXT_DECORATOR") );
76 const char* DEFAULT_GRAB_HANDLE_IMAGE_RELEASED( DALI_IMAGE_DIR "insertpoint-icon.png" );
77 const char* DEFAULT_GRAB_HANDLE_IMAGE_PRESSED( DALI_IMAGE_DIR "insertpoint-icon-pressed.png" );
78 const char* DEFAULT_SELECTION_HANDLE_ONE_RELEASED( DALI_IMAGE_DIR "text-input-selection-handle-left.png" );
79 const char* DEFAULT_SELECTION_HANDLE_ONE_PRESSED( DALI_IMAGE_DIR "text-input-selection-handle-left-press.png" );
80 const char* DEFAULT_SELECTION_HANDLE_TWO_RELEASED( DALI_IMAGE_DIR "text-input-selection-handle-right.png" );
81 const char* DEFAULT_SELECTION_HANDLE_TWO_PRESSED( DALI_IMAGE_DIR "text-input-selection-handle-right-press.png" );
83 const Dali::Vector3 DEFAULT_GRAB_HANDLE_RELATIVE_SIZE( 1.5f, 2.0f, 1.0f );
84 const Dali::Vector3 DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE( 1.5f, 1.5f, 1.0f );
86 const Dali::Vector4 LIGHT_BLUE( (0xb2 / 255.0f), (0xeb / 255.0f), (0xf2 / 255.0f), 0.5f ); // The text highlight color.
88 const unsigned int CURSOR_BLINK_INTERVAL = 500u; // Cursor blink interval
89 const float TO_MILLISECONDS = 1000.f;
90 const float TO_SECONDS = 1.f / TO_MILLISECONDS;
92 const float DISPLAYED_HIGHLIGHT_Z_OFFSET( -0.05f );
94 const unsigned int SCROLL_TICK_INTERVAL = 50u;
96 const float SCROLL_THRESHOLD = 10.f;
97 const float SCROLL_SPEED = 300.f;
98 const float SCROLL_DISTANCE = SCROLL_SPEED * SCROLL_TICK_INTERVAL * TO_SECONDS;
101 * structure to hold coordinates of each quad, which will make up the mesh.
103 struct QuadCoordinates
106 * Default constructor
114 * @param[in] x1 left co-ordinate
115 * @param[in] y1 top co-ordinate
116 * @param[in] x2 right co-ordinate
117 * @param[in] y2 bottom co-ordinate
119 QuadCoordinates(float x1, float y1, float x2, float y2)
125 Dali::Vector2 min; ///< top-left (minimum) position of quad
126 Dali::Vector2 max; ///< bottom-right (maximum) position of quad
129 typedef std::vector<QuadCoordinates> QuadContainer;
132 * @brief Takes a bounding rectangle in the local coordinates of an actor and returns the world coordinates Bounding Box.
133 * @param[in] boundingRectangle local bounding
134 * @param[out] Vector4 World coordinate bounding Box.
136 void LocalToWorldCoordinatesBoundingBox( const Dali::Rect<int>& boundingRectangle, Dali::Vector4& boundingBox )
138 // Convert to world coordinates and store as a Vector4 to be compatible with Property Notifications.
139 Dali::Vector2 stageSize = Dali::Stage::GetCurrent().GetSize();
141 const float originX = boundingRectangle.x - 0.5f * stageSize.width;
142 const float originY = boundingRectangle.y - 0.5f * stageSize.height;
144 boundingBox = Dali::Vector4( originX,
146 originX + boundingRectangle.width,
147 originY + boundingRectangle.height );
151 } // end of namespace
162 struct Decorator::Impl : public ConnectionTracker
176 : color( Dali::Color::BLACK ),
178 cursorHeight( 0.0f ),
194 grabDisplacementX( 0.f ),
195 grabDisplacementY( 0.f ),
207 float lineHeight; ///< Not the handle height
208 float grabDisplacementX;
209 float grabDisplacementY;
216 Impl( ControllerInterface& controller )
217 : mController( controller ),
218 mEnabledPopupButtons( TextSelectionPopup::NONE ),
219 mBoundingBox( Rect<int>() ),
220 mHighlightColor( LIGHT_BLUE ),
221 mActiveCursor( ACTIVE_CURSOR_NONE ),
222 mCursorBlinkInterval( CURSOR_BLINK_INTERVAL ),
223 mCursorBlinkDuration( 0.0f ),
224 mHandleScrolling( HANDLE_TYPE_COUNT ),
225 mScrollDirection( SCROLL_NONE ),
226 mScrollThreshold( SCROLL_THRESHOLD ),
227 mScrollSpeed( SCROLL_SPEED ),
228 mScrollDistance( SCROLL_DISTANCE ),
229 mActiveCopyPastePopup( false ),
230 mCursorBlinkStatus( true ),
231 mPrimaryCursorVisible( false ),
232 mSecondaryCursorVisible( false ),
233 mSwapSelectionHandles( false )
238 * Relayout of the decorations owned by the decorator.
239 * @param[in] size The Size of the UI control the decorator is adding it's decorations to.
241 void Relayout( const Vector2& size )
243 // TODO - Remove this if nothing is active
246 // Show or hide the cursors
250 const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
251 mPrimaryCursorVisible = ( cursor.position.x <= size.width ) && ( cursor.position.x >= 0.f );
252 if( mPrimaryCursorVisible )
254 Vector2 position = cursor.position;
255 if( GRAB_HANDLE == mHandleScrolling )
257 if( mScrollDirection == SCROLL_RIGHT )
263 position.x = size.width;
267 mPrimaryCursor.SetPosition( position.x,
269 mPrimaryCursor.SetSize( Size( 1.0f, cursor.cursorHeight ) );
271 mPrimaryCursor.SetVisible( mPrimaryCursorVisible );
273 if( mSecondaryCursor )
275 const CursorImpl& cursor = mCursor[SECONDARY_CURSOR];
276 mSecondaryCursorVisible = ( cursor.position.x <= size.width ) && ( cursor.position.x >= 0.f );
277 if( mSecondaryCursorVisible )
279 mSecondaryCursor.SetPosition( cursor.position.x,
281 mSecondaryCursor.SetSize( Size( 1.0f, cursor.cursorHeight ) );
283 mSecondaryCursor.SetVisible( mSecondaryCursorVisible );
286 // Show or hide the grab handle
287 HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
288 if( grabHandle.active )
290 Vector2 position = grabHandle.position;
292 if( GRAB_HANDLE == mHandleScrolling )
294 if( mScrollDirection == SCROLL_RIGHT )
300 position.x = size.width;
304 const bool isVisible = ( position.x <= size.width ) && ( position.x >= 0.f );
312 grabHandle.actor.SetPosition( position.x,
313 position.y + grabHandle.lineHeight );
315 grabHandle.actor.SetVisible( isVisible );
317 else if( grabHandle.actor )
319 UnparentAndReset( grabHandle.actor );
322 // Show or hide the selection handles/highlight
323 HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
324 HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
325 if( primary.active || secondary.active )
327 Vector2 primaryPosition = primary.position;
328 Vector2 secondaryPosition = secondary.position;
330 if( LEFT_SELECTION_HANDLE == mHandleScrolling )
332 if( mScrollDirection == SCROLL_RIGHT )
334 primaryPosition.x = 0.f;
338 primaryPosition.x = size.width;
341 else if( RIGHT_SELECTION_HANDLE == mHandleScrolling )
343 if( mScrollDirection == SCROLL_RIGHT )
345 secondaryPosition.x = 0.f;
349 secondaryPosition.x = size.width;
353 const bool isPrimaryVisible = ( primaryPosition.x <= size.width ) && ( primaryPosition.x >= 0.f );
354 const bool isSecondaryVisible = ( secondaryPosition.x <= size.width ) && ( secondaryPosition.x >= 0.f );
356 if( isPrimaryVisible || isSecondaryVisible )
360 CreateSelectionHandles();
362 if( isPrimaryVisible )
364 primary.actor.SetPosition( primaryPosition.x,
365 primaryPosition.y + primary.lineHeight );
368 if( isSecondaryVisible )
370 secondary.actor.SetPosition( secondaryPosition.x,
371 secondaryPosition.y + secondary.lineHeight );
374 primary.actor.SetVisible( isPrimaryVisible );
375 secondary.actor.SetVisible( isSecondaryVisible );
382 UnparentAndReset( primary.actor );
383 UnparentAndReset( secondary.actor );
384 UnparentAndReset( mHighlightMeshActor );
387 if ( mActiveCopyPastePopup )
389 if ( !mCopyPastePopup )
391 mCopyPastePopup = TextSelectionPopup::New( mEnabledPopupButtons );
392 #ifdef DECORATOR_DEBUG
393 mCopyPastePopup.SetName("mCopyPastePopup");
395 mCopyPastePopup.SetAnchorPoint( AnchorPoint::CENTER );
396 mCopyPastePopup.OnRelayoutSignal().Connect( this, &Decorator::Impl::PopUpRelayoutComplete ); // Position popup after size negotiation
397 mActiveLayer.Add ( mCopyPastePopup );
402 if ( mCopyPastePopup )
404 UnparentAndReset( mCopyPastePopup );
409 void UpdatePositions( const Vector2& scrollOffset )
411 mCursor[PRIMARY_CURSOR].position += scrollOffset;
412 mCursor[SECONDARY_CURSOR].position += scrollOffset;
413 mHandle[ GRAB_HANDLE ].position += scrollOffset;
414 mHandle[ LEFT_SELECTION_HANDLE ].position += scrollOffset;
415 mHandle[ RIGHT_SELECTION_HANDLE ].position += scrollOffset;
416 mHighlightPosition += scrollOffset;
419 void PopUpRelayoutComplete( Actor actor )
421 // Size negotiation for CopyPastePopup complete so can get the size and constrain position within bounding box.
423 mCopyPastePopup.OnRelayoutSignal().Disconnect( this, &Decorator::Impl::PopUpRelayoutComplete );
425 Vector3 popupPosition( mCursor[PRIMARY_CURSOR].position.x, mCursor[PRIMARY_CURSOR].position.y -100.0f , 0.0f); //todo 100 to be an offset Property
427 Vector3 popupSize = Vector3( mCopyPastePopup.GetRelayoutSize( Dimension::WIDTH ), mCopyPastePopup.GetRelayoutSize( Dimension::HEIGHT ), 0.0f );
429 GetConstrainedPopupPosition( popupPosition, popupSize, AnchorPoint::CENTER, mActiveLayer, mBoundingBox );
431 SetUpPopUpPositionNotifications();
433 mCopyPastePopup.SetPosition( popupPosition ); //todo grabhandle(cursor) or selection handle positions to be used
436 void CreateCursor( ImageActor& cursor, const Vector4& color )
438 cursor = CreateSolidColorActor( color );
439 cursor.SetParentOrigin( ParentOrigin::TOP_LEFT ); // Need to set the default parent origin as CreateSolidColorActor() sets a different one.
440 cursor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
443 // Add or Remove cursor(s) from parent
446 if( mActiveCursor == ACTIVE_CURSOR_NONE )
448 UnparentAndReset( mPrimaryCursor );
449 UnparentAndReset( mSecondaryCursor );
453 /* Create Primary and or Secondary Cursor(s) if active and add to parent */
454 if ( mActiveCursor == ACTIVE_CURSOR_PRIMARY ||
455 mActiveCursor == ACTIVE_CURSOR_BOTH )
457 if ( !mPrimaryCursor )
459 CreateCursor( mPrimaryCursor, mCursor[PRIMARY_CURSOR].color );
460 #ifdef DECORATOR_DEBUG
461 mPrimaryCursor.SetName( "PrimaryCursorActor" );
463 mActiveLayer.Add( mPrimaryCursor );
467 if ( mActiveCursor == ACTIVE_CURSOR_BOTH )
469 if ( !mSecondaryCursor )
471 CreateCursor( mSecondaryCursor, mCursor[SECONDARY_CURSOR].color );
472 #ifdef DECORATOR_DEBUG
473 mSecondaryCursor.SetName( "SecondaryCursorActor" );
475 mActiveLayer.Add( mSecondaryCursor );
480 UnparentAndReset( mSecondaryCursor );
485 bool OnCursorBlinkTimerTick()
488 if ( mPrimaryCursor )
490 mPrimaryCursor.SetVisible( mPrimaryCursorVisible && mCursorBlinkStatus );
492 if ( mSecondaryCursor )
494 mSecondaryCursor.SetVisible( mSecondaryCursorVisible && mCursorBlinkStatus );
497 mCursorBlinkStatus = !mCursorBlinkStatus;
502 void SetupTouchEvents()
506 mTapDetector = TapGestureDetector::New();
507 mTapDetector.DetectedSignal().Connect( this, &Decorator::Impl::OnTap );
510 if ( !mPanGestureDetector )
512 mPanGestureDetector = PanGestureDetector::New();
513 mPanGestureDetector.DetectedSignal().Connect( this, &Decorator::Impl::OnPan );
517 void CreateActiveLayer()
521 mActiveLayer = Layer::New();
522 #ifdef DECORATOR_DEBUG
523 mActiveLayer.SetName ( "ActiveLayerActor" );
526 mActiveLayer.SetParentOrigin( ParentOrigin::CENTER );
527 mActiveLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
528 mActiveLayer.SetPositionInheritanceMode( USE_PARENT_POSITION );
530 // Add the active layer telling the controller it doesn't need clipping.
531 mController.AddDecoration( mActiveLayer, false );
534 mActiveLayer.RaiseToTop();
537 void CreateGrabHandle()
539 HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
540 if( !grabHandle.actor )
542 if( !mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] )
544 mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] = ResourceImage::New( DEFAULT_GRAB_HANDLE_IMAGE_RELEASED );
546 if( !mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED] )
548 mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED] = ResourceImage::New( DEFAULT_GRAB_HANDLE_IMAGE_PRESSED );
551 grabHandle.actor = ImageActor::New( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
552 grabHandle.actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
553 grabHandle.actor.SetDrawMode( DrawMode::OVERLAY );
554 // Area that Grab handle responds to, larger than actual handle so easier to move
555 #ifdef DECORATOR_DEBUG
556 grabHandle.actor.SetName( "GrabHandleActor" );
557 if ( Dali::Internal::gLogFilter->IsEnabledFor( Debug::Verbose ) )
559 grabHandle.grabArea = Toolkit::CreateSolidColorActor( Vector4(0.0f, 0.0f, 0.0f, 0.0f), true, Color::RED, 1 );
560 grabHandle.grabArea.SetName( "GrabArea" );
564 grabHandle.grabArea = Actor::New();
565 grabHandle.grabArea.SetName( "GrabArea" );
568 grabHandle.grabArea = Actor::New();
571 grabHandle.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
572 grabHandle.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
573 grabHandle.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
574 grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
575 grabHandle.actor.Add( grabHandle.grabArea );
577 grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
578 mTapDetector.Attach( grabHandle.grabArea );
579 mPanGestureDetector.Attach( grabHandle.grabArea );
581 mActiveLayer.Add( grabHandle.actor );
585 void CreateSelectionHandles()
587 HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
590 if( !mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
592 mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE_RELEASED );
594 if( !mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_PRESSED] )
596 mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_PRESSED] = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE_PRESSED );
599 primary.actor = ImageActor::New( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
600 #ifdef DECORATOR_DEBUG
601 primary.actor.SetName("SelectionHandleOne");
603 primary.actor.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); // Change to BOTTOM_RIGHT if Look'n'Feel requires handle above text.
604 primary.actor.SetDrawMode( DrawMode::OVERLAY ); // ensure grab handle above text
605 primary.flipped = false;
607 primary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
608 #ifdef DECORATOR_DEBUG
609 primary.grabArea.SetName("SelectionHandleOneGrabArea");
611 primary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
612 primary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
613 primary.grabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
615 mTapDetector.Attach( primary.grabArea );
616 mPanGestureDetector.Attach( primary.grabArea );
617 primary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleOneTouched );
619 primary.actor.Add( primary.grabArea );
620 mActiveLayer.Add( primary.actor );
623 HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
624 if( !secondary.actor )
626 if( !mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
628 mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO_RELEASED );
630 if( !mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_PRESSED] )
632 mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_PRESSED] = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO_PRESSED );
635 secondary.actor = ImageActor::New( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
636 #ifdef DECORATOR_DEBUG
637 secondary.actor.SetName("SelectionHandleTwo");
639 secondary.actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); // Change to BOTTOM_LEFT if Look'n'Feel requires handle above text.
640 secondary.actor.SetDrawMode( DrawMode::OVERLAY ); // ensure grab handle above text
641 secondary.flipped = false;
643 secondary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
644 #ifdef DECORATOR_DEBUG
645 secondary.grabArea.SetName("SelectionHandleTwoGrabArea");
647 secondary.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
648 secondary.grabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
649 secondary.grabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
651 mTapDetector.Attach( secondary.grabArea );
652 mPanGestureDetector.Attach( secondary.grabArea );
653 secondary.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnHandleTwoTouched );
655 secondary.actor.Add( secondary.grabArea );
656 mActiveLayer.Add( secondary.actor );
660 void CreateHighlight()
662 if ( !mHighlightMeshActor )
664 mHighlightMaterial = Material::New( "HighlightMaterial" );
665 mHighlightMaterial.SetDiffuseColor( mHighlightColor );
667 mHighlightMeshData.SetMaterial( mHighlightMaterial );
668 mHighlightMeshData.SetHasNormals( true );
670 mHighlightMesh = Mesh::New( mHighlightMeshData );
672 mHighlightMeshActor = MeshActor::New( mHighlightMesh );
673 #ifdef DECORATOR_DEBUG
674 mHighlightMeshActor.SetName( "HighlightMeshActor" );
676 mHighlightMeshActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
678 // Add the highlight box telling the controller it needs clipping.
679 mController.AddDecoration( mHighlightMeshActor, true );
682 mHighlightMeshActor.SetPosition( mHighlightPosition.x, mHighlightPosition.y, DISPLAYED_HIGHLIGHT_Z_OFFSET );
685 void UpdateHighlight()
687 // Construct a Mesh with a texture to be used as the highlight 'box' for selected text
689 // Example scenarios where mesh is made from 3, 1, 2, 2 ,3 or 3 quads.
691 // [ TOP ] [ TOP ] [TOP ] [ TOP ] [ TOP ] [ TOP ]
692 // [ MIDDLE ] [BOTTOM] [BOTTOM] [ MIDDLE ] [ MIDDLE ]
693 // [ BOTTOM] [ MIDDLE ] [ MIDDLE ]
694 // [BOTTOM] [ MIDDLE ]
697 // Each quad is created as 2 triangles.
698 // Middle is just 1 quad regardless of its size.
712 if ( mHighlightMesh && mHighlightMaterial && !mHighlightQuadList.empty() )
714 MeshData::VertexContainer vertices;
715 Dali::MeshData::FaceIndices faceIndices;
717 std::vector<QuadCoordinates>::iterator iter = mHighlightQuadList.begin();
718 std::vector<QuadCoordinates>::iterator endIter = mHighlightQuadList.end();
720 // vertex position defaults to (0 0 0)
721 MeshData::Vertex vertex;
722 // set normal for all vertices as (0 0 1) pointing outward from TextInput Actor.
725 for(std::size_t v = 0; iter != endIter; ++iter,v+=4 )
727 // Add each quad geometry (a sub-selection) to the mesh data.
737 QuadCoordinates& quad = *iter;
739 vertex.x = quad.min.x;
740 vertex.y = quad.min.y;
741 vertices.push_back( vertex );
744 vertex.x = quad.max.x;
745 vertex.y = quad.min.y;
746 vertices.push_back( vertex );
749 vertex.x = quad.min.x;
750 vertex.y = quad.max.y;
751 vertices.push_back( vertex );
753 // bottom-right (v+3)
754 vertex.x = quad.max.x;
755 vertex.y = quad.max.y;
756 vertices.push_back( vertex );
758 // triangle A (3, 1, 0)
759 faceIndices.push_back( v + 3 );
760 faceIndices.push_back( v + 1 );
761 faceIndices.push_back( v );
763 // triangle B (0, 2, 3)
764 faceIndices.push_back( v );
765 faceIndices.push_back( v + 2 );
766 faceIndices.push_back( v + 3 );
768 mHighlightMeshData.SetFaceIndices( faceIndices );
771 BoneContainer bones(0); // passed empty as bones not required
772 mHighlightMeshData.SetData( vertices, faceIndices, bones, mHighlightMaterial );
773 mHighlightMesh.UpdateMeshData( mHighlightMeshData );
777 void OnTap( Actor actor, const TapGesture& tap )
779 if( actor == mHandle[GRAB_HANDLE].actor )
785 void DoPan( HandleImpl& handle, HandleType type, const PanGesture& gesture )
787 if( Gesture::Started == gesture.state )
789 handle.grabDisplacementX = handle.grabDisplacementY = 0;
792 handle.grabDisplacementX += gesture.displacement.x;
793 handle.grabDisplacementY += gesture.displacement.y;
795 const float x = handle.position.x + handle.grabDisplacementX;
796 const float y = handle.position.y + handle.lineHeight*0.5f + handle.grabDisplacementY;
798 if( Gesture::Started == gesture.state ||
799 Gesture::Continuing == gesture.state )
802 mController.GetTargetSize( targetSize );
804 if( x < mScrollThreshold )
806 mScrollDirection = SCROLL_RIGHT;
807 mHandleScrolling = type;
810 else if( x > targetSize.width - mScrollThreshold )
812 mScrollDirection = SCROLL_LEFT;
813 mHandleScrolling = type;
818 mHandleScrolling = HANDLE_TYPE_COUNT;
820 mController.DecorationEvent( type, HANDLE_PRESSED, x, y );
823 else if( Gesture::Finished == gesture.state ||
824 Gesture::Cancelled == gesture.state )
826 if( mScrollTimer && mScrollTimer.IsRunning() )
828 mHandleScrolling = HANDLE_TYPE_COUNT;
830 mController.DecorationEvent( type, HANDLE_STOP_SCROLLING, x, y );
834 mController.DecorationEvent( type, HANDLE_RELEASED, x, y );
837 if( GRAB_HANDLE == type )
839 handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_RELEASED] );
843 HandleType selectionHandleType = type;
845 if( mSwapSelectionHandles != handle.flipped )
847 selectionHandleType = ( LEFT_SELECTION_HANDLE == type ) ? RIGHT_SELECTION_HANDLE : LEFT_SELECTION_HANDLE;
850 handle.actor.SetImage( mHandleImages[selectionHandleType][HANDLE_IMAGE_RELEASED] );
852 handle.pressed = false;
856 void OnPan( Actor actor, const PanGesture& gesture )
858 HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
859 HandleImpl& primarySelectionHandle = mHandle[LEFT_SELECTION_HANDLE];
860 HandleImpl& secondarySelectionHandle = mHandle[RIGHT_SELECTION_HANDLE];
862 if( actor == grabHandle.grabArea )
864 DoPan( grabHandle, GRAB_HANDLE, gesture );
866 else if( actor == primarySelectionHandle.grabArea )
868 DoPan( primarySelectionHandle, LEFT_SELECTION_HANDLE, gesture );
870 else if( actor == secondarySelectionHandle.grabArea )
872 DoPan( secondarySelectionHandle, RIGHT_SELECTION_HANDLE, gesture );
876 bool OnGrabHandleTouched( Actor actor, const TouchEvent& event )
878 // Switch between pressed/release grab-handle images
879 if( event.GetPointCount() > 0 &&
880 mHandle[GRAB_HANDLE].actor )
882 const TouchPoint& point = event.GetPoint(0);
884 if( TouchPoint::Down == point.state )
886 mHandle[GRAB_HANDLE].pressed = true;
887 Image imagePressed = mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED];
890 mHandle[GRAB_HANDLE].actor.SetImage( imagePressed );
893 else if( TouchPoint::Up == point.state )
895 mHandle[GRAB_HANDLE].pressed = false;
896 Image imageReleased = mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED];
899 mHandle[GRAB_HANDLE].actor.SetImage( imageReleased );
904 // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
908 bool OnHandleOneTouched( Actor actor, const TouchEvent& event )
910 // Switch between pressed/release selection handle images
911 if( event.GetPointCount() > 0 &&
912 mHandle[LEFT_SELECTION_HANDLE].actor )
914 const TouchPoint& point = event.GetPoint(0);
916 const bool flip = mSwapSelectionHandles != mHandle[LEFT_SELECTION_HANDLE].flipped;
917 if( TouchPoint::Down == point.state )
919 mHandle[LEFT_SELECTION_HANDLE].pressed = true;
920 Image imagePressed = mHandleImages[flip ? RIGHT_SELECTION_HANDLE : LEFT_SELECTION_HANDLE][HANDLE_IMAGE_PRESSED];
923 mHandle[LEFT_SELECTION_HANDLE].actor.SetImage( imagePressed );
926 else if( TouchPoint::Up == point.state )
928 mHandle[LEFT_SELECTION_HANDLE].pressed = false;
929 Image imageReleased = mHandleImages[flip ? RIGHT_SELECTION_HANDLE : LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED];
932 mHandle[LEFT_SELECTION_HANDLE].actor.SetImage( imageReleased );
937 // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
941 bool OnHandleTwoTouched( Actor actor, const TouchEvent& event )
943 // Switch between pressed/release selection handle images
944 if( event.GetPointCount() > 0 &&
945 mHandle[RIGHT_SELECTION_HANDLE].actor )
947 const TouchPoint& point = event.GetPoint(0);
949 const bool flip = mSwapSelectionHandles != mHandle[RIGHT_SELECTION_HANDLE].flipped;
950 if( TouchPoint::Down == point.state )
952 Image imagePressed = mHandleImages[flip ? LEFT_SELECTION_HANDLE : RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_PRESSED];
953 mHandle[RIGHT_SELECTION_HANDLE].pressed = true;
956 mHandle[RIGHT_SELECTION_HANDLE].actor.SetImage( imagePressed );
959 else if( TouchPoint::Up == point.state )
961 Image imageReleased = mHandleImages[flip ? LEFT_SELECTION_HANDLE : RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED];
962 mHandle[RIGHT_SELECTION_HANDLE].pressed = false;
965 mHandle[RIGHT_SELECTION_HANDLE].actor.SetImage( imageReleased );
970 // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
976 float AlternatePopUpPositionRelativeToCursor()
978 float alternativePosition=0.0f;;
980 if ( mPrimaryCursor ) // Secondary cursor not used for paste
982 Cursor cursor = PRIMARY_CURSOR;
983 alternativePosition = mCursor[cursor].position.y;
986 const float popupHeight = 120.0f; // todo Set as a MaxSize Property in Control or retrieve from CopyPastePopup class.
988 if( mHandle[GRAB_HANDLE].active )
990 // If grab handle enabled then position pop-up below the grab handle.
991 const Vector2 grabHandleSize( 59.0f, 56.0f ); // todo
992 const float BOTTOM_HANDLE_BOTTOM_OFFSET = 1.5; //todo Should be a property
993 alternativePosition += grabHandleSize.height + popupHeight + BOTTOM_HANDLE_BOTTOM_OFFSET ;
997 alternativePosition += popupHeight;
1000 return alternativePosition;
1003 void PopUpLeavesVerticalBoundary( PropertyNotification& source )
1005 float alternativeYPosition=0.0f;
1006 // todo use AlternatePopUpPositionRelativeToSelectionHandles() if text is highlighted
1007 // if can't be positioned above, then position below row.
1008 alternativeYPosition = AlternatePopUpPositionRelativeToCursor();
1010 mCopyPastePopup.SetY( alternativeYPosition );
1014 void SetUpPopUpPositionNotifications( )
1016 // Note Property notifications ignore any set anchor point so conditions must allow for this. Default is Top Left.
1018 // Exceeding vertical boundary
1020 Vector4 worldCoordinatesBoundingBox;
1021 LocalToWorldCoordinatesBoundingBox( mBoundingBox, worldCoordinatesBoundingBox );
1023 float popupHeight = mCopyPastePopup.GetRelayoutSize( Dimension::HEIGHT);
1025 PropertyNotification verticalExceedNotification = mCopyPastePopup.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
1026 OutsideCondition( worldCoordinatesBoundingBox.y + popupHeight/2,
1027 worldCoordinatesBoundingBox.w - popupHeight/2 ) );
1029 verticalExceedNotification.NotifySignal().Connect( this, &Decorator::Impl::PopUpLeavesVerticalBoundary );
1032 void GetConstrainedPopupPosition( Vector3& requiredPopupPosition, Vector3& popupSize, Vector3 anchorPoint, Actor& parent, Rect<int>& boundingBox )
1034 DALI_ASSERT_DEBUG ( "Popup parent not on stage" && parent.OnStage() )
1036 // Parent must already by added to Stage for these Get calls to work
1037 Vector3 parentAnchorPoint = parent.GetCurrentAnchorPoint();
1038 Vector3 parentWorldPositionLeftAnchor = parent.GetCurrentWorldPosition() - parent.GetCurrentSize()*parentAnchorPoint;
1039 Vector3 popupWorldPosition = parentWorldPositionLeftAnchor + requiredPopupPosition; // Parent World position plus popup local position gives World Position
1040 Vector3 popupDistanceFromAnchorPoint = popupSize*anchorPoint;
1042 // Bounding rectangle is supplied as screen coordinates, bounding will be done in world coordinates.
1043 Vector4 boundingRectangleWorld;
1044 LocalToWorldCoordinatesBoundingBox( boundingBox, boundingRectangleWorld );
1046 // Calculate distance to move popup (in local space) so fits within the boundary
1047 float xOffSetToKeepWithinBounds = 0.0f;
1048 if( popupWorldPosition.x - popupDistanceFromAnchorPoint.x < boundingRectangleWorld.x )
1050 xOffSetToKeepWithinBounds = boundingRectangleWorld.x - ( popupWorldPosition.x - popupDistanceFromAnchorPoint.x );
1052 else if ( popupWorldPosition.x + popupDistanceFromAnchorPoint.x > boundingRectangleWorld.z )
1054 xOffSetToKeepWithinBounds = boundingRectangleWorld.z - ( popupWorldPosition.x + popupDistanceFromAnchorPoint.x );
1057 // Ensure initial display of Popup is in alternative position if can not fit above. As Property notification will be a frame behind.
1058 if ( popupWorldPosition.y - popupDistanceFromAnchorPoint.y < boundingRectangleWorld.y )
1060 requiredPopupPosition.y = AlternatePopUpPositionRelativeToCursor();
1063 requiredPopupPosition.x = requiredPopupPosition.x + xOffSetToKeepWithinBounds;
1066 void FlipSelectionHandleImages()
1070 CreateSelectionHandles();
1072 HandleImpl& leftHandle = mHandle[LEFT_SELECTION_HANDLE];
1073 HandleImpl& rightHandle = mHandle[RIGHT_SELECTION_HANDLE];
1075 const HandleImageType leftImageType = leftHandle.pressed ? HANDLE_IMAGE_PRESSED : HANDLE_IMAGE_RELEASED;
1076 const HandleImageType rightImageType = rightHandle.pressed ? HANDLE_IMAGE_PRESSED : HANDLE_IMAGE_RELEASED;
1077 const bool leftFlipped = mSwapSelectionHandles != leftHandle.flipped;
1078 const bool rightFlipped = mSwapSelectionHandles != rightHandle.flipped;
1080 leftHandle.actor.SetImage( leftFlipped ? mHandleImages[RIGHT_SELECTION_HANDLE][leftImageType] : mHandleImages[LEFT_SELECTION_HANDLE][leftImageType] );
1082 leftHandle.actor.SetAnchorPoint( leftFlipped ? AnchorPoint::TOP_LEFT : AnchorPoint::TOP_RIGHT );
1084 rightHandle.actor.SetImage( rightFlipped ? mHandleImages[LEFT_SELECTION_HANDLE][rightImageType] : mHandleImages[RIGHT_SELECTION_HANDLE][rightImageType] );
1086 rightHandle.actor.SetAnchorPoint( rightFlipped ? AnchorPoint::TOP_RIGHT : AnchorPoint::TOP_LEFT );
1089 void SetScrollThreshold( float threshold )
1091 mScrollThreshold = threshold;
1094 float GetScrollThreshold() const
1096 return mScrollThreshold;
1099 void SetScrollSpeed( float speed )
1101 mScrollSpeed = speed;
1102 mScrollDistance = speed * SCROLL_TICK_INTERVAL * TO_SECONDS;
1105 float GetScrollSpeed() const
1107 return mScrollSpeed;
1111 * Creates and starts a timer to scroll the text when handles are close to the edges of the text.
1113 * It only starts the timer if it's already created.
1115 void StartScrollTimer()
1119 mScrollTimer = Timer::New( SCROLL_TICK_INTERVAL );
1120 mScrollTimer.TickSignal().Connect( this, &Decorator::Impl::OnScrollTimerTick );
1123 if( !mScrollTimer.IsRunning() )
1125 mScrollTimer.Start();
1130 * Stops the timer used to scroll the text.
1132 void StopScrollTimer()
1136 mScrollTimer.Stop();
1141 * Callback called by the timer used to scroll the text.
1143 * It calculates and sets a new scroll position.
1145 bool OnScrollTimerTick()
1147 if( HANDLE_TYPE_COUNT != mHandleScrolling )
1149 mController.DecorationEvent( mHandleScrolling,
1151 mScrollDirection == SCROLL_RIGHT ? mScrollDistance : -mScrollDistance,
1158 ControllerInterface& mController;
1160 TapGestureDetector mTapDetector;
1161 PanGestureDetector mPanGestureDetector;
1162 Timer mCursorBlinkTimer; ///< Timer to signal cursor to blink
1163 Timer mScrollTimer; ///< Timer used to scroll the text when the grab handle is moved close to the edges.
1165 Layer mActiveLayer; ///< Layer for active handles and alike that ensures they are above all else.
1166 ImageActor mPrimaryCursor;
1167 ImageActor mSecondaryCursor;
1168 MeshActor mHighlightMeshActor; ///< Mesh Actor to display highlight
1169 TextSelectionPopup mCopyPastePopup;
1170 TextSelectionPopup::Buttons mEnabledPopupButtons; /// Bit mask of currently enabled Popup buttons
1172 Image mHandleImages[HANDLE_TYPE_COUNT][HANDLE_IMAGE_TYPE_COUNT];
1174 Mesh mHighlightMesh; ///< Mesh for highlight
1175 MeshData mHighlightMeshData; ///< Mesh Data for highlight
1176 Material mHighlightMaterial; ///< Material used for highlight
1178 CursorImpl mCursor[CURSOR_COUNT];
1179 HandleImpl mHandle[HANDLE_TYPE_COUNT];
1180 QuadContainer mHighlightQuadList; ///< Sub-selections that combine to create the complete selection highlight
1181 Vector2 mHighlightPosition; ///< The position of the highlight actor.
1183 Rect<int> mBoundingBox;
1184 Vector4 mHighlightColor; ///< Color of the highlight
1186 unsigned int mActiveCursor;
1187 unsigned int mCursorBlinkInterval;
1188 float mCursorBlinkDuration;
1189 HandleType mHandleScrolling; ///< The handle which is scrolling.
1190 ScrollDirection mScrollDirection; ///< The direction of the scroll.
1191 float mScrollThreshold; ///< Defines a square area inside the control, close to the edge. A cursor entering this area will trigger scroll events.
1192 float mScrollSpeed; ///< The scroll speed in pixels per second.
1193 float mScrollDistance; ///< Distance the text scrolls during a scroll interval.
1194 unsigned int mScrollInterval; ///< Time in milliseconds of a scroll interval.
1196 bool mActiveCopyPastePopup : 1;
1197 bool mCursorBlinkStatus : 1; ///< Flag to switch between blink on and blink off.
1198 bool mPrimaryCursorVisible : 1; ///< Whether the primary cursor is visible.
1199 bool mSecondaryCursorVisible : 1; ///< Whether the secondary cursor is visible.
1200 bool mSwapSelectionHandles : 1; ///< Whether to swap the selection handle images.
1203 DecoratorPtr Decorator::New( ControllerInterface& controller )
1205 return DecoratorPtr( new Decorator(controller) );
1208 void Decorator::SetBoundingBox( const Rect<int>& boundingBox )
1210 mImpl->mBoundingBox = boundingBox;
1213 const Rect<int>& Decorator::GetBoundingBox() const
1215 return mImpl->mBoundingBox;
1218 void Decorator::Relayout( const Vector2& size )
1220 mImpl->Relayout( size );
1223 void Decorator::UpdatePositions( const Vector2& scrollOffset )
1225 mImpl->UpdatePositions( scrollOffset );
1230 void Decorator::SetActiveCursor( ActiveCursor activeCursor )
1232 mImpl->mActiveCursor = activeCursor;
1235 unsigned int Decorator::GetActiveCursor() const
1237 return mImpl->mActiveCursor;
1240 void Decorator::SetPosition( Cursor cursor, float x, float y, float cursorHeight, float lineHeight )
1242 mImpl->mCursor[cursor].position.x = x;
1243 mImpl->mCursor[cursor].position.y = y;
1244 mImpl->mCursor[cursor].cursorHeight = cursorHeight;
1245 mImpl->mCursor[cursor].lineHeight = lineHeight;
1248 void Decorator::GetPosition( Cursor cursor, float& x, float& y, float& cursorHeight, float& lineHeight ) const
1250 x = mImpl->mCursor[cursor].position.x;
1251 y = mImpl->mCursor[cursor].position.y;
1252 cursorHeight = mImpl->mCursor[cursor].cursorHeight;
1253 lineHeight = mImpl->mCursor[cursor].lineHeight;
1256 const Vector2& Decorator::GetPosition( Cursor cursor ) const
1258 return mImpl->mCursor[cursor].position;
1261 void Decorator::SetColor( Cursor cursor, const Dali::Vector4& color )
1263 mImpl->mCursor[cursor].color = color;
1266 const Dali::Vector4& Decorator::GetColor( Cursor cursor ) const
1268 return mImpl->mCursor[cursor].color;
1271 void Decorator::StartCursorBlink()
1273 if ( !mImpl->mCursorBlinkTimer )
1275 mImpl->mCursorBlinkTimer = Timer::New( mImpl->mCursorBlinkInterval );
1276 mImpl->mCursorBlinkTimer.TickSignal().Connect( mImpl, &Decorator::Impl::OnCursorBlinkTimerTick );
1279 if ( !mImpl->mCursorBlinkTimer.IsRunning() )
1281 mImpl->mCursorBlinkTimer.Start();
1285 void Decorator::StopCursorBlink()
1287 if ( mImpl->mCursorBlinkTimer )
1289 mImpl->mCursorBlinkTimer.Stop();
1293 void Decorator::SetCursorBlinkInterval( float seconds )
1295 mImpl->mCursorBlinkInterval = static_cast<unsigned int>( seconds * TO_MILLISECONDS ); // Convert to milliseconds
1298 float Decorator::GetCursorBlinkInterval() const
1300 return static_cast<float>( mImpl->mCursorBlinkInterval ) * TO_SECONDS;
1303 void Decorator::SetCursorBlinkDuration( float seconds )
1305 mImpl->mCursorBlinkDuration = seconds;
1308 float Decorator::GetCursorBlinkDuration() const
1310 return mImpl->mCursorBlinkDuration;
1315 void Decorator::SetHandleActive( HandleType handleType, bool active )
1317 mImpl->mHandle[handleType].active = active;
1320 bool Decorator::IsHandleActive( HandleType handleType ) const
1322 return mImpl->mHandle[handleType].active ;
1325 void Decorator::SetHandleImage( HandleType handleType, HandleImageType handleImageType, Dali::Image image )
1327 mImpl->mHandleImages[handleType][handleImageType] = image;
1330 Dali::Image Decorator::GetHandleImage( HandleType handleType, HandleImageType handleImageType ) const
1332 return mImpl->mHandleImages[handleType][handleImageType];
1335 void Decorator::SetPosition( HandleType handleType, float x, float y, float height )
1337 // Adjust grab handle displacement
1338 Impl::HandleImpl& handle = mImpl->mHandle[handleType];
1340 handle.grabDisplacementX -= x - handle.position.x;
1341 handle.grabDisplacementY -= y - handle.position.y;
1343 handle.position.x = x;
1344 handle.position.y = y;
1345 handle.lineHeight = height;
1348 void Decorator::GetPosition( HandleType handleType, float& x, float& y, float& height ) const
1350 Impl::HandleImpl& handle = mImpl->mHandle[handleType];
1352 x = handle.position.x;
1353 y = handle.position.y;
1354 height = handle.lineHeight;
1357 const Vector2& Decorator::GetPosition( HandleType handleType ) const
1359 return mImpl->mHandle[handleType].position;
1362 void Decorator::SwapSelectionHandlesEnabled( bool enable )
1364 mImpl->mSwapSelectionHandles = enable;
1366 mImpl->FlipSelectionHandleImages();
1369 void Decorator::AddHighlight( float x1, float y1, float x2, float y2 )
1371 mImpl->mHighlightQuadList.push_back( QuadCoordinates(x1, y1, x2, y2) );
1374 void Decorator::ClearHighlights()
1376 mImpl->mHighlightQuadList.clear();
1377 mImpl->mHighlightPosition = Vector2::ZERO;
1380 void Decorator::SetHighlightColor( const Vector4& color )
1382 mImpl->mHighlightColor = color;
1385 const Vector4& Decorator::GetHighlightColor() const
1387 return mImpl->mHighlightColor;
1390 void Decorator::SetPopupActive( bool active )
1392 mImpl->mActiveCopyPastePopup = active;
1395 bool Decorator::IsPopupActive() const
1397 return mImpl->mActiveCopyPastePopup ;
1400 void Decorator::SetEnabledPopupButtons( TextSelectionPopup::Buttons& enabledButtonsBitMask )
1402 mImpl->mEnabledPopupButtons = enabledButtonsBitMask;
1405 TextSelectionPopup::Buttons& Decorator::GetEnabledPopupButtons()
1407 return mImpl->mEnabledPopupButtons;
1412 void Decorator::SetScrollThreshold( float threshold )
1414 mImpl->SetScrollThreshold( threshold );
1417 float Decorator::GetScrollThreshold() const
1419 return mImpl->GetScrollThreshold();
1422 void Decorator::SetScrollSpeed( float speed )
1424 mImpl->SetScrollSpeed( speed );
1427 float Decorator::GetScrollSpeed() const
1429 return mImpl->GetScrollSpeed();
1432 Decorator::~Decorator()
1437 Decorator::Decorator( ControllerInterface& controller )
1440 mImpl = new Decorator::Impl( controller );
1445 } // namespace Toolkit