Rhino C++ API
8.13
|
#include <RhinoSdkPlugInManager.h>
Public Member Functions | |
CRhinoPlugInRecord () | |
CRhinoPlugInRecord (const CRhinoPlugInRecord &) | |
~CRhinoPlugInRecord () | |
void | AddCommand (const wchar_t *lpsEnglishCommandName, const wchar_t *lpsLocalizedCommandName, int nFlags=0) |
void | AddFileTypes (const wchar_t *lpsDescr, const wchar_t *lpsExtensions) |
bool | AddToHelpMenu () const |
int | CommandRecordCount () const |
bool | ContainsCommandNamed (const wchar_t *lpsCmdName, bool bEnglishCommandName) const |
const wchar_t * | Description () const |
const wchar_t * | EnglishCommandName (int nIndex) const |
const wchar_t * | EnglishName () const |
const wchar_t * | FileName () const |
const CRhinoFileType & | FileType (int index) const |
int | FileTypeCount () const |
const ON_ClassArray< CRhinoFileType > & | FileTypes () const |
const CRhinoPlugInCommandRecord * | GetCommandRecord (int nIndex) const |
HICON | Icon (const ON_2iSize &size) |
HINSTANCE | Instance () const |
bool | IsDirectoryInstall () const |
bool | IsDotNETPlugIn () const |
bool | IsLoadDisabled () const |
bool | IsLoaded () const |
bool | IsPackageManagerPlugIn () const |
bool | IsShippingPlugIn () const |
Is this plug-in one that ships with Rhino. More... | |
bool | LoadAttempted () const |
int | LoadAttemptedCount () const |
int | LoadOrder () const |
int | LoadProtection () const |
const wchar_t * | LocalizedCommandName (int) const |
const wchar_t * | Name () const |
const CRhinoPlugInRecord & | operator= (const CRhinoPlugInRecord &) |
CRhinoPlugIn * | PlugIn () const |
const CRhinoPlugInInfo & | PlugInInfo () const |
int | PlugInLoadTime () const |
CRhinoPlugIn::plugin_type | PlugInType () const |
const wchar_t * | PlugInTypeString () const |
UUID | PlugInUUID () const |
int | PreviousPlugInLoadTime () const |
const wchar_t * | RegistryPath () const |
void | SetLoadProtection (int load_protection) |
Static Public Member Functions | |
static bool | IsPackageManagerPlugIn (const wchar_t *path) |
static const wchar_t * | PlugInTypeString (CRhinoPlugIn::plugin_type type) |
Protected Attributes | |
bool | m_bAddToHelpMenu = false |
bool | m_bIsDotNETAndIsLoaded = false |
bool | m_bIsDotNETPlugIn = false |
ON_ClassArray< CRhinoPlugInCommandRecord > | m_command_list |
ON_ClassArray< CRhinoFileType > | m_file_types |
HINSTANCE | m_hInstance = nullptr |
int | m_load_order = -1 |
int | m_nLoadAttempts = 0 |
int | m_nLoadMode = CRhinoPlugIn::load_plugin_when_needed |
int | m_nLoadProtection = 0 |
int | m_nPreviousLoadMode = -1 |
initialized to -1, set whenever the load mode value of a plug-in is written to the registry More... | |
int | m_on_classid_mark = -1 |
CRhinoPlugIn * | m_plug_in = nullptr |
UUID | m_plug_in_id = ON_nil_uuid |
CRhinoPlugInInfo | m_plug_in_info |
CRhinoPlugIn::plugin_type | m_type = CRhinoPlugIn::unknown_plugin_type |
ON_wString | m_wFileName |
ON_wString | m_wName |
ON_wString | m_wRegPath |
Friends | |
class | CPlugInManagerDlg |
class | CRhInstallPlugIn |
class | CRhPlugInManager |
This class is used to manage loaded and unloaded plug-ins.
CRhinoPlugInRecord::CRhinoPlugInRecord | ( | ) |
CRhinoPlugInRecord::CRhinoPlugInRecord | ( | const CRhinoPlugInRecord & | ) |
CRhinoPlugInRecord::~CRhinoPlugInRecord | ( | ) |
void CRhinoPlugInRecord::AddCommand | ( | const wchar_t * | lpsEnglishCommandName, |
const wchar_t * | lpsLocalizedCommandName, | ||
int | nFlags = 0 |
||
) |
Description: Add English and localized command names to appropriate list. Parameters: lpsEnglishCommandName - [in] English command name. lpsLocalizedCommandName - [in] Localized command name (may be same as English if not localized) nFlags - [in] See CRhinoCommand::m_cmd_flags for a description of flags.
void CRhinoPlugInRecord::AddFileTypes | ( | const wchar_t * | lpsDescr, |
const wchar_t * | lpsExtensions | ||
) |
Description: Add to list of file types associated with a CRhinoFileImport or CRhinoFileExport plug-in that is registered but not loaded. This is used by the Rhino file dialog when displaying file types. Parameters: lpsDescr - [in] File type description. lpsExtensions - [in] File extensions supported by this description.
bool CRhinoPlugInRecord::AddToHelpMenu | ( | ) | const |
Description: If the plug-in is loaded this will return the PlugIn()->AddToPlugInHelpMenu() otherwise it returns the value found in the registry. Returns: true If plug-in name is added to the Rhino Help/Plug-ins menu. See Also: CRhinoPlugIn::AddToPlugInHelpMenu()
int CRhinoPlugInRecord::CommandRecordCount | ( | ) | const |
Description: Length of command list.
bool CRhinoPlugInRecord::ContainsCommandNamed | ( | const wchar_t * | lpsCmdName, |
bool | bEnglishCommandName | ||
) | const |
Description: Search list of registered command names for specified command name. This is used when looking for command names associated with a registered but unloaded plug-in. Parameters: lpsCmdName - [in] Command name to search for. bEnglishCommandName - [in] If true then look in the english command name list otherwise look in the localized command name list. Returns: true If command name found.
const wchar_t* CRhinoPlugInRecord::Description | ( | ) | const |
Description: If the plug-in is loaded this will return PlugIn()->PlugInDescription(), otherwise it returns the plug-in description found in CRhinoPlugInInfo. Returns: Description of this plug-in. See Also: CRhinoPlugIn::PlugInDescription()
const wchar_t* CRhinoPlugInRecord::EnglishCommandName | ( | int | nIndex | ) | const |
const wchar_t* CRhinoPlugInRecord::EnglishName | ( | ) | const |
Added by John Morse 17 February 2021 Description: If the plug-in is loaded this will return PlugIn()->PlugInName(), otherwise it returns the English plug-in name found in the registry. Returns: Name used to describe this plug-in. See Also: CRhinoPlugIn::PlugInName()
const wchar_t* CRhinoPlugInRecord::FileName | ( | ) | const |
Description: Full path to the plug-in file to load or the loaded file name. Returns: Full path to plug-in file.
const CRhinoFileType& CRhinoPlugInRecord::FileType | ( | int | index | ) | const |
Description: Used to iterate file type list. If invalid index is passed then a bogus, empty CRhinoFileType reference is returned. Returns: Length of file type list. See Also: CRhinoPlugInRecord::AddFileTypes() CRhinoFileType CRhinoFileImportPlugIn::AddFileType CRhinoFileExportPlugIn::AddFileType
int CRhinoPlugInRecord::FileTypeCount | ( | ) | const |
Description: Length of file type list associated with file import/export plug-in.
const ON_ClassArray<CRhinoFileType>& CRhinoPlugInRecord::FileTypes | ( | ) | const |
const CRhinoPlugInCommandRecord* CRhinoPlugInRecord::GetCommandRecord | ( | int | nIndex | ) | const |
Description: Used to iterate list of registered commands associated with this plug-in. Returns: Pointer to a CRhinoPlugInCommandRecordif nIndex is valid otherwise NULL. Parameters: nIndex - [in] Zero based index of command to return. Value must be >= 0 and less than CommandRecordCount()
HICON CRhinoPlugInRecord::Icon | ( | const ON_2iSize & | size | ) |
Description: If the plug-in is loaded this will return PlugIn()->PlugInIcon(), otherwise it create a new icon based on the resource id found in CRhinoPlugInInfo. Returns: The plug-in's icon. See Also: CRhinoPlugIn::PlugInIcon()
HINSTANCE CRhinoPlugInRecord::Instance | ( | ) | const |
Description: Instance handle for loaded Rhino RHP plug-in file. Returns: Instance handle for loaded Rhino RHP plug-in file or NULL if not loaded.
bool CRhinoPlugInRecord::IsDirectoryInstall | ( | ) | const |
bool CRhinoPlugInRecord::IsDotNETPlugIn | ( | ) | const |
Description: Determine if the plug-in is a .NET plug-in or a C++ plug-in; Returns: true If plug-in is a .NET plug-in
bool CRhinoPlugInRecord::IsLoadDisabled | ( | ) | const |
Description: This will check to see if PlugInLoadTime() is set to CRhinoPlugIn::load_plugin_disabled Returns: True if plug-in is not currently loaded and PlugInLoadTime() == CRhinoPlugIn::load_plugin_disabled See Also: CRhinoPlugIn::plugin_load_time CRhinoPlugIn::PlugInLoadTime()
bool CRhinoPlugInRecord::IsLoaded | ( | ) | const |
Description: Check to see if plug-in was successfully loaded. Returns: true If plug-in is currently loaded.
bool CRhinoPlugInRecord::IsPackageManagerPlugIn | ( | ) | const |
|
static |
bool CRhinoPlugInRecord::IsShippingPlugIn | ( | ) | const |
Is this plug-in one that ships with Rhino.
bool CRhinoPlugInRecord::LoadAttempted | ( | ) | const |
Description: Check to see if a previous attempt was made to load this plug-in. Returns: true If one or more attempts was made to load this plug-in.
int CRhinoPlugInRecord::LoadAttemptedCount | ( | ) | const |
Description: Number of attempts made to load this plug-in.
int CRhinoPlugInRecord::LoadOrder | ( | ) | const |
int CRhinoPlugInRecord::LoadProtection | ( | ) | const |
const wchar_t* CRhinoPlugInRecord::LocalizedCommandName | ( | int | ) | const |
const wchar_t* CRhinoPlugInRecord::Name | ( | ) | const |
Description: If the plug-in is loaded this will return PlugIn()->LocalPlugInName(), otherwise it returns the plug-in name found in the registry. Returns: Name used to describe this plug-in. See Also: CRhinoPlugIn::PlugInName()
const CRhinoPlugInRecord& CRhinoPlugInRecord::operator= | ( | const CRhinoPlugInRecord & | ) |
CRhinoPlugIn* CRhinoPlugInRecord::PlugIn | ( | ) | const |
Description: If this plug-in has been loaded this will be a pointer to the one and only CRhinoPlugIn... derived application object. Returns: Pointer to plug-in application object or NULL if the plug-in has not yet been loaded. See Also: CRhinoPlugIn
const CRhinoPlugInInfo& CRhinoPlugInRecord::PlugInInfo | ( | ) | const |
Description: This method is used to get information about the plug-in. Returns: Reference to a CRhinoPlugInInfo item which describes this plug-in. See Also: CRhinoPlugInInfo
int CRhinoPlugInRecord::PlugInLoadTime | ( | ) | const |
Description: If the plug-in is loaded this will return the PlugIn()->PlugInLoadTime() otherwise it returns the plug-in load time value found in the registry. Returns: load_plug-in_when_needed = Plug-in will not be loaded when Rhino starts. Plug-in will be loaded when a plug-in defined command is run or when a user selects a plug-in defined file import/export type. load_plug-in_at_startup = Plug-in is loaded when Rhino is loaded and initialized. See Also: CRhinoPlugIn::plugin_load_time CRhinoPlugIn::PlugInLoadTime()
CRhinoPlugIn::plugin_type CRhinoPlugInRecord::PlugInType | ( | ) | const |
Description: If the plug-in is loaded this will return the PlugIn()->PlugInType() otherwise it returns the plug-in type flag found in the registry. Returns: Returns CRhinoPlugIn::plug-in_type, see CRhinoPlugIn::plug-in_type for details. See Also: CRhinoPlugIn::plug-in_type CRhinoPlugIn::PlugInType()
const wchar_t* CRhinoPlugInRecord::PlugInTypeString | ( | ) | const |
Description: Get a localized description for PlugInType() associated with this record. Returns: Returns localized description for PlugInType() associated with this record. See Also: CRhinoPlugIn::plug-in_type CRhinoPlugIn::PlugInType()
|
static |
Description: Get a localized description for specified CRhinoPlugIn::plugin_type. Parameters: type - [in] Type of plug-in. Returns: Returns localized description for PlugInType() associated with this record. See Also: CRhinoPlugIn::plug-in_type CRhinoPlugIn::PlugInType()
UUID CRhinoPlugInRecord::PlugInUUID | ( | ) | const |
Description: If the plug-in is loaded this will return the PlugIn()->PlugInID() otherwise it returns the registry UUID key name. Returns: Reference to a unique plug-in UUID. See Also: CRhinoPlugIn::PlugInID()
int CRhinoPlugInRecord::PreviousPlugInLoadTime | ( | ) | const |
const wchar_t* CRhinoPlugInRecord::RegistryPath | ( | ) | const |
Description: Complete registry path used to describe where the plug-in load information may be found. Returns: Full path to registry entry used to load the plug-in.
void CRhinoPlugInRecord::SetLoadProtection | ( | int | load_protection | ) |
Description: Lets you set load protection. This value is saved in the HKEY_CURRENT_USER section of the registry. and determines how the plug-in will load next time. This is NOT the way SAFEMODE prevents loading of plug-ins. Parameters: load_protection - [in] 0,1: silent load 2: query load - when the plug-in manager attempts to load the plug-in, a modal Yes/No message box pops up and asks the user if they want to load the plug-in. any other value: treated as 2.
|
friend |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Added by Dale Lear 25 February 2004
In SDK's with RHINO_SDK_SERVICE_RELEASE >= 200402250. We need a way for Rhino to prevent loading of certain plug-ins that are known to cause trouble. The default load protection is 0. If a user decides a certain plug-in is causing trouble, they can use the plug-in manager to add load protection. The reason that both the 0 and 1 values mean silent loading is so that we don't waste time saving the default information in registry unless we are actually dealing with a plug-in where the user has explicitly changed the load protection.
0 = silently load - (default setting) 1 = silently load - (setting came from registry) 2 = query load (yes/no modal message box)
The PlugInManager command provides UI for changing setting the load protection to silent load or query load.
The non-default load permissions are stored in HKEY_CURRENT_USER...\Global Settings\Plug-ins<plug-in uuid>\LoadProtection so that ordinary users (non-administrators) can control loading of buggy plug-ins.
Use CRhinoPlugIn::SaveLoadProtectionToRegistry(plug-in_uuid,m_LoadProtection)
to save this value if it is ever changed.
ALERT - snotty comment follows: Because the CRhPlugInManager has become such a twisted pile of crap, this value has to be stored on 2 different classes: CRhinoPlugInRecord::m_nLoadProtection CRhinoInstallPlugIn::m_nLoadProtection and kept in sync. In V4 the information on these three similar classes will be stored in a SINGLE CLASS. There will be ONE instance of the class for each UNIQUE plug-in. The values on this new class will indicate the status of the plug-in. The settings on this class will be stored someplace that ordinary users have permission to write. End of rant.
Please discuss changes with Dale Lear.
|
protected |
initialized to -1, set whenever the load mode value of a plug-in is written to the registry
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
From registered but not loaded class