IDocumentOperation

From RealWorld Wiki

Jump to: navigation, search

The IDocumentOperation interface is declared in the type library of RWProcessing.dll and it is the main interface of an operation plug-in.

// "BC429154-A2B8-4808-A383-82517A57D209"
interface IDocumentOperation : IUnknown
{
    HRESULT NameGet(
        [in] IOperationManager* a_pManager,
        [out] ILocalizedString** a_ppOperationName);
    HRESULT ConfigCreate(
        [in] IOperationManager* a_pManager,
        [out] IConfig** a_ppDefaultConfig);
    HRESULT CanActivate(
        [in] IOperationManager* a_pManager,
        [in] IDocument* a_pDocument,
        [in] IConfig* a_pConfig,
        [in] ISharedStateManager* a_pStates);
    HRESULT Activate(
        [in] IOperationManager* a_pManager,
        [in] IDocument* a_pDocument,
        [in] IConfig* a_pConfig,
        [in] ISharedStateManager* a_pStates,
        [in] RWHWND a_hParent,
        [in] LCID a_tLocaleID);
};

Because the operation plug-ins follow the cooperating plug-ins pattern, each method has the operations manager as its first argument.

  • NameGet method returns a localized name of the operation.
  • ConfigCreate creates a default configuration object for the operation.
  • CanActivate checks if the application can be run with the given document, configuration and view states. Configuration may be NULL. Returns S_OK/S_FALSE.
  • Activate runs the operation. Operations should in general not interact with user.
Personal tools