drag_drop_client_observer.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef UI_AURA_CLIENT_DRAG_DROP_CLIENT_OBSERVER_H_
  5. #define UI_AURA_CLIENT_DRAG_DROP_CLIENT_OBSERVER_H_
  6. #include "build/chromeos_buildflags.h"
  7. #include "ui/aura/aura_export.h"
  8. namespace ui {
  9. class DropTargetEvent;
  10. } // namespace ui
  11. namespace aura {
  12. namespace client {
  13. class AURA_EXPORT DragDropClientObserver {
  14. public:
  15. virtual ~DragDropClientObserver() = default;
  16. // Called when dragging started.
  17. virtual void OnDragStarted() {}
  18. // Called when dragging is updated.
  19. virtual void OnDragUpdated(const ui::DropTargetEvent& event) {}
  20. // Called when dragging completes successfully.
  21. virtual void OnDragCompleted(const ui::DropTargetEvent& event) {}
  22. // Called when dragging is cancelled.
  23. //
  24. // NOTE: Drag 'n drop cancellations may be processed asynchronously.
  25. // Hence, this hook might be called before the action is actually processed.
  26. virtual void OnDragCancelled() {}
  27. #if BUILDFLAG(IS_CHROMEOS_ASH)
  28. // Called when the set of currently selected drag operation changes during the
  29. // drag. |action| is a bitmask of the actions selected by the client. This is
  30. // to provide feedback during the operation, it does not take precedence over
  31. // the operation returned from StartDragAndDrop.
  32. virtual void OnDragActionsChanged(int actions) {}
  33. #endif
  34. };
  35. } // namespace client
  36. } // namespace aura
  37. #endif // UI_AURA_CLIENT_DRAG_DROP_CLIENT_OBSERVER_H_