kalarm/lib

#include <colourlist.h>

Public Types

typedef size_t size_type
 
typedef TQValueListConstIterator< TQRgb > const_iterator
 

Public Member Functions

 ColourList ()
 
 ColourList (const ColourList &l)
 
 ColourList (const TQValueList< TQRgb > &list)
 
 ColourList (const TQColor *list)
 
ColourListoperator= (const ColourList &l)
 
ColourListoperator= (const TQValueList< TQRgb > &list)
 
void clear ()
 
void insert (const TQColor &c)
 
void remove (const TQColor &c)
 
ColourListoperator+= (const TQColor &c)
 
ColourListoperator+= (const ColourList &list)
 
bool operator== (const ColourList &l) const
 
bool operator!= (const ColourList &l) const
 
size_type count () const
 
bool isEmpty () const
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator fromLast () const
 
const_iterator at (size_type i) const
 
size_type contains (const TQColor &c) const
 
const_iterator find (const TQColor &c) const
 
const_iterator find (const_iterator it, const TQColor &c) const
 
int findIndex (const TQColor &c) const
 
TQColor first () const
 
TQColor last () const
 
TQColor operator[] (size_type i) const
 

Detailed Description

Represents a sorted list of colours.

The ColourList class holds a list of colours, sorted in RGB value order.

It provides a sorted TQValueList of colours in RGB value order, with iterators and other access methods which return either TQRgb or TQColor objects.

Author
David Jarvie softw.nosp@m.are@.nosp@m.astro.nosp@m.jar..nosp@m.org.u.nosp@m.k

Definition at line 39 of file colourlist.h.

Constructor & Destructor Documentation

◆ ColourList() [1/4]

ColourList::ColourList ( )
inline

Constructs an empty list.

Definition at line 46 of file colourlist.h.

◆ ColourList() [2/4]

ColourList::ColourList ( const ColourList l)
inline

Copy constructor.

Definition at line 48 of file colourlist.h.

◆ ColourList() [3/4]

ColourList::ColourList ( const TQValueList< TQRgb > &  list)
inline

Constructs a list whose values are preset to the colours in list.

Definition at line 50 of file colourlist.h.

◆ ColourList() [4/4]

ColourList::ColourList ( const TQColor *  list)

Constructs a list whose values are preset to the colours in the list.

Terminate list by an invalid colour.

Definition at line 24 of file colourlist.cpp.

Member Function Documentation

◆ at()

const_iterator ColourList::at ( size_type  i) const
inline

Returns an iterator pointing to the colour at position i in the list.

Definition at line 84 of file colourlist.h.

◆ begin()

const_iterator ColourList::begin ( ) const
inline

Returns an iterator pointing to the first colour in the list.

Definition at line 78 of file colourlist.h.

◆ clear()

void ColourList::clear ( )
inline

Removes all values from the list.

Definition at line 60 of file colourlist.h.

◆ contains()

size_type ColourList::contains ( const TQColor &  c) const
inline

Returns true if the list contains the colour c.

Definition at line 86 of file colourlist.h.

◆ count()

size_type ColourList::count ( ) const
inline

Returns the number of colours in the list.

Definition at line 74 of file colourlist.h.

◆ end()

const_iterator ColourList::end ( ) const
inline

Returns an iterator pointing past the last colour in the list.

Definition at line 80 of file colourlist.h.

◆ find() [1/2]

const_iterator ColourList::find ( const TQColor &  c) const
inline

Returns an iterator pointing to the first occurrence of colour c in the list.

Returns end() if colour c is not in the list.

Definition at line 90 of file colourlist.h.

◆ find() [2/2]

const_iterator ColourList::find ( const_iterator  it,
const TQColor &  c 
) const
inline

Returns an iterator pointing to the first occurrence of colour c in the list, starting.

from position it. Returns end() if colour c is not in the list.

Definition at line 94 of file colourlist.h.

◆ findIndex()

int ColourList::findIndex ( const TQColor &  c) const
inline

Returns the index to the first occurrence of colour c in the list.

Returns -1 if colour c is not in the list.

Definition at line 98 of file colourlist.h.

◆ first()

TQColor ColourList::first ( ) const
inline

Returns the first colour in the list.

If the list is empty, the result is undefined.

Definition at line 100 of file colourlist.h.

◆ fromLast()

const_iterator ColourList::fromLast ( ) const
inline

Returns an iterator pointing to the last colour in the list, or end() if the list is empty.

Definition at line 82 of file colourlist.h.

◆ insert()

void ColourList::insert ( const TQColor &  c)

Adds the specified colour c to the list.

Definition at line 30 of file colourlist.cpp.

◆ isEmpty()

bool ColourList::isEmpty ( ) const
inline

Returns true if the list is empty.

Definition at line 76 of file colourlist.h.

◆ last()

TQColor ColourList::last ( ) const
inline

Returns the last colour in the list.

If the list is empty, the result is undefined.

Definition at line 102 of file colourlist.h.

◆ operator!=()

bool ColourList::operator!= ( const ColourList l) const
inline

Returns true if the colours in the two lists differ.

Definition at line 72 of file colourlist.h.

◆ operator+=() [1/2]

ColourList& ColourList::operator+= ( const ColourList list)
inline

Adds the colours in list to this list.

Definition at line 68 of file colourlist.h.

◆ operator+=() [2/2]

ColourList& ColourList::operator+= ( const TQColor &  c)
inline

Adds the specified colour c to the list.

Definition at line 66 of file colourlist.h.

◆ operator=() [1/2]

ColourList& ColourList::operator= ( const ColourList l)
inline

Assignment operator.

Definition at line 56 of file colourlist.h.

◆ operator=() [2/2]

ColourList& ColourList::operator= ( const TQValueList< TQRgb > &  list)
inline

Sets the list to comprise the colours in list.

Definition at line 58 of file colourlist.h.

◆ operator==()

bool ColourList::operator== ( const ColourList l) const
inline

Returns true if the colours in the two lists are the same.

Definition at line 70 of file colourlist.h.

◆ operator[]()

TQColor ColourList::operator[] ( size_type  i) const
inline

Returns the colour at position i in the list.

If the item does not exist, the result is undefined.

Definition at line 104 of file colourlist.h.

◆ remove()

void ColourList::remove ( const TQColor &  c)
inline

Removes the colour c from the list.

Definition at line 64 of file colourlist.h.


The documentation for this class was generated from the following files: