openshot-audio  0.1.4
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
ModalComponentManager Class Reference

#include <juce_ModalComponentManager.h>

Inheritance diagram for ModalComponentManager:
AsyncUpdater DeletedAtShutdown

Classes

class  Callback
 
class  ModalItem
 

Public Member Functions

 juce_DeclareSingleton_SingleThreaded_Minimal (ModalComponentManager) int getNumModalComponents() const
 
ComponentgetModalComponent (int index) const
 
bool isModal (Component *component) const
 
bool isFrontModalComponent (Component *component) const
 
void attachCallback (Component *component, Callback *callback)
 
void bringModalComponentsToFront (bool topOneShouldGrabFocus=true)
 
bool cancelAllModalComponents ()
 

Protected Member Functions

 ModalComponentManager ()
 
 ~ModalComponentManager ()
 
void handleAsyncUpdate () override
 

Friends

class Component
 
struct ContainerDeletePolicy< ModalItem >
 

Detailed Description

Manages the system's stack of modal components.

Normally you'll just use the Component methods to invoke modal states in components, and won't have to deal with this class directly, but this is the singleton object that's used internally to manage the stack.

See also
Component::enterModalState, Component::exitModalState, Component::isCurrentlyModal, Component::getCurrentlyModalComponent, Component::isCurrentlyBlockedByAnotherModalComponent

Constructor & Destructor Documentation

◆ ModalComponentManager()

ModalComponentManager::ModalComponentManager ( )
protected

Creates a ModalComponentManager. You shouldn't ever call the constructor - it's a singleton, so use ModalComponentManager::getInstance()

◆ ~ModalComponentManager()

ModalComponentManager::~ModalComponentManager ( )
protected

Destructor.

Member Function Documentation

◆ attachCallback()

void ModalComponentManager::attachCallback ( Component component,
Callback callback 
)

Adds a new callback that will be called when the specified modal component is dismissed.

If the component is modal, then when it is dismissed, either by being hidden, or by calling Component::exitModalState(), then the Callback::modalStateFinished() method will be called.

Each component can have any number of callbacks associated with it, and this one is added to that list.

The object that is passed in will be deleted by the manager when it's no longer needed. If the given component is not currently modal, the callback object is deleted immediately and no action is taken.

◆ bringModalComponentsToFront()

void ModalComponentManager::bringModalComponentsToFront ( bool  topOneShouldGrabFocus = true)

Brings any modal components to the front.

◆ cancelAllModalComponents()

bool ModalComponentManager::cancelAllModalComponents ( )

Calls exitModalState (0) on any components that are currently modal.

Returns
true if any components were modal; false if nothing needed cancelling

◆ getModalComponent()

Component * ModalComponentManager::getModalComponent ( int  index) const

Returns one of the components being shown modally. An index of 0 is the most recently-shown, topmost component.

◆ handleAsyncUpdate()

void ModalComponentManager::handleAsyncUpdate ( )
overrideprotectedvirtual

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 AsyncUpdater.

◆ isFrontModalComponent()

bool ModalComponentManager::isFrontModalComponent ( Component component) const

Returns true if the specified component is currently the topmost modal component.

◆ isModal()

bool ModalComponentManager::isModal ( Component component) const

Returns true if the specified component is in a modal state.

◆ juce_DeclareSingleton_SingleThreaded_Minimal()

ModalComponentManager::juce_DeclareSingleton_SingleThreaded_Minimal ( ModalComponentManager  ) const

Returns the number of components currently being shown modally.

See also
getModalComponent

Friends And Related Function Documentation

◆ Component

friend class Component
friend

◆ ContainerDeletePolicy< ModalItem >

friend struct ContainerDeletePolicy< ModalItem >
friend

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