• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • TDEABC
  • AddresseeList
Public Member Functions | List of all members
TDEABC::AddresseeList Class Reference

#include <addresseelist.h>

Inherits TQValueList< Addressee >.

Public Member Functions

 AddresseeList (const AddresseeList &)
 
 AddresseeList (const TQValueList< Addressee > &)
 
void dump () const
 
void setReverseSorting (bool r=true)
 
bool reverseSorting () const
 
void sortBy (SortingCriterion c)
 
void sortByField (Field *field=0)
 
void sortByMode (SortMode *mode=0)
 
void sort ()
 
template<class Trait >
void sortByTrait ()
 
SortingCriterion sortingCriterion () const
 
Field * sortingField () const
 

Detailed Description

a TQValueList of Addressee, with sorting functionality

This class extends the functionality of TQValueList with sorting methods specific to the Addressee class. It can be used just like any other TQValueList but is no template class.

An AddresseeList does not automatically keep sorted when addressees are added or removed or the sorting order is changed, as this would slow down larger operations by sorting after every step. So after such operations you have to call sort or sortBy to create a defined order again.

Iterator usage is inherited by TQValueList and extensively documented there. Please remember that the state of an iterator is undefined after any sorting operation.

For the enumeration Type SortingCriterion, which specifies the field by the collection will be sorted, the following values exist: Uid, Name, FormattedName, FamilyName, GivenName.

Author
Jost Schenck jost@.nosp@m.sche.nosp@m.nck.d.nosp@m.e

Definition at line 112 of file addresseelist.h.

Constructor & Destructor Documentation

◆ AddresseeList() [1/3]

AddresseeList::AddresseeList ( )

Definition at line 109 of file addresseelist.cpp.

◆ ~AddresseeList()

AddresseeList::~AddresseeList ( )

Definition at line 116 of file addresseelist.cpp.

◆ AddresseeList() [2/3]

AddresseeList::AddresseeList ( const AddresseeList &  l)

Definition at line 120 of file addresseelist.cpp.

◆ AddresseeList() [3/3]

AddresseeList::AddresseeList ( const TQValueList< Addressee > &  l)

Definition at line 127 of file addresseelist.cpp.

Member Function Documentation

◆ dump()

void AddresseeList::dump ( ) const

Debug output.

Definition at line 133 of file addresseelist.cpp.

◆ reverseSorting()

bool TDEABC::AddresseeList::reverseSorting ( ) const
inline

Returns the direction of sorting.

Returns
true if sorting is done reverse, false otherwise

Definition at line 136 of file addresseelist.h.

◆ setReverseSorting()

void TDEABC::AddresseeList::setReverseSorting ( bool  r = true)
inline

Determines the direction of sorting.

On change, the list will not automatically be resorted.

Parameters
rtrue if sorting should be done reverse, false otherwise

Definition at line 130 of file addresseelist.h.

◆ sort()

void AddresseeList::sort ( )

Sorts this list by its active sorting criterion.

This normally is the criterion of the last sortBy operation or FormattedName if up to now there has been no sortBy operation.

Please note that the sorting trait of the last sortByTrait method call is not remembered and thus the action can not be repeated by this method.

Definition at line 180 of file addresseelist.cpp.

◆ sortBy()

void AddresseeList::sortBy ( SortingCriterion  c)

Sorts this list by a specific criterion.

Parameters
cthe criterion by which should be sorted

Definition at line 162 of file addresseelist.cpp.

◆ sortByField()

void AddresseeList::sortByField ( Field *  field = 0)

Sorts this list by a specific field.

If no parameter is given, the last used Field object will be used.

Parameters
fieldpointer to the Field object to be sorted by

Definition at line 221 of file addresseelist.cpp.

◆ sortByMode()

void AddresseeList::sortByMode ( SortMode *  mode = 0)

Sorts this list by a specific sorting mode.

Parameters
modepointer to the sorting mode object to be sorted by
Since
3.4

Definition at line 242 of file addresseelist.cpp.

◆ sortByTrait()

template<class Trait >
void AddresseeList::sortByTrait

Templated sort function.

You normally will not want to use this but sortBy and sort instead as the existing sorting criteria completely suffice for most cases.

However, if you do want to use some special sorting criterion, you can write a trait class that will be provided to this templated method. This trait class has to have a class declaration like the following:

class MySortingTrait {
public:
// eq returns true if a1 and a2 are equal
static bool eq(TDEABC::Addressee a1, TDEABC::Addressee a2);
// lt returns true is a1 is "less than" a2
static bool lt(TDEABC::Addressee a1, TDEABC::Addressee a2);
};
TDEABC::Addressee
address book entry
Definition: addressee.src.h:75

You can then pass this class to the sortByTrait method like this:

myAddresseelist.sortByTrait&lt;MySortingTrait&gt;();

Please note that the sort method can not be used to repeat the sorting of the last sortByTrait action.

Right now this method uses the bubble sort algorithm. This should be replaced for a better one when I have time.

Definition at line 186 of file addresseelist.cpp.

◆ sortingCriterion()

SortingCriterion TDEABC::AddresseeList::sortingCriterion ( ) const
inline

Returns the active sorting criterion, ie the sorting criterion that will be used by a sort call.

Definition at line 202 of file addresseelist.h.

◆ sortingField()

Field * AddresseeList::sortingField ( ) const

Returns the active sorting field, ie a pointer to the Field object which was used for the last sortByField operation.

This function returns the last GLOBAL sorting field, not the class specific one. You're a lot better off by keeping track of this locally.

Definition at line 253 of file addresseelist.cpp.


The documentation for this class was generated from the following files:
  • addresseelist.h
  • addresseelist.cpp

tdeabc

Skip menu "tdeabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.9.4
This website is maintained by Timothy Pearson.