drag_drop_types.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (c) 2011 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_DRAG_DROP_TYPES_H_
  5. #define UI_BASE_DRAGDROP_DRAG_DROP_TYPES_H_
  6. #include <stdint.h>
  7. #include "base/component_export.h"
  8. #include "build/build_config.h"
  9. #include "ui/base/dragdrop/mojom/drag_drop_types.mojom-forward.h"
  10. namespace ui {
  11. class COMPONENT_EXPORT(UI_BASE_DRAGDROP_TYPES) DragDropTypes {
  12. public:
  13. // These constants match their equivalents in NSDragOperation and
  14. // should not be renumbered.
  15. // TODO(https://crbug.com/1093536): replace this enum with
  16. // ui::mojom::DragOperation.
  17. enum DragOperation {
  18. DRAG_NONE = 0,
  19. DRAG_COPY = 1,
  20. DRAG_LINK = 2,
  21. DRAG_MOVE = 16,
  22. };
  23. #if BUILDFLAG(IS_WIN)
  24. static uint32_t DragOperationToDropEffect(int drag_operation);
  25. static int DropEffectToDragOperation(uint32_t effect);
  26. #endif
  27. #if BUILDFLAG(IS_APPLE)
  28. static uint64_t DragOperationToNSDragOperation(int drag_operation);
  29. static int NSDragOperationToDragOperation(uint64_t ns_drag_operation);
  30. #endif
  31. };
  32. COMPONENT_EXPORT(UI_BASE_DRAGDROP_TYPES)
  33. ui::mojom::DragOperation PreferredDragOperation(int operations);
  34. } // namespace ui
  35. #endif // UI_BASE_DRAGDROP_DRAG_DROP_TYPES_H_