PlugInHandler Class Reference

Provides specific characteristics of a type of plug-in. This includes the type of file which the plug-in in usually stored in. This provides the basis of which a handler is derived from. More...

#include <plugmngr.h>

Inheritance diagram for PlugInHandler:

ListItem CCObject SimpleCCObject BfxHandler List of all members.

Public Member Functions

 PlugInHandler ()
 Main constructor for the plug-in handler in Camelot.
 ~PlugInHandler ()
 Main destructor for the plug-in handler in Camelot.
virtual BOOL Init ()=0
 Declares a preference that allows you to clear memory in delete().
virtual BOOL AddFixedPlugIns ()
 Add any fixed plug-ins to the list in the plug-in manager and register the op descriptor to the system. By fixed, I mean those which are not file related and hence will be loaded when the specified paths are parsed for plug-ins. This baseclass version does nothing.
virtual BOOL AddPlugIn (PlugInItem *pPlugIn, CCRuntimeClass *pClass=CC_RUNTIME_CLASS(PlugInOp), pfnGetState gs=PlugInOp::GetState)
 Add a plug-in to the list in the plug-in manager and register the op descriptor to the system.
virtual BOOL ParsePlugIn (const PathName &Path, const INT32 PathID)=0
virtual BOOL CreateMainMenuItems (PlugInManager *pManager, MenuItem *pRootMenu, BOOL AddSeparator=FALSE)
 After the plug in list has been sorted alphabetically we must add each item in the list to the main plug-in menu. This is a handler's chance to insert menu options into this menu. This baseclass version does nothing and so needs to be overridden by a handler to do something useful.
virtual BOOL GoingToAddMainMenuItems ()
virtual String_32 GetUniqueID () const =0
virtual TypeOfPlugIn GetTypeOfPlugIn () const =0
virtual String_32 GetFileTypes () const =0

Private Member Functions

 CC_DECLARE_DYNAMIC (PlugInHandler)

Detailed Description

Provides specific characteristics of a type of plug-in. This includes the type of file which the plug-in in usually stored in. This provides the basis of which a handler is derived from.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/12/96

Definition at line 136 of file plugmngr.h.


Constructor & Destructor Documentation

PlugInHandler::PlugInHandler  ) 
 

Main constructor for the plug-in handler in Camelot.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/12/96

Definition at line 172 of file plugmngr.cpp.

00173 {
00174 }

PlugInHandler::~PlugInHandler  ) 
 

Main destructor for the plug-in handler in Camelot.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/12/96

Definition at line 186 of file plugmngr.cpp.

00187 {
00188 }


Member Function Documentation

BOOL PlugInHandler::AddFixedPlugIns  )  [virtual]
 

Add any fixed plug-ins to the list in the plug-in manager and register the op descriptor to the system. By fixed, I mean those which are not file related and hence will be loaded when the specified paths are parsed for plug-ins. This baseclass version does nothing.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/3/97
Parameters:
- [INPUTS]
Returns:
True if worked, False otherwise

Reimplemented in BfxHandler.

Definition at line 206 of file plugmngr.cpp.

00207 {
00208     return TRUE;
00209 }

BOOL PlugInHandler::AddPlugIn PlugInItem pPlugIn,
CCRuntimeClass pClass = CC_RUNTIME_CLASS(PlugInOp),
pfnGetState  gs = PlugInOp::GetState
[virtual]
 

Add a plug-in to the list in the plug-in manager and register the op descriptor to the system.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/12/96
Parameters:
pPlugIn the new PlugInItem to add to the list [INPUTS] pClass the operation handling class to use gs the GetState function to use
Returns:
True if worked, False otherwise

Reimplemented in BfxHandler.

Definition at line 227 of file plugmngr.cpp.

00228 {
00229     PlugInManager* pManager = GetApplication()->GetPlugInManager();
00230     if (pManager == NULL)
00231         return FALSE;
00232     
00233     if (!pManager->AddPlugIn(pPlugIn))
00234         ERROR2(FALSE,"Failed to register a plug-in with plug-in manager");
00235 
00236     // Make up a unique name for the plug in
00237     String_32 OpToken = GetUniqueID();
00238     OpToken += pPlugIn->GetPlugInName();
00239     // Register this name as an OpDescriptor to the system so that we can use it
00240     // on menus etc.
00241     if (!PlugInOp::RegisterOpToken(OpToken, pPlugIn->GetPlugInName(), pClass, gs))
00242         ERROR2(FALSE,"Failed to register OpToken for a plug-in");
00243 
00244     // Now see if the family name is registered, if not then register it
00245     OpToken = GetUniqueID();
00246     OpToken += pPlugIn->GetFamilyName();
00247     OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OpToken);
00248     if (pOpDesc == NULL)
00249     {
00250         // Register this name as an OpDescriptor to the system so that we can use it
00251         // on menus etc.
00252         if (!PlugInOp::RegisterOpToken(OpToken, pPlugIn->GetFamilyName(), pClass, gs))
00253             ERROR2(FALSE,"Failed to register OpToken for a plug-in family name");
00254     }
00255 
00256     return TRUE;
00257 }

PlugInHandler::CC_DECLARE_DYNAMIC PlugInHandler   )  [private]
 

BOOL PlugInHandler::CreateMainMenuItems PlugInManager pManager,
MenuItem pRootMenu,
BOOL  AddSeparator = FALSE
[virtual]
 

After the plug in list has been sorted alphabetically we must add each item in the list to the main plug-in menu. This is a handler's chance to insert menu options into this menu. This baseclass version does nothing and so needs to be overridden by a handler to do something useful.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/1/97
Parameters:
pManager the plug-in manager to get at useful things like the plug-in list [INPUTS] pRootMenu The root of the main menu to add the items to AddSeparator True if want a separator added to the last item on the menu
- [OUTPUTS]
Returns:
True if the operation completed successfully False if it failed in some way.

Reimplemented in BfxHandler.

Definition at line 280 of file plugmngr.cpp.

00282 {
00283     ERROR2IF(pManager == NULL || pRootMenu == NULL,FALSE,"CreateMainMenuItems bad parameters!");
00284 
00285     // This baseclass version does nothing
00286     return TRUE;
00287 }

virtual String_32 PlugInHandler::GetFileTypes  )  const [pure virtual]
 

Implemented in BfxHandler.

virtual TypeOfPlugIn PlugInHandler::GetTypeOfPlugIn  )  const [pure virtual]
 

Implemented in BfxHandler.

virtual String_32 PlugInHandler::GetUniqueID  )  const [pure virtual]
 

Implemented in BfxHandler.

virtual BOOL PlugInHandler::GoingToAddMainMenuItems  )  [inline, virtual]
 

Reimplemented in BfxHandler.

Definition at line 165 of file plugmngr.h.

00165 { return FALSE; }

virtual BOOL PlugInHandler::Init void   )  [pure virtual]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

Implemented in BfxHandler.

virtual BOOL PlugInHandler::ParsePlugIn const PathName Path,
const INT32  PathID
[pure virtual]
 

Implemented in BfxHandler.


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