#define DALI_INTERNAL_DRAG_AND_DROP_DETECTOR_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
*/
// EXTERNAL INCLUDES
+#include <algorithm>
#include <string>
#include <vector>
-#include <algorithm>
-#include <dali/public-api/object/base-object.h>
#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/drag-drop-detector/drag-and-drop-detector.h>
namespace Dali
{
-
namespace Toolkit
{
-
namespace Internal
{
-
-using DragAndDropDetectorPtr = IntrusivePtr< DragAndDropDetector >;
+using DragAndDropDetectorPtr = IntrusivePtr<DragAndDropDetector>;
/**
* This class listens to Drag & Drop events.
class DragAndDropDetector : public Dali::BaseObject, public ConnectionTracker
{
public:
-
using DragAndDropSignal = Dali::Toolkit::DragAndDropDetector::DragAndDropSignal;
// Creation
* Sets the dragged content.
* @param[in] content A string that represents the content that has been dropped.
*/
- void SetContent( const std::string& content );
+ void SetContent(const std::string& content);
/**
* Clears the stored content.
/**
* Sets the position the drop occurred.
*/
- void SetPosition( const Vector2& screenPosition );
+ void SetPosition(const Vector2& screenPosition);
/**
* Called when a draggable object start drag.
void EmitEndedSignal(Dali::Toolkit::Control& control);
public: // Signals
-
/**
* @copydoc Dali::Toolkit::DragAndDropDetector::StartedSignal
*/
}
public:
- bool OnDrag(Dali::Actor actor, const Dali::TouchData& data);
+ bool OnDrag(Dali::Actor actor, const Dali::TouchEvent& data);
void OnPan(Dali::Actor actor, const PanGesture& gesture);
private:
-
// Construction & Destruction
/**
virtual ~DragAndDropDetector();
// Undefined
- DragAndDropDetector( const DragAndDropDetector& ) = delete;
- DragAndDropDetector& operator=( DragAndDropDetector& );
+ DragAndDropDetector(const DragAndDropDetector&) = delete;
+ DragAndDropDetector& operator =(DragAndDropDetector&);
private:
-
- std::string mContent; ///< The current Drag & drop content.
+ std::string mContent; ///< The current Drag & drop content.
DragAndDropSignal mStartedSignal;
DragAndDropSignal mEnteredSignal;
DragAndDropSignal mDroppedSignal;
DragAndDropSignal mEndedSignal;
- std::vector<Dali::Toolkit::Control> mControls; //controls attached by Attach interface for drag&drop
- Dali::Toolkit::Control mDragControl; //the current drag control
- Dali::Toolkit::Control mShadowControl; //a shadow control for indicating where the control is, same size as the dragged control
- std::vector<uint32_t> mFirstEnter; //control id indicating if the cursor is enter
- Dali::PanGestureDetector mPanGestureDetector; //pangesture for calculating the shadow actor position
+ std::vector<Dali::Toolkit::Control> mControls; //controls attached by Attach interface for drag&drop
+ Dali::Toolkit::Control mDragControl; //the current drag control
+ Dali::Toolkit::Control mShadowControl; //a shadow control for indicating where the control is, same size as the dragged control
+ std::vector<uint32_t> mFirstEnter; //control id indicating if the cursor is enter
+ Dali::PanGestureDetector mPanGestureDetector; //pangesture for calculating the shadow actor position
Vector2 mLocalPosition;
Vector2 mDragLocalPosition;
} // namespace Internal
-
// Helpers for public-api forwarding methods
inline Internal::DragAndDropDetector& GetImplementation(Dali::Toolkit::DragAndDropDetector& detector)
{
- DALI_ASSERT_ALWAYS( detector && "DragAndDropDetector handle is empty" );
+ DALI_ASSERT_ALWAYS(detector && "DragAndDropDetector handle is empty");
BaseObject& handle = detector.GetBaseObject();
inline const Internal::DragAndDropDetector& GetImplementation(const Dali::Toolkit::DragAndDropDetector& detector)
{
- DALI_ASSERT_ALWAYS( detector && "DragAndDropDetector handle is empty" );
+ DALI_ASSERT_ALWAYS(detector && "DragAndDropDetector handle is empty");
const BaseObject& handle = detector.GetBaseObject();