#include <plugopun.h>
Inheritance diagram for PlugInUndoOp:
Public Member Functions | |
PlugInUndoOp () | |
Constructor for PlugInUndoOp operation. It is undoable. | |
virtual void | Do (OpDescriptor *) |
Invokes the plug-in specified by the OpDescriptor. | |
virtual void | GetOpName (String_256 *OpName) |
To get the name of the operation to put on the undo/redo menu items. We overide the baseclass version which tries to use the runtime class of this class to work out the OpDescriptor it was invoked with. Of course, we use one operation with multiple OpDescriptors and so this is not good enough. Unfortunately the operation class does not seem to save away the OpDescriptor that invoked it and so we must do this and then use this to track down the text to use. | |
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(PlugInUndoOp), pfnGetState gs=GetState) |
Allows OpDescriptors to be defined to the operation system. | |
static BOOL | RegisterOpToken (TCHAR *OpToken, UINT32 MenuTextID, CCRuntimeClass *pClass=CC_RUNTIME_CLASS(PlugInUndoOp), 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. | |
Protected Attributes | |
OpDescriptor * | m_pOpDesc |
Private Member Functions | |
CC_DECLARE_DYNCREATE (PlugInUndoOp) |
Definition at line 120 of file plugopun.h.
|
Constructor for PlugInUndoOp operation. It is undoable.
Definition at line 135 of file plugopun.cpp. 00135 : SelOperation() 00136 { 00137 m_pOpDesc = NULL; 00138 }
|
|
|
|
Invokes the plug-in specified by the OpDescriptor.
Reimplemented from Operation. Reimplemented in BfxPlugInUndoOp. Definition at line 301 of file plugopun.cpp. 00302 { 00303 if (pOpDesc == NULL) 00304 { 00305 ERROR3IF(pOpDesc == NULL,"PlugInUndoOp::Do null OpDescriptor"); 00306 return; 00307 } 00308 //ERROR3("PlugInUndoOp - do"); 00309 00310 // Store away a copy of the OpDescriptor for later use 00311 m_pOpDesc = pOpDesc; 00312 00313 // Search the plug-ins list for the specified plug-in and invoke it 00314 PlugInManager* pManager = GetApplication()->GetPlugInManager(); 00315 if (pManager == NULL) 00316 return; 00317 00318 PlugInItem * pPlugIn = pManager->GetFirstPlugIn(); 00319 String_32 OpToken; 00320 while (pPlugIn) 00321 { 00322 OpToken = pPlugIn->GetUniqueID(); 00323 OpToken += pPlugIn->GetPlugInName(); 00324 if (pOpDesc->Token == OpToken) 00325 { 00326 // Do Something 00327 break; 00328 } 00329 00330 pPlugIn = pManager->GetNextPlugIn(pPlugIn); 00331 } 00332 00333 // If we reached here then everything has happened ok and we can just end the 00334 // operation and exit 00335 End(); 00336 00337 return; 00338 }
|
|
To get the name of the operation to put on the undo/redo menu items. We overide the baseclass version which tries to use the runtime class of this class to work out the OpDescriptor it was invoked with. Of course, we use one operation with multiple OpDescriptors and so this is not good enough. Unfortunately the operation class does not seem to save away the OpDescriptor that invoked it and so we must do this and then use this to track down the text to use.
Reimplemented from Operation. Definition at line 277 of file plugopun.cpp. 00278 { 00279 if (pOpName == NULL) 00280 return; 00281 00282 // Use our stored copy of the OpDescriptor and ask it for the text 00283 if (m_pOpDesc) 00284 m_pOpDesc->GetText(pOpName, OP_UNDO_TEXT); 00285 }
|
|
To provide greying and ticking functionality for the operation.
Reimplemented in BfxPlugInUndoOp. Definition at line 253 of file plugopun.cpp. 00254 { 00255 // At present, this item is always available. 00256 OpState OpSt; 00257 return OpSt; 00258 }
|
|
Creates all the opDescriptors that call this operation.
Reimplemented from SimpleCCObject. Reimplemented in BfxPlugInUndoOp. Definition at line 151 of file plugopun.cpp. 00152 { 00153 BOOL ok = TRUE; 00154 // Set up some standard operations 00155 // ok = ok && RegisterOpToken(OPTOKEN_PLUGINS, _R(IDS_PLUGINS)); 00156 00157 // ok = ok && RegisterOpToken(OPTOKEN_PHOTOSHOP_PLUGINS, _R(IDS_PHOTOSHOP_PLUGINS)); 00158 // ok = ok && RegisterOpToken(OPTOKEN_PHOTOSHOP_APPLYLAST, _R(IDS_PHOTOSHOP_APPLYLAST)); 00159 00160 // ok = ok && RegisterOpToken(OPTOKEN_PLUGINONE, _R(IDS_PLUGIN_ONE)); 00161 // ok = ok && RegisterOpToken(OPTOKEN_PLUGINTWO, _R(IDS_PLUGIN_TWO)); 00162 // ok = ok && RegisterOpToken(OPTOKEN_PLUGINTHREE, _R(IDS_PLUGIN_THREE)); 00163 return ok; 00164 }
|
|
Allows OpDescriptors to be defined to the operation system.
Definition at line 210 of file plugopun.cpp. 00212 { 00213 // register some option descriptors 00214 if (!UndoableOperation::RegisterOpDescriptor( 00215 0, // Tool ID 00216 MenuTextID, // String resource ID 00217 pClass, // Runtime class 00218 OpToken, // Token string 00219 gs, // GetState function 00220 NULL, // help ID 00221 NULL, // bubble help 00222 NULL, // resource ID 00223 NULL, // control ID 00224 SYSTEMBAR_ILLEGAL, // Bar ID 00225 TRUE, // Recieve system messages 00226 FALSE, // Smart duplicate operation 00227 FALSE, // Clean operation 00228 // NULL, // No vertical counterpart (not present in undoable versions) 00229 NULL, // String for one copy only error 00230 (DONT_GREY_WHEN_SELECT_INSIDE | GREY_WHEN_NO_CURRENT_DOC) // Auto state flags 00231 )) 00232 return FALSE; 00233 00234 return TRUE; 00235 }
|
|
Allows OpDescriptors to be defined to the operation system.
Definition at line 182 of file plugopun.cpp. 00184 { 00185 // Try to create the OpDescriptor 00186 PlugInOpDescriptor* pOpDesc = new PlugInOpDescriptor(OpToken, NewMenuText, pClass, gs); 00187 if (pOpDesc == NULL) 00188 return FALSE; 00189 00190 return TRUE; 00191 }
|
|
Definition at line 152 of file plugopun.h. |