JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::detail::TemporaryFilesDecorator Class Referenceabstract

#include <juce_ScopedContentSharerInterface.h>

Inheritance diagram for juce::detail::TemporaryFilesDecorator:
Collaboration diagram for juce::detail::TemporaryFilesDecorator:

Public Member Functions

 TemporaryFilesDecorator (Component *parentIn)
 
void cancelPendingUpdate () noexcept
 This will stop any pending updates from happening.
 
void close () override
 
void handleUpdateNowIfNeeded ()
 If an update has been triggered and is pending, this will invoke it synchronously.
 
bool isUpdatePending () const noexcept
 Returns true if there's an update callback in the pipeline.
 
void runAsync (ContentSharer::Callback cb) override
 
void triggerAsyncUpdate ()
 Causes the callback to be triggered at a later time.
 

Static Public Member Functions

static std::unique_ptr< ScopedContentSharerInterfaceshareData (MemoryBlock, Component *)
 
static std::unique_ptr< ScopedContentSharerInterfaceshareFiles (const Array< URL > &, Component *)
 
static std::unique_ptr< ScopedContentSharerInterfaceshareImages (const Array< Image > &, std::unique_ptr< ImageFileFormat >, Component *)
 
static std::unique_ptr< ScopedContentSharerInterfaceshareText (const String &, Component *)
 

Private Member Functions

void handleAsyncUpdate () override
 Called back to do whatever your class needs to do.
 
virtual std::tuple< Array< URL >, StringprepareTemporaryFiles () const =0
 

Private Attributes

ReferenceCountedObjectPtr< AsyncUpdaterMessage > activeMessage
 
ContentSharer::Callback callback
 
String error
 
std::unique_ptr< ScopedContentSharerInterfaceinner
 
Componentparent = nullptr
 
std::future< void > task
 
Array< URLtemporaryFiles
 

Constructor & Destructor Documentation

◆ TemporaryFilesDecorator()

juce::detail::TemporaryFilesDecorator::TemporaryFilesDecorator ( Component parentIn)
inlineexplicit

Member Function Documentation

◆ cancelPendingUpdate()

void juce::AsyncUpdater::cancelPendingUpdate ( )
noexceptinherited

This will stop any pending updates from happening.

If called after triggerAsyncUpdate() and before the handleAsyncUpdate() callback happens, this will cancel the handleAsyncUpdate() callback.

Note that this method simply cancels the next callback - if a callback is already in progress on a different thread, this won't block until the callback finishes, so there's no guarantee that the callback isn't still running when the method returns.

Referenced by juce::detail::ConcreteScopedContentSharerImpl::~ConcreteScopedContentSharerImpl(), juce::detail::ConcreteScopedMessageBoxImpl::~ConcreteScopedMessageBoxImpl(), juce::OpenGLContext::NativeContext::~NativeContext(), juce::detail::ConcreteScopedContentSharerImpl::close(), juce::detail::ConcreteScopedMessageBoxImpl::close(), and juce::detail::MouseInputSourceImpl::setPointerState().

◆ close()

void juce::detail::TemporaryFilesDecorator::close ( )
inlineoverridevirtual

Reimplemented from juce::detail::ScopedContentSharerInterface.

References inner.

◆ handleAsyncUpdate()

void juce::detail::TemporaryFilesDecorator::handleAsyncUpdate ( )
inlineoverrideprivatevirtual

Called back to do whatever your class needs to do.

This method is called by the message thread at the next convenient time after the triggerAsyncUpdate() method has been called.

Implements juce::AsyncUpdater.

References callback, error, inner, juce::NullCheckedInvocation::invoke(), juce::String::isNotEmpty(), parent, juce::detail::ScopedContentSharerInterface::shareFiles(), temporaryFiles, and TRANS.

◆ handleUpdateNowIfNeeded()

void juce::AsyncUpdater::handleUpdateNowIfNeeded ( )
inherited

If an update has been triggered and is pending, this will invoke it synchronously.

Use this as a kind of "flush" operation - if an update is pending, the handleAsyncUpdate() method will be called immediately; if no update is pending, then nothing will be done.

Because this may invoke the callback, this method must only be called on the main event thread.

◆ isUpdatePending()

bool juce::AsyncUpdater::isUpdatePending ( ) const
noexceptinherited

Returns true if there's an update callback in the pipeline.

◆ prepareTemporaryFiles()

virtual std::tuple< Array< URL >, String > juce::detail::TemporaryFilesDecorator::prepareTemporaryFiles ( ) const
privatepure virtual

Referenced by runAsync().

◆ runAsync()

void juce::detail::TemporaryFilesDecorator::runAsync ( ContentSharer::Callback  cb)
inlineoverridevirtual

◆ shareData()

std::unique_ptr< ScopedContentSharerInterface > juce::detail::ScopedContentSharerInterface::shareData ( MemoryBlock  mb,
Component parent 
)
staticinherited

◆ shareFiles()

static std::unique_ptr< ScopedContentSharerInterface > juce::detail::ScopedContentSharerInterface::shareFiles ( const Array< URL > &  ,
Component  
)
staticinherited

Referenced by handleAsyncUpdate().

◆ shareImages()

std::unique_ptr< ScopedContentSharerInterface > juce::detail::ScopedContentSharerInterface::shareImages ( const Array< Image > &  images,
std::unique_ptr< ImageFileFormat format,
Component parent 
)
staticinherited

◆ shareText()

static std::unique_ptr< ScopedContentSharerInterface > juce::detail::ScopedContentSharerInterface::shareText ( const String ,
Component  
)
staticinherited

◆ triggerAsyncUpdate()

void juce::AsyncUpdater::triggerAsyncUpdate ( )
inherited

Causes the callback to be triggered at a later time.

This method returns immediately, after which a callback to the handleAsyncUpdate() method will be made by the message thread as soon as possible.

If an update callback is already pending but hasn't happened yet, calling this method will have no effect.

It's thread-safe to call this method from any thread, BUT beware of calling it from a real-time (e.g. audio) thread, because it involves posting a message to the system queue, which means it may block (and in general will do on most OSes).

Referenced by runAsync(), juce::OpenGLContext::NativeContext::swapBuffers(), and juce::detail::MouseInputSourceImpl::triggerFakeMove().

Member Data Documentation

◆ activeMessage

ReferenceCountedObjectPtr<AsyncUpdaterMessage> juce::AsyncUpdater::activeMessage
privateinherited

◆ callback

ContentSharer::Callback juce::detail::TemporaryFilesDecorator::callback
private

Referenced by handleAsyncUpdate(), and runAsync().

◆ error

String juce::detail::TemporaryFilesDecorator::error
private

Referenced by handleAsyncUpdate(), and runAsync().

◆ inner

std::unique_ptr<ScopedContentSharerInterface> juce::detail::TemporaryFilesDecorator::inner
private

Referenced by close(), and handleAsyncUpdate().

◆ parent

Component* juce::detail::TemporaryFilesDecorator::parent = nullptr
private

Referenced by handleAsyncUpdate().

◆ task

std::future<void> juce::detail::TemporaryFilesDecorator::task
private

Referenced by runAsync().

◆ temporaryFiles

Array<URL> juce::detail::TemporaryFilesDecorator::temporaryFiles
private

Referenced by handleAsyncUpdate(), and runAsync().


The documentation for this class was generated from the following file: