fe::IExtension Class Reference
[Ferry Extensions library]

Interface to control external components customizing editor from outside of an editor. More...

List of all members.

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


Detailed Description

Interface to control external components customizing editor from outside of an editor.

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.

Note:
This class is declared with UC_DLL_INTERFACE_DECLARE

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.


Member Function Documentation

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:

  • if this editor extension does some initialization when this method is called and that initialization fails;
  • if implementation doesn't support attach to multiple editors and if this editor extension is attached to some editor already;
  • if implementation supports attach to multiple editors on condition they run their event loops in the same thread and if this editor extension is attached to some editor(s) already and the given editor runs its event loop in a different thread;
    Note:
    Implementation can use Fe_IsFromTheSameThread() function to detect if two editors run their event loops in the same thread.
  • any other implementation specific reason.

Parameters:
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.

Parameters:
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.

Parameters:
editor handle to the target editor.


The documentation for this class was generated from the following file:

Generated on Tue Nov 18 21:08:23 2008 for Ferry by doxygen 1.5.7.1
http://sourceforge.net