class CCL::ActionJournal

Overview

Action journal is keeping track of undoable actions. More…

#include <actionjournal.h>

class ActionJournal:
    public CCL::Object,
    public CCL::IActionJournal
{
public:
    // enums

    enum ExecutionFlags;

    // classes

    class Transaction;

    // fields

    Enabled progressProvider;
     IActionJournal;

    // methods

    DECLARE_CLASS (ActionJournal, Object);
    DECLARE_STRINGID_MEMBER (kExecuted);
    Enabled PROPERTY_BOOL (undoRedoSuspended, UndoRedoSuspended);
    bool execute (Action* action, int executionFlags = 0);
    bool canUndo () const;
    bool canRedo () const;
    bool undo ();
    bool redo ();
    Action* peekUndo () const;
    Action* peekRedo () const;
    Iterator* newUndoIterator () const;
    Iterator* newRedoIterator () const;
    virtual tbool CCL_API isPerformingAction () const;
    bool isExecutingAction () const;
    bool isRestorePending () const;
    Action* addRestorePoint ();
    bool rollback (Action* restorePoint);
    void beginTransaction (StringRef title);
    void endTransaction ();
    void removeAll ();
    bool isDirty () const;
    bool isModified () const;
    void setSavedNow ();
    virtual int64 CCL_API getLastEditTime () const;
    bool isMultiplePending () const;
    Action* peekMultiple ();

    Action* beginMultiple (
        StringRef description = nullptr,
        StringRef details = nullptr
    );

    Action* beginMultiple (Action* multiAction);
    bool endMultiple (bool cancel = false, int executionFlags = 0);
    const LogBuffer& getLogBuffer () const;

    static Object String& getUndoString (
        String& string,
        ActionJournal* journal = nullptr
    );

    static String& getRedoString (String& string, ActionJournal* journal = nullptr);
    static IProgressProvider* getStandardProgressProvider ();
};

Inherited Members

public:
    // typedefs

    typedef CStringRef MemberID;

    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;
    Unknown& operator = (const Unknown&);
    unsigned int getRetainCount () const;
    virtual Object*CCL_API revealObject (const void* moduleAddress) = 0;
    virtual void CCL_API addObserver (IObserver* observer) = 0;
    virtual void CCL_API removeObserver (IObserver* observer) = 0;
    virtual void CCL_API signal (MessageRef msg) = 0;
    virtual void CCL_API deferSignal (IMessage* msg) = 0;
    static ISubject void addObserver (IUnknown* unknown, IObserver* observer);
    static void removeObserver (IUnknown* unknown, IObserver* observer);
    virtual void CCL_API notify (ISubject* subject, MessageRef msg) = 0;

    static IObserver void notify (
        IUnknown* unknown,
        ISubject* subject,
        MessageRef msg
    );

    virtual const ITypeInfo&CCL_API getTypeInfo () const = 0;
    virtual tbool CCL_API getProperty (Variant& var, MemberID propertyId) const = 0;
    virtual tbool CCL_API setProperty (MemberID propertyId, const Variant& var) = 0;
    virtual tbool CCL_API getPropertyNames (IPropertyCollector& collector) const = 0;
    virtual tbool CCL_API invokeMethod (Variant& returnValue, MessageRef msg) = 0;
    DECLARE_BASE_CLASS (Object);
    virtual void CCL_API removeObserver (IObserver* observer);
    virtual void CCL_API signal (MessageRef msg);
    virtual void CCL_API deferSignal (IMessage* msg);
    virtual void deferChanged ();
    virtual void CCL_API notify (ISubject* subject, MessageRef msg);
    virtual bool equals (const Object& obj) const;
    virtual int compare (const Object& obj) const;
    virtual bool load (const Storage& storage);
    virtual bool save (const Storage& storage) const;
    virtual bool save (const OutputStorage& storage) const;
    virtual bool toString (String& string, int flags = 0) const;
    virtual int getHashCode (int size) const;
    IUnknown* asUnknown ();
    static void addGarbageCollected (Object* obj, bool globalScope = true);
    static void deferDestruction (Object* obj);
    static const void* getModuleAddress ();
    virtual int64 CCL_API getLastEditTime () const = 0;
    virtual tbool CCL_API canUndoLastEdit () const = 0;
    virtual tbool CCL_API canRedoLastEdit () const = 0;
    virtual tbool CCL_API undoLastEdit () = 0;
    virtual tbool CCL_API redoLastEdit () = 0;
    virtual tbool CCL_API isPerformingAction () const = 0;

Detailed Documentation

Action journal is keeping track of undoable actions.

Methods

bool execute (Action* action, int executionFlags = 0)

see ExecutionFlags

bool isDirty () const

true if Actions were executed

bool isModified () const

true if modified after last save

void setSavedNow ()

set ‘saved’ timestamp to now

virtual int64 CCL_API getLastEditTime () const

[IActionJournal] get timestamp of last edit

bool endMultiple (bool cancel = false, int executionFlags = 0)

see ExecutionFlags