rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
List of all members | Public Member Functions
IlvModifiedFlagObserver Class Reference

Reports the modifications made to a document. More...

#include <ilviews/base/command.h>

Inheritance diagram for IlvModifiedFlagObserver:
IlvObserver

Public Member Functions

 IlvModifiedFlagObserver (IlvCommandHistory *h)
 Constructor. More...
 
virtual void flagChanged (IlBoolean b)
 Indicates whether the state of the document has changed. More...
 
void update (IlvObservable *, IlAny)
 Notifying member function called by observables. More...
 
- Public Member Functions inherited from IlvObserver
 IlvObserver ()
 Constructor. More...
 
virtual void attach (IlvObservable *o)
 Attach the observer to an observable. More...
 
virtual void detach (IlvObservable *o)
 Detach the observer from an observable. More...
 
IlBoolean observes (IlvObservable *o) const
 Tells if the observer is attached to a given observable. More...
 

Detailed Description

Reports the modifications made to a document.

Library: views

In many applications, an asterisk (*) is added to the title of a window to indicate that the document it contains is different from its image stored to a file, and that it needs to be saved when the user quits the application.
The class IlvModifiedFlagObserver defines an observer that reports any changes in the "modified" status of a document attached to an IlvCommandHistory object. This functionality is implemented by redefining the flagChanged method in a subclass. When the flagChanged method is called with IlTrue, the title of the window displaying the associated document is modified to include an asterisk. When it is called with IlFalse, the asterisk is removed.
This observer works by watching all the IlvCommand objects attached to a command history. If these commands are IlvPseudoCommand objects, they do not modify the document, and flagChanged is not affected.

See Also
IlvCommand, IlvCommandHistory, IlvManager

Constructor & Destructor Documentation

IlvModifiedFlagObserver::IlvModifiedFlagObserver ( IlvCommandHistory h)

Constructor.

Parameters
hThe command history to which the observer will be attached to track any changes in its "modified" status.

Member Function Documentation

virtual void IlvModifiedFlagObserver::flagChanged ( IlBoolean  b)
virtual

Indicates whether the state of the document has changed.

You should implement this method in a subclass to define the visual cue that will reflect any modifications made to the document attached to the command history.

Parameters
bThe new value of the flag. Is IlFalse if the document has not changed, and IlTrue otherwise.
void IlvModifiedFlagObserver::update ( IlvObservable o,
IlAny  arg 
)
virtual

Notifying member function called by observables.

Must be defined in subclasses to implement the notification mechanism.

Parameters
oObservable whose state has changed.
argAny argument commonly agreed between the observer and the observable that should help the observer in determining what exactly in the state of the observable has changed.
See Also
IlvActionMessage for an example of use of this parameter.

Reimplemented from IlvObserver.


© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.