(new in Rev2.40)
MQImportPlugin class inherits MQBasePlugin class, and provides functions necessary for an implementation of an import plug-in.
You can make a import plug-in with a simple implementation and without taking care of complex message procedures between a plug-in and a main part of Metasequoia by inheriting this MQImportPlugin class and implementing required virtual functions.
In MQImportPlugin class, each plug-in member functions and messages are declared as virtual functions. It is necessary to implement the virtual function in the inherited class.
| Class | |
| MQImportPlugin | Constructor |
| ~MQImportPlugin | Destructor |
| Declared in super class | |
| GetPlugInID | Get a plug-in ID |
| GetPlugInName | Get a plug-in name |
| Plug-in | |
| GetPlugInType | Get a plug-in type |
| EnumFileType | Enumerate file types |
| EnumFileExt | Enumerate file extensions |
| ImportFile | Load a file |
| SupportBackground | Whether to support a background loading |
| Message procedure | |
| IsBackground | A message for activating or deactivation a window |
| GetImportOptions | A message for checking an activated state of a plug-in |
| IsCanceled | A message for minimizing a window |
| SetProgress | A message for receiving a plug-in own message |
| Supplemental functions for the super class | |
| OpenSetting | Open a setting file |
| CloseSetting | Close a setting file |
| GetResourceString | Get a resource string |
| GetSettingValue | Get a setting value |
| GetSystemColor | Get a system color |
| GetResourceCursor | Get a default mouse cursor |
| GetScreenMouseCursor | Get a mouse cursor for a screen |
| SetScreenMouseCursor | Set a mouse cursor for a screen |
| GetLUTCount | Get a number of LUTs |
| GetLUTName | Get a LUT's name |
| GetLUTData | Get LUT data |
| GetSceneOption | Get display options of the scene |
| GetEditOption | Get edit options |
| GetDisplayUnit | Get a display unit |
| GetDisplayUnitString | Get display unit's string and scale/td> |
| GetFilename | Get a filename |
| SaveDocument | Save a document |
| InsertDocument | Insert a document |
| EnumLoadableImages | Get loadable image formats |
| SendUserMessage | Send a plugin-in own message to the other plug-ins |
| SetDrawProxyObject | Set a draw proxy object |
| UpdateUndo | Update an undo buffer |
MQImportPlugin::MQImportPlugin();
This method is a constructor.
virtual MQImportPlugin::~MQImportPlugin();
This method is a destructor. It is defined as a virtual function.
virtual int MQImportPlugin::GetPlugInType();
This method implements a virtual function declared by MQBasePlugin::GetPlugInType(). No additional implementation is necessary in an inherited class.
virtual const char *MQImportPlugin::EnumFileType(int index);
It gets a file extension with the specified index. The extension is used in a file dialog.
This function is called when Metasequoia starts up. The 'index' is called sequentially from 0, and the call ends when this function returns NULL.
This method implements a virtual function declared by MQEnumFileType(). No additional implementation is necessary in an inherited class.
virtual const char *MQImportPlugin::EnumFileExt(int index);
It gets a file extension with the specified index. The extension is used in a file dialog.
This function is called when Metasequoia starts up. The 'index' is called sequentially from 0, and the call ends when this function returns NULL.
This method implements a virtual function declared by MQEnumFileExt(). No additional implementation is necessary in an inherited class.
virtual BOOL MQImportPlugin::ImportFile(int index, const wchar_t *filename, MQDocument doc);
It loads data from a file and adds objects to a document.
It must return FALSE when it cannot load the file normally, the file contains unknown format, no valid object exists canceled, or an error has been occurred.
This method implements a virtual function declared by MQImportFileW(). No additional implementation is necessary in an inherited class.
(in Rev4.70)
A type of filename has been changed from char to wchar_t.
virtual BOOL MQImportPlugin::SupportBackground(void);
(new in Rev4.20)
It returns whether to support a background loading or not.
It is necessary to check if the loading is a background process by IsBackground() and to cancel the process by calling IsCanceled() periodically when a background loading is supported.
This method is declared as a virtual function, and it is implemented in an inherited class. If it is not implemented in the inherited class, it returns FALSE by an implementation in a super class.
BOOL MQImportPlugin::IsBackground(void);
(new in Rev4.20)
It returns whether the loading is background or foreground.
A background loading is processed in a sub thread. It is necessary to support a canceling, not to call GUI procedures; like as showing a dialog, changing a cursor and so on; and to support a multi-threading without global variables.
MQWidget does not a multi-threading and it will occur an error by using in a sub thread. MQ_ShowFileDialog() can support a background process by setting appropriate variables.
void *MQImportPlugin::GetImportOptions(void);
(new in Rev4.20)
It returns import options for 'option_args' in variables of MQ_ShowFileDialog().
BOOL MQImportPlugin::IsCanceled(void);
(new in Rev4.20)
It returns whether the loading is canceled or not during processing.
Please call this member periodically when a background loading is processed. A response for a user will get worse if the interval is long, and a process will be slower by too much call. Please call in a reasonable interval.
It always returns FALSE when the loading is not background.
void MQImportPlugin::SetProgress(float progress);
(new in Rev4.20)
It specifies a current progressive status.
Please call this member periodically when a background loading is processed.