PlugInOp Class Reference

#include <plugop.h>

Inheritance diagram for PlugInOp:

Operation MessageHandler ListItem CCObject SimpleCCObject BfxPlugInOp List of all members.

Public Member Functions

 PlugInOp ()
 Constructor for PlugInOp operation. It is not undoable.
virtual void Do (OpDescriptor *)
 Invokes the plug-in specified by the OpDescriptor.

Static Public Member Functions

static BOOL Init ()
 Creates all the opDescriptors that call this operation.
static BOOL RegisterOpToken (TCHAR *OpToken, const String_64 &NewMenuText, CCRuntimeClass *pClass=CC_RUNTIME_CLASS(PlugInOp), pfnGetState gs=GetState)
 Allows OpDescriptors to be defined to the operation system.
static BOOL RegisterOpToken (TCHAR *OpToken, UINT32 MenuTextID, CCRuntimeClass *pClass=CC_RUNTIME_CLASS(PlugInOp), pfnGetState gs=GetState)
 Allows OpDescriptors to be defined to the operation system.
static OpState GetState (String_256 *, OpDescriptor *)
 To provide greying and ticking functionality for the operation.

Private Member Functions

 CC_DECLARE_DYNCREATE (PlugInOp)

Detailed Description

Definition at line 120 of file plugop.h.


Constructor & Destructor Documentation

PlugInOp::PlugInOp  ) 
 

Constructor for PlugInOp operation. It is not undoable.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:

Errors: None

Definition at line 255 of file plugop.cpp.

00256 {
00257 }


Member Function Documentation

PlugInOp::CC_DECLARE_DYNCREATE PlugInOp   )  [private]
 

void PlugInOp::Do OpDescriptor pOpDesc  )  [virtual]
 

Invokes the plug-in specified by the OpDescriptor.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
pOpDesc the OpDescriptor of the item to invoke [INPUTS]
None [OUTPUTS]
Returns:
None

Errors: if no OpDescriptor is supplied

Reimplemented from Operation.

Reimplemented in BfxPlugInOp.

Definition at line 392 of file plugop.cpp.

00393 {
00394     if (pOpDesc == NULL)
00395     {
00396         ERROR3IF(pOpDesc == NULL,"PlugInOp::Do null OpDescriptor");
00397         return;
00398     }
00399     //ERROR3("PlugInOp - do");
00400 
00401     // Search the plug-ins list for the specified plug-in and invoke it
00402     PlugInManager* pManager = GetApplication()->GetPlugInManager();
00403     if (pManager == NULL)
00404         return;
00405 
00406     PlugInItem * pPlugIn = pManager->GetFirstPlugIn();
00407     String_32 OpToken;
00408     while (pPlugIn)
00409     {
00410         OpToken = pPlugIn->GetUniqueID();
00411         OpToken += pPlugIn->GetPlugInName();
00412         if (pOpDesc->Token == OpToken)
00413             pPlugIn->About();
00414 
00415         pPlugIn = pManager->GetNextPlugIn(pPlugIn);
00416     }
00417 
00418     // and finish
00419     End();
00420 }

OpState PlugInOp::GetState String_256 ,
OpDescriptor OpDesc
[static]
 

To provide greying and ticking functionality for the operation.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
[INPUTS] 
String - if MenuItem is enabled Then return the name of the operation to [OUTPUTS] be undone Else return the reason why it is disabled
Returns:
OpState the state of the operation

Errors: None

Reimplemented in BfxPlugInOp.

Definition at line 371 of file plugop.cpp.

00372 {
00373     // At present, this item is always available.
00374     OpState OpSt;
00375     return OpSt;
00376 }

BOOL PlugInOp::Init void   )  [static]
 

Creates all the opDescriptors that call this operation.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Returns:
TRUE if the Op was started ok

Reimplemented from SimpleCCObject.

Reimplemented in BfxPlugInOp.

Definition at line 270 of file plugop.cpp.

00271 {
00272     BOOL ok = TRUE;
00273     // Set up some standard operations
00274     ok = ok && RegisterOpToken(OPTOKEN_PLUGINS, _R(IDS_PLUGINS));
00275 //  ok = ok && RegisterOpToken(OPTOKEN_PHOTOSHOP_PLUGINS, _R(IDS_PHOTOSHOP_PLUGINS));
00276 //  ok = ok && RegisterOpToken(OPTOKEN_PHOTOSHOP_APPLYLAST, _R(IDS_PHOTOSHOP_APPLYLAST));
00277 
00278 //  ok = ok && RegisterOpToken(OPTOKEN_PLUGINONE, _R(IDS_PLUGIN_ONE));
00279 //  ok = ok && RegisterOpToken(OPTOKEN_PLUGINTWO, _R(IDS_PLUGIN_TWO));
00280 //  ok = ok && RegisterOpToken(OPTOKEN_PLUGINTHREE, _R(IDS_PLUGIN_THREE));
00281     return ok;
00282 }

BOOL PlugInOp::RegisterOpToken TCHAR OpToken,
UINT32  MenuTextID,
CCRuntimeClass pClass = CC_RUNTIME_CLASS(PlugInOp),
pfnGetState  gs = GetState
[static]
 

Allows OpDescriptors to be defined to the operation system.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
OpToken the OpToken for the operation [INPUTS] MenuTextId the text for the menu item for this operation pClass the runtime class to use, defaults to PlugInOp. gs the GetState function to use
Returns:
TRUE if the Op was registered ok

Definition at line 328 of file plugop.cpp.

00330 {
00331     // register some option descriptors
00332     if (!Operation::RegisterOpDescriptor(
00333                         0,                          // Tool ID
00334                         MenuTextID,                 // String resource ID
00335                         pClass, //CC_RUNTIME_CLASS(PlugInOp),   // Runtime class
00336                         OpToken,                    // Token string
00337                         gs,                         // GetState function
00338                         NULL,                       // help ID
00339                         NULL,                       // bubble help
00340                         NULL,                       // resource ID
00341                         NULL,                       // control ID
00342                         SYSTEMBAR_ILLEGAL,          // Bar ID
00343                         TRUE,                       // Recieve system messages
00344                         FALSE,                      // Smart duplicate operation
00345                         TRUE,                       // Clean operation
00346                         NULL,                       // No vertical counterpart
00347                         NULL,                       // String for one copy only error
00348                         (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags
00349                         ))
00350         return FALSE;
00351 
00352     return TRUE;
00353 }

BOOL PlugInOp::RegisterOpToken TCHAR OpToken,
const String_64 NewMenuText,
CCRuntimeClass pClass = CC_RUNTIME_CLASS(PlugInOp),
pfnGetState  gs = GetState
[static]
 

Allows OpDescriptors to be defined to the operation system.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
OpToken the OpToken for the operation [INPUTS] NewMenuText the text for the menu item for this operation pClass the runtime class to use, defaults to PlugInOp. gs the GetState function to use
Returns:
TRUE if the Op was registered ok

Definition at line 300 of file plugop.cpp.

00302 {
00303     // Try to create the OpDescriptor
00304     PlugInOpDescriptor* pOpDesc = new PlugInOpDescriptor(OpToken, NewMenuText, pClass, gs);
00305     if (pOpDesc == NULL)
00306         return FALSE;
00307 
00308     return TRUE;
00309 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:59:48 2007 for Camelot by  doxygen 1.4.4