Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

RS_BlockList Class Reference

List of blocks. More...

#include <rs_blocklist.h>

List of all members.

Public Member Functions

 RS_BlockList (bool owner=false)
 Constructor.
void clear ()
 Removes all blocks in the blocklist.
int count ()
RS_Blockat (int i)
void activate (const RS_String &name)
 Activates the given block.
void activate (RS_Block *block)
 Activates the given block.
RS_BlockgetActive ()
virtual bool add (RS_Block *block, bool notify=true)
 Adds a block to the block list.
virtual void addNotification (RS_Block *block)
 Notifies the listeners about blocks that were added.
virtual void remove (RS_Block *block)
 Removes a block from the list.
virtual bool rename (RS_Block *block, const RS_String &name)
 Tries to rename the given block to 'name'.
RS_Blockfind (const RS_String &name)
RS_String newName (const RS_String &suggestion="")
 Finds a new unique block name.
void toggle (const RS_String &name)
 Switches on / off the given block.
void toggle (RS_Block *block)
 Switches on / off the given block.
void freezeAll (bool freeze)
 Freezes or defreezes all blocks.
void addListener (RS_BlockListListener *listener)
 adds a BlockListListener to the list of listeners.
void removeListener (RS_BlockListListener *listener)
 removes a BlockListListener from the list of listeners.
void setModified (bool m)
 Sets the layer lists modified status to 'm'.
virtual bool isModified () const

Friends

std::ostream & operator<< (std::ostream &os, RS_BlockList &b)


Detailed Description

List of blocks.

See also:
RS_Block
Author:
Andrew Mustun


Constructor & Destructor Documentation

RS_BlockList::RS_BlockList bool  owner = false  ) 
 

Constructor.

Parameters:
owner true if this is the owner of the blocks added. If so, the blocks will be deleted when the block list is deleted.


Member Function Documentation

void RS_BlockList::activate RS_Block block  ) 
 

Activates the given block.

Listeners are notified.

void RS_BlockList::activate const RS_String &  name  ) 
 

Activates the given block.

Listeners are notified.

bool RS_BlockList::add RS_Block block,
bool  notify = true
[virtual]
 

Adds a block to the block list.

If a block with the same name exists already, the given block will be deleted if the blocklist owns the blocks.

Parameters:
notify true if you want listeners to be notified.
Returns:
false: block already existed and was deleted.

void RS_BlockList::addListener RS_BlockListListener listener  ) 
 

adds a BlockListListener to the list of listeners.

Returns:
Next block from the list after calling firstBlock() or nextBlock().

void RS_BlockList::addNotification RS_Block block  )  [virtual]
 

Notifies the listeners about blocks that were added.

This can be used after adding a lot of blocks without auto-update or simply to force an update of GUI blocklists.

RS_Block* RS_BlockList::at int  i  )  [inline]
 

Returns:
Block at given position or NULL if 'i' is out of range.

int RS_BlockList::count  )  [inline]
 

Returns:
Number of blocks available.

RS_Block * RS_BlockList::find const RS_String &  name  ) 
 

Returns:
Pointer to the block with the given name or NULL if no such block was found.

void RS_BlockList::freezeAll bool  freeze  ) 
 

Freezes or defreezes all blocks.

Parameters:
freeze true: freeze, false: defreeze

RS_Block* RS_BlockList::getActive  )  [inline]
 

Returns:
The active block of NULL if no block is activated.

virtual bool RS_BlockList::isModified  )  const [inline, virtual]
 

Return values:
true The layer list has been modified.
false The layer list has not been modified.

RS_String RS_BlockList::newName const RS_String &  suggestion = ""  ) 
 

Finds a new unique block name.

Parameters:
suggestion Suggested name the new name will be based on.

void RS_BlockList::remove RS_Block block  )  [virtual]
 

Removes a block from the list.

Listeners are notified after the block was removed from the list but before it gets deleted.

bool RS_BlockList::rename RS_Block block,
const RS_String &  name
[virtual]
 

Tries to rename the given block to 'name'.

Block names are unique in the block list.

Return values:
true block was successfully renamed.
false block couldn't be renamed.

void RS_BlockList::toggle RS_Block block  ) 
 

Switches on / off the given block.

Listeners are notified.

void RS_BlockList::toggle const RS_String &  name  ) 
 

Switches on / off the given block.

Listeners are notified.


The documentation for this class was generated from the following files:
Generated on Sat Jan 6 13:48:22 2007 for qcadlib by  doxygen 1.4.4