Public Member Functions | |
virtual bool UC_DLL_CALL | attachToEditor (FeHandle *editor)=0 |
virtual bool UC_DLL_CALL | detachFromEditor (FeHandle *editor)=0 |
virtual bool UC_DLL_CALL | isAttachedToEditor (FeHandle *editor) const =0 |
IExtension defines a uniform interface for various editor extensions (customizations).
Editor can be customized in various ways:
So IExtension hides details of concrete editor extension (customization).
Editor extension is an entity that should be configured before it is attached to an editor. Once it is attached to some editor it shouldn't be reconfigured. This is needed to simplify editor extension implementation.
fe::IExtensionFactory interface helps to keep editor extensions configuration and usage separated. Every fe::IExtensionFactory-based interface define methods for configuring a concrete editor extension. So every editor extension is actually addressed with a concrete fe::IExtensionFactory-based interface.
Implementation should guarantee that if instance of fe::IExtension-based class is attached to some editor(s) it is safe to delete such an instance and it should detach itself from all editors so that they don't reference invalid object.
virtual bool UC_DLL_CALL fe::IExtension::attachToEditor | ( | FeHandle * | editor | ) | [pure virtual] |
Should be called to attach this editor extension to the given editor. Implementation should return false
if this extension has been attached to the given editor already or if attach fails, otherwise implementation should return true
.
The following conditions can be considered by implementation as a reason to return false
:
editor | handle to the target editor. |
virtual bool UC_DLL_CALL fe::IExtension::detachFromEditor | ( | FeHandle * | editor | ) | [pure virtual] |
Should be called to detach this editor extension from the given editor. Implementation should return false
if this extension is not attached to the given editor or if detach fails, otherwise implementation should return true
.
editor | handle to the target editor. |
virtual bool UC_DLL_CALL fe::IExtension::isAttachedToEditor | ( | FeHandle * | editor | ) | const [pure virtual] |
Implementation should return true
if this extension is attached to the given editor or false
otherwise.
editor | handle to the target editor. |