fe::ReadOnlyTrigger Class Reference
[Ferry Core library]

Helper to control interactive text modifications in editor. More...

List of all members.

Public Member Functions

void disable ()
 ReadOnlyTrigger (FeHandle *editor, bool setReadonly=true)
 ~ReadOnlyTrigger ()


Detailed Description

Helper to control interactive text modifications in editor.

This class is intended for temporary enabling or disabling of interactive text modifications for some editor. Constructor takes one action and destructor takes an opposite.

See also:
fe::EditorFacadePolicy::textReadonly

Constructor & Destructor Documentation

fe::ReadOnlyTrigger::ReadOnlyTrigger ( FeHandle *  editor,
bool  setReadonly = true 
) [inline, explicit]

Disables or enables interactive text modifications for the given editor.

Parameters:
editor handle to the target editor;
setReadonly controls if to enable or disable interactive text modifications for the target editor.

fe::ReadOnlyTrigger::~ReadOnlyTrigger (  )  [inline]

Does nothing if disable() has been called. Otherwise enables (if ReadOnlyTrigger(FeHandle*, bool) disabled) or disables (if ReadOnlyTrigger(FeHandle*, bool) enabled) interactive text modifications for the encapsulated editor.

Note:
As it is illegal to throw exceptions from destructor there is no way to propagate error that may occur as a result of calling functions on the encapsulated editor. The effect is that caller can't know if action taken on the editor when this fe::ReadOnlyTrigger instance was constructed, get reverted after the instance is destroyed. The workaround is to call fe::IEditorFacade::getPolicy() on the editor and test value of fe::EditorFacadePolicy::textReadonly field of the return value.


Member Function Documentation

void fe::ReadOnlyTrigger::disable (  )  [inline]

Instructs ~ReadOnlyTrigger() to do nothing.


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