#include <itemcolors.h>
Inheritance diagram for ItemColors:
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. |
The list index is zero based.
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
).
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. |
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.
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
).
index | the index in the list of items. |
int ItemColors::itemIndex | ( | int | itemId | ) | const [inline] |
Looks up for the item index of the item id itemId
.
itemId | the item id |
QString ItemColors::itemLabel | ( | int | index | ) | [virtual] |
Returns the item label corresponding to a given position in the list (index
).
index | the index in the list of items. |
QString ItemColors::itemLabelById | ( | int | id | ) | [virtual] |
Returns the item label corresponding to a given item id (id
).
id | the id of the item to be look up. |
bool ItemColors::contains | ( | int | itemId | ) | [virtual] |
Returns true if the item Id exists false otherwise.
itemId | the id of the item to check for existence. |
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.
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. |
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.
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.
virtual bool ItemColors::isColorChanged | ( | ) | const [inline, virtual] |
Returns true if at least the color of one item have changed, otherwise returns false.
Reimplemented in ClusterColors, and ClusterColors.
virtual void ItemColors::setColorChanged | ( | bool | changed | ) | [inline, virtual] |
Sets the color status for the entire list of items.
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.
itemId | the item id. | |
color | the color of the item. |
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.
itemId | the item id. | |
label | the item label. | |
color | the color of the item. |
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.
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.
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.
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, |
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.
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.
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.
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
).
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. |
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.
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
).
index | the index in the list of items. |
int ItemColors::itemIndex | ( | int | itemId | ) | const [inline] |
Looks up for the item index of the item id itemId
.
itemId | the item id |
virtual QString ItemColors::itemLabel | ( | int | index | ) | [virtual] |
Returns the item label corresponding to a given position in the list (index
).
index | the index in the list of items. |
virtual QString ItemColors::itemLabelById | ( | int | id | ) | [virtual] |
Returns the item label corresponding to a given item id (id
).
id | the id of the item to be look up. |
virtual bool ItemColors::contains | ( | int | itemId | ) | [virtual] |
Returns true if the item Id exists false otherwise.
itemId | the id of the item to check for existence. |
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.
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. |
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.
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.
virtual bool ItemColors::isColorChanged | ( | ) | const [inline, virtual] |
Returns true if at least the color of one item have changed, otherwise returns false.
Reimplemented in ClusterColors, and ClusterColors.
virtual void ItemColors::setColorChanged | ( | bool | changed | ) | [inline, virtual] |
Sets the color status for the entire list of items.
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.
itemId | the item id. | |
color | the color of the item. |
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.
itemId | the item id. | |
label | the item label. | |
color | the color of the item. |
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.
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.
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.
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, |
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.
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.
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.
index | position of the item in the list. | |
newItemLabel | the new label to assign. |