(new in Rev2.40)
MQBasePlugin class is a base class for all types of plug-ins. It is available as a class library by adding MQBasePlugin.cpp and MQBasePlugin.h to a project. You can make a command plug-in with a simple implementation and without taking care of complex message procedures by returning an inherited class in GetPluginClass().
Several plug-in functions are declared as virtual functions in MQBasePlugin class. It is necessary to implement them in an inherited class.
Class | |
MQBasePlugin | Constructor |
~MQBasePlugin | Destructor |
Plug-in | |
GetPlugInID | Get a plug-in ID |
GetPlugInName | Get a plug-in name |
GetPlugInType | Get a type of a plug-in |
Supplemental functions | |
OpenSetting | Get a setting file |
CloseSetting | Close a setting file |
SendUserMessage | Send a plugin-in own message to the other plug-ins |
MQBasePlugin::MQBasePlugin();
It is a constructor.
virtual MQBasePlugin::~MQBasePlugin();
It is a destructor. It is declared as a virtual function.
virtual void MQBasePlugin::GetPlugInID(DWORD *Product, DWORD *ID);
It returns a product(author) name and a product ID as a 64-bit value.
The 'Product' and 'ID' can be random values which do not overlap with others.
This method is declared as a pure virtual function. It conceals MQGetPlugInID() by implementing in an inherited class.
virtual const char *MQBasePlugin::GetPlugInName();
It returns a plug-in name to display on the [About plug-ins] dialog.
This method is declared as a pure virtual function. It conceals MQGetPlugInName() by implementing in an inherited class.
virtual int MQBasePlugin::GetPlugInType();
It returns a type of the plug-in.
This method is declared as a pure virtual function. It conceals MQGetPlugInType() by implementing in an inherited class.
MQSetting *MQBasePlugin::OpenSetting();
It gets a class to access to a "metaseq.ini" file to save settings of Metasequoia. You can load and save plug-in original settings through the class.
The setting class must be delete by CloseSetting().
void MQBasePlugin::CloseSetting(MQSetting *setting);
It closes a setting object opened by OpenSetting().
int MQBasePlugin::SendUserMessage(MQDocument doc, DWORD target_product, DWORD target_id, const char *description, void *param);
(new in Rev2.41)
It sends an arbitrary message to the other station or command plug-in.
You can send an arbitrary data to the target plug-in by storing a pointer in message.
The message will be sent to all plug-in when you set 0 to target_product and 0 to target_id.
The message is received in MQStationPlugin::OnReceiveUserMessage() of the target plug-in.
Attention: The return value cannot be received correctly in Ver2.4.4 or older version.