drop_target_event.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright (c) 2013 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_BASE_DRAGDROP_DROP_TARGET_EVENT_H_
  5. #define UI_BASE_DRAGDROP_DROP_TARGET_EVENT_H_
  6. #include "base/component_export.h"
  7. #include "ui/base/dragdrop/os_exchange_data.h"
  8. #include "ui/events/event.h"
  9. namespace ui {
  10. // Note: This object must not outlive the OSExchangeData used to construct it,
  11. // as it stores that by reference.
  12. class COMPONENT_EXPORT(UI_BASE) DropTargetEvent : public LocatedEvent {
  13. public:
  14. DropTargetEvent(const OSExchangeData& data,
  15. const gfx::PointF& location,
  16. const gfx::PointF& root_location,
  17. int source_operations);
  18. DropTargetEvent(const DropTargetEvent& other);
  19. const OSExchangeData& data() const { return data_; }
  20. int source_operations() const { return source_operations_; }
  21. // Event:
  22. std::unique_ptr<Event> Clone() const override;
  23. private:
  24. // Data associated with the drag/drop session.
  25. const OSExchangeData& data_;
  26. // Bitmask of supported DragDropTypes::DragOperation by the source.
  27. int source_operations_;
  28. };
  29. } // namespace ui
  30. #endif // UI_BASE_DRAGDROP_DROP_TARGET_EVENT_H_