ItemColors Class Reference

This class represents the list of the items with their associated id, color and color status (i.e the color has been changed or not). More...

#include <itemcolors.h>

Inheritance diagram for ItemColors:

Inheritance graph
[legend]
List of all members.

Public Types

enum  SelectionMode { BY_INDEX = 0, BY_ITEM_NUMBER = 1, BY_INDEX = 0, BY_ITEM_NUMBER = 1 }
enum  SelectionMode { BY_INDEX = 0, BY_ITEM_NUMBER = 1, BY_INDEX = 0, BY_ITEM_NUMBER = 1 }

Public Member Functions

 ItemColors (const ItemColors &itemcolors)
void removeAll ()
 Suppress all the elements of.
virtual QColor color (int identifier, SelectionMode mode=BY_ITEM_NUMBER)
 Returns the color for a item with a given id or position in the list (identifier).
virtual void setColor (int identifier, QColor color, SelectionMode mode=BY_ITEM_NUMBER)
 Sets the color for a item with a given id or position in the list (identifier) to color.
virtual int itemId (int index)
 Returns the item id corresponding to a given position in the list (index).
int itemIndex (int itemId) const
 Looks up for the item index of the item id itemId.
virtual QString itemLabel (int index)
 Returns the item label corresponding to a given position in the list (index).
virtual QString itemLabelById (int id)
 Returns the item label corresponding to a given item id (id).
virtual bool contains (int itemId)
 Returns true if the item Id exists false otherwise.
virtual bool isColorChanged (int identifier, SelectionMode mode=BY_ITEM_NUMBER)
 Returns true if the color for a item with a given id or position in the list (identifier) has been changed, otherwise returns false.
virtual void setColorChanged (int identifier, bool changed, SelectionMode mode=BY_ITEM_NUMBER)
 If changed is true, the color for a item with a given id or position in the list (identifier) is said to have changed, otherwise is said not to have changed.
virtual uint numberOfItems () const
 Returns the number of items.
virtual bool isColorChanged () const
 Returns true if at least the color of one item have changed, otherwise returns false.
virtual void setColorChanged (bool changed)
 Sets the color status for the entire list of items.
virtual uint append (int itemId, QColor color)
 Appends a item to the list of items, the label is set to the item id and the color status is set to false.
virtual uint append (int itemId, QString label, QColor color)
 Appends a item to the list of items, the color status is set to false.
virtual void insert (int itemId, QColor color, int index)
 Inserts a item at position index in the list of items, the label is set to the item id and the color status is set to false.
virtual void insert (int itemId, QString label, QColor color, int index)
 Inserts a item at position index in the list of items, the color status is set to false.
virtual bool remove (int identifier, SelectionMode mode=BY_ITEM_NUMBER)
 Removes a item, with a given id or position in the list (identifier),from the list of items.
virtual QValueList< int > colorChangedItemList ()
 Returns the list of item ids for which the color has been changed since.
virtual void resetAllColorStatus ()
 Resets the status color of the object to false.
virtual void changeItemId (int index, int newItemId)
 Changes the itemId of a given element in the list.
virtual void changeItemLabel (int index, QString newItemLabel)
 Changes the item label of a given element in the list.
 ItemColors (const ItemColors &itemcolors)
void removeAll ()
 Suppress all the elements of.
virtual QColor color (int identifier, SelectionMode mode=BY_ITEM_NUMBER)
 Returns the color for a item with a given id or position in the list (identifier).
virtual void setColor (int identifier, QColor color, SelectionMode mode=BY_ITEM_NUMBER)
 Sets the color for a item with a given id or position in the list (identifier) to color.
virtual int itemId (int index)
 Returns the item id corresponding to a given position in the list (index).
int itemIndex (int itemId) const
 Looks up for the item index of the item id itemId.
virtual QString itemLabel (int index)
 Returns the item label corresponding to a given position in the list (index).
virtual QString itemLabelById (int id)
 Returns the item label corresponding to a given item id (id).
virtual bool contains (int itemId)
 Returns true if the item Id exists false otherwise.
virtual bool isColorChanged (int identifier, SelectionMode mode=BY_ITEM_NUMBER)
 Returns true if the color for a item with a given id or position in the list (identifier) has been changed, otherwise returns false.
virtual void setColorChanged (int identifier, bool changed, SelectionMode mode=BY_ITEM_NUMBER)
 If changed is true, the color for a item with a given id or position in the list (identifier) is said to have changed, otherwise is said not to have changed.
virtual uint numberOfItems () const
 Returns the number of items.
virtual bool isColorChanged () const
 Returns true if at least the color of one item have changed, otherwise returns false.
virtual void setColorChanged (bool changed)
 Sets the color status for the entire list of items.
virtual uint append (int itemId, QColor color)
 Appends a item to the list of items, the label is set to the item id and the color status is set to false.
virtual uint append (int itemId, QString label, QColor color)
 Appends a item to the list of items, the color status is set to false.
virtual void insert (int itemId, QColor color, int index)
 Inserts a item at position index in the list of items, the label is set to the item id and the color status is set to false.
virtual void insert (int itemId, QString label, QColor color, int index)
 Inserts a item at position index in the list of items, the color status is set to false.
virtual bool remove (int identifier, SelectionMode mode=BY_ITEM_NUMBER)
 Removes a item, with a given id or position in the list (identifier),from the list of items.
virtual QValueList< int > colorChangedItemList ()
 Returns the list of item ids for which the color has been changed since.
virtual void resetAllColorStatus ()
 Resets the status color of the object to false.
virtual void changeItemId (int index, int newItemId)
 Changes the itemId of a given element in the list.
virtual void changeItemLabel (int index, QString newItemLabel)
 Changes the item label of a given element in the list.

Classes

struct  ItemColor
 Structure representing a color item.

Detailed Description

This class represents the list of the items with their associated id, color and color status (i.e the color has been changed or not).

The list index is zero based.

Author:
Lynn Hazan


Member Function Documentation

QColor ItemColors::color ( int  identifier,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

Returns the color for a item with a given id or position in the list (identifier).

Parameters:
identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the color.
Returns:
the QColor for the given item.

Reimplemented in ClusterColors, and ClusterColors.

void ItemColors::setColor ( int  identifier,
QColor  color,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

Sets the color for a item with a given id or position in the list (identifier) to color.

Parameters:
identifier identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the item.
color color to attribute to the item.

Reimplemented in ClusterColors, and ClusterColors.

int ItemColors::itemId ( int  index  )  [virtual]

Returns the item id corresponding to a given position in the list (index).

Parameters:
index the index in the list of items.
Returns:
the item id.

int ItemColors::itemIndex ( int  itemId  )  const [inline]

Looks up for the item index of the item id itemId.

Parameters:
itemId the item id
Returns:
the index in the list corresponding to the item id or -1 if not found

QString ItemColors::itemLabel ( int  index  )  [virtual]

Returns the item label corresponding to a given position in the list (index).

Parameters:
index the index in the list of items.
Returns:
the item label.

QString ItemColors::itemLabelById ( int  id  )  [virtual]

Returns the item label corresponding to a given item id (id).

Parameters:
id the id of the item to be look up.
Returns:
the item label.

bool ItemColors::contains ( int  itemId  )  [virtual]

Returns true if the item Id exists false otherwise.

Parameters:
itemId the id of the item to check for existence.
Returns:
the boolean value for the existance of the item.

Reimplemented in ClusterColors, and ClusterColors.

bool ItemColors::isColorChanged ( int  identifier,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

Returns true if the color for a item with a given id or position in the list (identifier) has been changed, otherwise returns false.

Parameters:
identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the color.
Returns:
the color status for the given item.

Reimplemented in ClusterColors, and ClusterColors.

void ItemColors::setColorChanged ( int  identifier,
bool  changed,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

If changed is true, the color for a item with a given id or position in the list (identifier) is said to have changed, otherwise is said not to have changed.

Parameters:
identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the color.
changed color status.

Reimplemented in ClusterColors, and ClusterColors.

virtual uint ItemColors::numberOfItems (  )  const [inline, virtual]

Returns the number of items.

Returns:
the number of items in the list,

virtual bool ItemColors::isColorChanged (  )  const [inline, virtual]

Returns true if at least the color of one item have changed, otherwise returns false.

Returns:
the color status for the list of items.

Reimplemented in ClusterColors, and ClusterColors.

virtual void ItemColors::setColorChanged ( bool  changed  )  [inline, virtual]

Sets the color status for the entire list of items.

Parameters:
changed color status.

Reimplemented in ClusterColors, and ClusterColors.

uint ItemColors::append ( int  itemId,
QColor  color 
) [virtual]

Appends a item to the list of items, the label is set to the item id and the color status is set to false.

Parameters:
itemId the item id.
color the color of the item.
Returns:
the index in the list.

Reimplemented in ClusterColors, and ClusterColors.

uint ItemColors::append ( int  itemId,
QString  label,
QColor  color 
) [virtual]

Appends a item to the list of items, the color status is set to false.

Parameters:
itemId the item id.
label the item label.
color the color of the item.
Returns:
the index in the list.

void ItemColors::insert ( int  itemId,
QColor  color,
int  index 
) [virtual]

Inserts a item at position index in the list of items, the label is set to the item id and the color status is set to false.

Parameters:
itemId the item id.
index index position where to insert the item.
color the color of the item.

Reimplemented in ClusterColors, and ClusterColors.

void ItemColors::insert ( int  itemId,
QString  label,
QColor  color,
int  index 
) [virtual]

Inserts a item at position index in the list of items, the color status is set to false.

Parameters:
itemId the item id.
label the item label.
index index position where to insert the item.
color the color of the item.

bool ItemColors::remove ( int  identifier,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

Removes a item, with a given id or position in the list (identifier),from the list of items.

Parameters:
identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the item,
Returns:
true if successful,i.e. if identifier is in range, otherwise returns false.

Reimplemented in ClusterColors, and ClusterColors.

QValueList< int > ItemColors::colorChangedItemList (  )  [virtual]

Returns the list of item ids for which the color has been changed since.

the last reset of their status.

Returns:
item ids list.

void ItemColors::resetAllColorStatus (  )  [virtual]

Resets the status color of the object to false.

and do the same for all the items.

Reimplemented in ClusterColors, and ClusterColors.

void ItemColors::changeItemId ( int  index,
int  newItemId 
) [virtual]

Changes the itemId of a given element in the list.

Parameters:
index position of the item in the list.
newItemId the new id to assign.

void ItemColors::changeItemLabel ( int  index,
QString  newItemLabel 
) [virtual]

Changes the item label of a given element in the list.

Parameters:
index position of the item in the list.
newItemLabel the new label to assign.

virtual QColor ItemColors::color ( int  identifier,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

Returns the color for a item with a given id or position in the list (identifier).

Parameters:
identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the color.
Returns:
the QColor for the given item.

Reimplemented in ClusterColors, and ClusterColors.

virtual void ItemColors::setColor ( int  identifier,
QColor  color,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

Sets the color for a item with a given id or position in the list (identifier) to color.

Parameters:
identifier identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the item.
color color to attribute to the item.

Reimplemented in ClusterColors, and ClusterColors.

virtual int ItemColors::itemId ( int  index  )  [virtual]

Returns the item id corresponding to a given position in the list (index).

Parameters:
index the index in the list of items.
Returns:
the item id.

int ItemColors::itemIndex ( int  itemId  )  const [inline]

Looks up for the item index of the item id itemId.

Parameters:
itemId the item id
Returns:
the index in the list corresponding to the item id or -1 if not found

virtual QString ItemColors::itemLabel ( int  index  )  [virtual]

Returns the item label corresponding to a given position in the list (index).

Parameters:
index the index in the list of items.
Returns:
the item label.

virtual QString ItemColors::itemLabelById ( int  id  )  [virtual]

Returns the item label corresponding to a given item id (id).

Parameters:
id the id of the item to be look up.
Returns:
the item label.

virtual bool ItemColors::contains ( int  itemId  )  [virtual]

Returns true if the item Id exists false otherwise.

Parameters:
itemId the id of the item to check for existence.
Returns:
the boolean value for the existance of the item.

Reimplemented in ClusterColors, and ClusterColors.

virtual bool ItemColors::isColorChanged ( int  identifier,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

Returns true if the color for a item with a given id or position in the list (identifier) has been changed, otherwise returns false.

Parameters:
identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the color.
Returns:
the color status for the given item.

Reimplemented in ClusterColors, and ClusterColors.

virtual void ItemColors::setColorChanged ( int  identifier,
bool  changed,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

If changed is true, the color for a item with a given id or position in the list (identifier) is said to have changed, otherwise is said not to have changed.

Parameters:
identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the color.
changed color status.

Reimplemented in ClusterColors, and ClusterColors.

virtual uint ItemColors::numberOfItems (  )  const [inline, virtual]

Returns the number of items.

Returns:
the number of items in the list,

virtual bool ItemColors::isColorChanged (  )  const [inline, virtual]

Returns true if at least the color of one item have changed, otherwise returns false.

Returns:
the color status for the list of items.

Reimplemented in ClusterColors, and ClusterColors.

virtual void ItemColors::setColorChanged ( bool  changed  )  [inline, virtual]

Sets the color status for the entire list of items.

Parameters:
changed color status.

Reimplemented in ClusterColors, and ClusterColors.

virtual uint ItemColors::append ( int  itemId,
QColor  color 
) [virtual]

Appends a item to the list of items, the label is set to the item id and the color status is set to false.

Parameters:
itemId the item id.
color the color of the item.
Returns:
the index in the list.

Reimplemented in ClusterColors, and ClusterColors.

virtual uint ItemColors::append ( int  itemId,
QString  label,
QColor  color 
) [virtual]

Appends a item to the list of items, the color status is set to false.

Parameters:
itemId the item id.
label the item label.
color the color of the item.
Returns:
the index in the list.

virtual void ItemColors::insert ( int  itemId,
QColor  color,
int  index 
) [virtual]

Inserts a item at position index in the list of items, the label is set to the item id and the color status is set to false.

Parameters:
itemId the item id.
index index position where to insert the item.
color the color of the item.

Reimplemented in ClusterColors, and ClusterColors.

virtual void ItemColors::insert ( int  itemId,
QString  label,
QColor  color,
int  index 
) [virtual]

Inserts a item at position index in the list of items, the color status is set to false.

Parameters:
itemId the item id.
label the item label.
index index position where to insert the item.
color the color of the item.

virtual bool ItemColors::remove ( int  identifier,
SelectionMode  mode = BY_ITEM_NUMBER 
) [virtual]

Removes a item, with a given id or position in the list (identifier),from the list of items.

Parameters:
identifier depending on the mode the index in the list of items or the item id.
mode the way of looking up for the item,
Returns:
true if successful,i.e. if identifier is in range, otherwise returns false.

Reimplemented in ClusterColors, and ClusterColors.

virtual QValueList<int> ItemColors::colorChangedItemList (  )  [virtual]

Returns the list of item ids for which the color has been changed since.

the last reset of their status.

Returns:
item ids list.

virtual void ItemColors::resetAllColorStatus (  )  [virtual]

Resets the status color of the object to false.

and do the same for all the items.

Reimplemented in ClusterColors, and ClusterColors.

virtual void ItemColors::changeItemId ( int  index,
int  newItemId 
) [virtual]

Changes the itemId of a given element in the list.

Parameters:
index position of the item in the list.
newItemId the new id to assign.

virtual void ItemColors::changeItemLabel ( int  index,
QString  newItemLabel 
) [virtual]

Changes the item label of a given element in the list.

Parameters:
index position of the item in the list.
newItemLabel the new label to assign.


The documentation for this class was generated from the following files:
Generated on Mon Sep 17 20:47:32 2007 for NeuroScope by  doxygen 1.5.1