BackgroundProgressInterface Class Reference

#include <backgroundentry.h>

Inheritance diagram for BackgroundProgressInterface:

Detailed Description

Interface to announce background entries with progress management.

Public Types

enum class  STATECHANGE {
  ACTIVE_ADDED ,
  ACTIVE_REMOVED ,
  HISTORY_ADDED ,
  HISTORY_REMOVED ,
  CANCELDELEGATE_CHANGED
}
 

Public Member Functions

enum maxon::BackgroundProgressInterface::STATECHANGE MAXON_ENUM_LIST_CLASS (STATECHANGE)
 
MAXON_METHOD Result< BackgroundProgressRef > AddActiveEntry (const String &title, Bool sendToHistory=true)
 
MAXON_METHOD Result< void > RemoveActiveEntry (const BackgroundProgressRef &entry)
 
MAXON_METHOD Result< BoolGetActiveEntries (const ValueReceiver< const BackgroundProgressRef & > &entry) const
 
MAXON_METHOD Int GetActiveCount () const
 
MAXON_METHOD Result< BoolGetHistoryEntries (const ValueReceiver< const BackgroundEntryRef & > &entry) const
 
MAXON_METHOD Int GetHistoryCount () const
 
MAXON_METHOD Result< void > RemoveHistoryEntry (const BackgroundEntryRef &entry)
 
MAXON_METHOD Result< void > ClearHistory ()
 
 MAXON_OBSERVABLE (void, ObservableStateChanged,(STATECHANGE state, const BackgroundEntryRef &entry), ObservableCombinerRunAllComponent)
 
 MAXON_OBSERVABLE (void, ObservableTotalProgressNotification,(const BackgroundProgressRef &ref, Float percent), ObservableCombinerRunAllComponent)
 

Static Public Member Functions

static MAXON_METHOD BackgroundProgressRef GetMaster ()
 

Private Member Functions

 MAXON_INTERFACE (BackgroundProgressInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.backgroundprogress", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 
- Private Member Functions inherited from BackgroundEntryInterface
enum maxon::BackgroundEntryInterface::STATE MAXON_ENUM_FLAGS_CLASS (STATE)
 
MAXON_METHOD String GetName () const
 
MAXON_METHOD UniversalDateTime GetStartTime () const
 
MAXON_METHOD TimeValue GetDuration () const
 
MAXON_METHOD STATE GetState ()
 
MAXON_METHOD Result< BoolGetStates (const ValueReceiver< STATE, const String & > &state) const
 
MAXON_METHOD Int GetStateCount () const
 
MAXON_METHOD Result< void > AddState (STATE state, const String &message)
 

Additional Inherited Members

- Private Types inherited from BackgroundEntryInterface
enum class  STATE {
  NONE ,
  SUCCEEDED ,
  CANCELED ,
  WARNING ,
  ERROR
}
 

Member Enumeration Documentation

◆ STATECHANGE

enum STATECHANGE
strong
Enumerator
ACTIVE_ADDED 

an active entry was added

ACTIVE_REMOVED 

an active entry was removed

HISTORY_ADDED 

a history entry was added

HISTORY_REMOVED 

a history entry was removed

CANCELDELEGATE_CHANGED 

cancel delegate changed

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( BackgroundProgressInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.backgroundprogress"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ MAXON_ENUM_LIST_CLASS()

◆ GetMaster()

static MAXON_METHOD BackgroundProgressRef GetMaster ( )
static

GetMaster returns the master instance of this implementation. this instance is used to visualize entries in the task manager.

◆ AddActiveEntry()

MAXON_METHOD Result<BackgroundProgressRef> AddActiveEntry ( const String title,
Bool  sendToHistory = true 
)

AddActiveEntry adds a new active entry to the list. The object is stored only as WeakRef. So you take the ownership. Important: The last reference to the object will remove the object from the active list.

Parameters
[in]titleText with the human readable name of the action.
[in]sendToHistoryTrue if the entry should be moved to the history list after it's done.
Returns
New BackgroundProgressRef entry on success.

◆ RemoveActiveEntry()

MAXON_METHOD Result<void> RemoveActiveEntry ( const BackgroundProgressRef &  entry)

RemoveActiveEntry removes the entry from the active list and moves it to the history. You can use this before the the last reference dies.

Parameters
[in]entryEntry to remove from the active list.
Returns
OK on success.

◆ GetActiveEntries()

MAXON_METHOD Result<Bool> GetActiveEntries ( const ValueReceiver< const BackgroundProgressRef & > &  entry) const

GetActiveEntries calls the ValueReceiver for each active entry.

Parameters
[in]entryDelegate which is called for every entry in the list.
Returns
Result of the delegate.

◆ GetActiveCount()

MAXON_METHOD Int GetActiveCount ( ) const

GetActiveCount returns the number of active elements.

◆ GetHistoryEntries()

MAXON_METHOD Result<Bool> GetHistoryEntries ( const ValueReceiver< const BackgroundEntryRef & > &  entry) const

GetHistoryEntries calls the ValueReceiver for each history entry.

Parameters
[in]entryDelegate which is called for every entry in the list.
Returns
OK on success.

◆ GetHistoryCount()

MAXON_METHOD Int GetHistoryCount ( ) const

GetHistoryCount returns the number of history entries.

◆ RemoveHistoryEntry()

MAXON_METHOD Result<void> RemoveHistoryEntry ( const BackgroundEntryRef &  entry)

RemoveHistoryEntry removes the given entry from the history

Parameters
[in]entryEntry to remove.
Returns
OK on success.

◆ ClearHistory()

MAXON_METHOD Result<void> ClearHistory ( )

ClearHistory removes all history entries.

Returns
OK on success.

◆ MAXON_OBSERVABLE() [1/2]

MAXON_OBSERVABLE ( void  ,
ObservableStateChanged  ,
(STATECHANGE state, const BackgroundEntryRef &entry)  ,
ObservableCombinerRunAllComponent   
)

ObservableStateChanged observable is called if the object adds or removes entries.

◆ MAXON_OBSERVABLE() [2/2]

MAXON_OBSERVABLE ( void  ,
ObservableTotalProgressNotification  ,
(const BackgroundProgressRef &ref, Float percent)  ,
ObservableCombinerRunAllComponent   
)

ObservableTotalProgressNotification observable is called if the overall progress of one of the elements changed.