LMMS
Loading...
Searching...
No Matches
juce_ContentSharer.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26#pragma once
27
28namespace juce
29{
30
38{
39public:
41
42
54 void shareFiles (const Array<URL>& files,
55 std::function<void (bool /*success*/, const String& /*error*/)> callback);
56
64 void shareText (const String& text,
65 std::function<void (bool /*success*/, const String& /*error*/)> callback);
66
88 void shareImages (const Array<Image>& images,
89 std::function<void (bool /*success*/, const String& /*error*/)> callback,
90 ImageFileFormat* imageFileFormatToUse = nullptr);
91
101 void shareData (const MemoryBlock& mb,
102 std::function<void (bool /*success*/, const String& /*error*/)> callback);
103
104private:
107
109
110 std::function<void (bool, String)> callback;
111
112 #if JUCE_CONTENT_SHARING
113 struct Pimpl
114 {
115 virtual ~Pimpl() {}
116 virtual void shareFiles (const Array<URL>& files) = 0;
117 virtual void shareText (const String& text) = 0;
118 };
119
120 std::unique_ptr<Pimpl> pimpl;
121 Pimpl* createPimpl();
122
123 void startNewShare (std::function<void (bool, const String&)>);
124
125 class ContentSharerNativeImpl;
126 friend class ContentSharerNativeImpl;
127
128 class PrepareImagesThread;
129 friend class PrepareImagesThread;
130 std::unique_ptr<PrepareImagesThread> prepareImagesThread;
131
132 class PrepareDataThread;
133 friend class PrepareDataThread;
134 std::unique_ptr<PrepareDataThread> prepareDataThread;
135
136 void filesToSharePrepared();
137 #endif
138
139 void deleteTemporaryFiles();
140 void sharingFinished (bool, const String&);
141};
142
143} // namespace juce
Definition juce_Array.h:56
void shareText(const String &text, std::function< void(bool, const String &)> callback)
Definition juce_ContentSharer.cpp:191
void shareData(const MemoryBlock &mb, std::function< void(bool, const String &)> callback)
Definition juce_ContentSharer.cpp:241
std::function< void(bool, String)> callback
Definition juce_ContentSharer.h:110
Array< File > temporaryFiles
Definition juce_ContentSharer.h:108
ContentSharer()
Definition juce_ContentSharer.cpp:150
void shareImages(const Array< Image > &images, std::function< void(bool, const String &)> callback, ImageFileFormat *imageFileFormatToUse=nullptr)
Definition juce_ContentSharer.cpp:208
void shareFiles(const Array< URL > &files, std::function< void(bool, const String &)> callback)
Definition juce_ContentSharer.cpp:153
DeletedAtShutdown()
Definition juce_DeletedAtShutdown.cpp:34
Definition juce_ImageFileFormat.h:42
Definition juce_MemoryBlock.h:33
Definition juce_String.h:53
#define JUCE_DECLARE_SINGLETON(Classname, doNotRecreateAfterDeletion)
Definition juce_Singleton.h:184
#define JUCE_API
Definition juce_StandardHeader.h:152
static char ** files
Definition misc.c:28
Definition carla_juce.cpp:31
const char * text
Definition swell-functions.h:167
#define void
Definition unzip.h:396