C12Adapter Opensource C++ Interface
MProgressListener Class Reference

Listener interface that should be implemented in order to get updates from progress monitor. More...

Inheritance diagram for MProgressListener:

Public Types

enum  {
  FlagRefreshProgress = 1,
  FlagRefreshActionMessage = 2,
  FlagRefreshSubActionMessage = 4,
  FlagRestoreSubActionMessage = 8,
  FlagRefreshAll = 0xFFFFFFFF
}
 Indicate progress changes that have to be performed by the client application. More...
 

Public Member Functions

 MProgressListener ()
 Construct the progress monitor listener.
 
virtual ~MProgressListener ()
 Destroy the progress monitor listener.
 
virtual void OnActionMessageChange (const MStdString &message)
 Top-level root action message has changed. More...
 
virtual void OnSubActionMessageChange (const MStdString &message, bool restoringPrevious)
 The most recently created sub-action message has changed. More...
 
virtual void OnProgressChange (double totalPercent, double subActionPercent)
 Progress change notification is sent on any progress percentage update. More...
 
virtual void CommitChanges (unsigned flags)
 Completes each series of updates. More...
 
MObjectGetClient () const
 
void SetClient (MObject *client)
 
- Public Member Functions inherited from MObject
virtual ~MObject ()
 Object destructor.
 
virtual const MClassGetClass () const =0
 Get the final class of the object. More...
 
virtual unsigned GetEmbeddedSizeof () const
 For embedded object types, return the size of the class. More...
 
bool IsEmbeddedObject () const
 Tell if the object is of embedded kind. More...
 
SHOW_INTERNAL MVariant Call (const MStdString &name, const MVariant &params)
 Call the object service with parameters, given as variant. More...
 
MVariant Call0 (const MStdString &name)
 Call the object service with no parameters. More...
 
MVariant Call1 (const MStdString &name, const MVariant &p1)
 Call the object service with one parameter. More...
 
MVariant Call2 (const MStdString &name, const MVariant &p1, const MVariant &p2)
 Call the object service with two parameter. More...
 
MVariant Call3 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3)
 Call the object service with three parameter. More...
 
MVariant Call4 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4)
 Call the object service with four parameter. More...
 
MVariant Call5 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5)
 Call the object service with five parameter. More...
 
MVariant Call6 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5, const MVariant &p6)
 Call the object service with six parameter. More...
 
virtual MVariant CallV (const MStdString &name, const MVariant::VariantVector &params)
 Call the object service with parameters, given as variant vector. More...
 
virtual bool IsPropertyPresent (const MStdString &name) const
 Tell if the property with the given name exists.
 
virtual bool IsServicePresent (const MStdString &name) const
 Tell if the service with the given name exists.
 
virtual MVariant GetProperty (const MStdString &name) const
 Get the property value using name of the property. More...
 
virtual void SetProperty (const MStdString &name, const MVariant &value)
 Set the property using name of the property, and value. More...
 
virtual MStdStringVector GetAllPropertyNames () const
 Return the list of publicly available properties, persistent or not. More...
 
virtual MStdStringVector GetAllPersistentPropertyNames () const
 Return the list of persistent properties. More...
 
virtual void SetPersistentPropertiesToDefault ()
 Set the persistent properties of the object to their default values. More...
 
virtual MVariant GetPersistentPropertyDefaultValue (const MStdString &name) const
 Get the default value of persistent property with the name given. More...
 
virtual void SetPersistentPropertyToDefault (const MStdString &name)
 Set the persistent property with the name given to default value. More...
 
virtual const char * GetType () const
 Get the name of the type for the object (could be the same as class name).
 
virtual void SetType (const MStdString &)
 Intentionally, it will set the name of the type for the object, but the service will not allow setting the name to anything other than the current name. More...
 
virtual void Validate ()
 Validate internal structures of the object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MObject
static const MClassGetStaticClass ()
 Get the declared class of this particular object. More...
 
static bool IsClassPresent (const MStdString &name)
 Tells if the given class name is available. More...
 
- Static Public Attributes inherited from MObject
static const MClass s_class
 Class of MObject.
 
- Protected Member Functions inherited from MObject
 MObject ()
 Object constructor, protected as the class is abstract.
 
void DoSetPersistentPropertiesToDefault (const MClass *staticClass)
 Set the persistent properties to their default values for one object provided the class for that object. More...
 

Detailed Description

Listener interface that should be implemented in order to get updates from progress monitor.

Typical notification consists of one or more overloaded calls, followed by CommitChanges().

Member Enumeration Documentation

anonymous enum

Indicate progress changes that have to be performed by the client application.

Several update types can be combined with bitwise OR operation.

See also
CommitChanges
Enumerator
FlagRefreshProgress 

Progress (percent complete) has changed.

FlagRefreshActionMessage 

Top level actions message change.

FlagRefreshSubActionMessage 

Current sub-action message change.

FlagRestoreSubActionMessage 

Restore parent sub-action message when destroying current sub-action.

FlagRefreshAll 

All refresh bits are on.

Member Function Documentation

virtual void MProgressListener::CommitChanges ( unsigned  flags)
virtual

Completes each series of updates.

Listener implementation is expected to redraw its GUI at this point if there is any sort of action caching in the GUI.

This particular default implementation uses reflection to call the client method "CommitChanges" if client is present and such method is available in it.

Parameters
flagshas one or more bits set according to the following flags:
  • MProgressAction::RefreshProgress = 1 - Progress (% complete) has changed
  • MProgressAction::RefreshActionMessage = 2 - Top-level action's message change
  • MProgressAction::RefreshSubActionMessage = 4 - Current sub-action's message change
  • MProgressAction::RestoreSubActionMessage = 8 - Restore parent sub-action's message when destroying current sub-action
MObject* MProgressListener::GetClient ( ) const
inline

Client that supports monitor messages through reflection.

When client is set and any of the overloaded methods are called, the correspondent client method will be called by name, if such method is available.

virtual void MProgressListener::OnActionMessageChange ( const MStdString message)
virtual

Top-level root action message has changed.

Typical implementations should update the GUI so the message is shown to the user. This particular default implementation uses reflection to call client method "OnActionMessageChange" if client is present and such method is available in it.

Parameters
messageMessage to report, can be an empty string
virtual void MProgressListener::OnProgressChange ( double  totalPercent,
double  subActionPercent 
)
virtual

Progress change notification is sent on any progress percentage update.

Typical implementations should update the progress bar or any other sort of the GUI that is used to show progress. Notice that any progress advance on the most current action is immediately propagated by the action hierarchy, so that the root action's progress is always updated.

This particular default implementation uses reflection to call client method "OnProgressChange" if client is present and such method is available in it.

Parameters
totalPercentrefers to the root action percentage progress.
subActionPercentrefers to the most recently created sub-action progress.
virtual void MProgressListener::OnSubActionMessageChange ( const MStdString message,
bool  restoringPrevious 
)
virtual

The most recently created sub-action message has changed.

Typical implementations should update the GUI so the message is shown to the user. This particular default implementation uses reflection to call client method "OnSubActionMessageChange" if client is present and such method is available in it.

Parameters
messageMessage to report, can be an empty string.
restoringPreviousis true if the parent action message is being restored while destroying one or more child actions. This means that the message isn't really a new one, but the one restored from the action stack. If restoringPrevious is true, MProgressAction::RestoreSubActionMessage update flag is set in CommitChanges(), otherwise MProgressAction::RefreshSubActionMessage flag is set.
void MProgressListener::SetClient ( MObject client)
inline

Client that supports monitor messages through reflection.

When client is set and any of the overloaded methods are called, the correspondent client method will be called by name, if such method is available.