The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
3.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 7 End-User License
  8. Agreement and JUCE Privacy Policy.
  9. End User License Agreement: www.juce.com/juce-7-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. namespace juce
  19. {
  20. ScopedMessageBox ContentSharer::shareFilesScoped (const Array<URL>& files,
  21. Callback callback,
  22. Component* parent)
  23. {
  24. auto impl = detail::ScopedContentSharerInterface::shareFiles (files, parent);
  25. return detail::ConcreteScopedContentSharerImpl::show (std::move (impl), std::move (callback));
  26. }
  27. ScopedMessageBox ContentSharer::shareTextScoped (const String& text,
  28. Callback callback,
  29. Component* parent)
  30. {
  31. auto impl = detail::ScopedContentSharerInterface::shareText (text, parent);
  32. return detail::ConcreteScopedContentSharerImpl::show (std::move (impl), std::move (callback));
  33. }
  34. ScopedMessageBox ContentSharer::shareImagesScoped (const Array<Image>& images,
  35. std::unique_ptr<ImageFileFormat> format,
  36. Callback callback,
  37. Component* parent)
  38. {
  39. auto impl = detail::ScopedContentSharerInterface::shareImages (images, std::move (format), parent);
  40. return detail::ConcreteScopedContentSharerImpl::show (std::move (impl), std::move (callback));
  41. }
  42. ScopedMessageBox ContentSharer::shareDataScoped (const MemoryBlock& mb,
  43. Callback callback,
  44. Component* parent)
  45. {
  46. auto impl = detail::ScopedContentSharerInterface::shareData (mb, parent);
  47. return detail::ConcreteScopedContentSharerImpl::show (std::move (impl), std::move (callback));
  48. }
  49. #if ! (JUCE_CONTENT_SHARING && (JUCE_IOS || JUCE_ANDROID))
  50. auto detail::ScopedContentSharerInterface::shareFiles (const Array<URL>&, Component*) -> std::unique_ptr<ScopedContentSharerInterface>
  51. {
  52. return std::make_unique<detail::ScopedContentSharerInterface>();
  53. }
  54. auto detail::ScopedContentSharerInterface::shareText (const String&, Component*) -> std::unique_ptr<ScopedContentSharerInterface>
  55. {
  56. return std::make_unique<detail::ScopedContentSharerInterface>();
  57. }
  58. #endif
  59. } // namespace juce