sortmode.h
/*
This file is part of libkabc.
Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KABC_SORTMODE_H
#define KABC_SORTMODE_H
#include <kdelibs_export.h>
#include <kabc/addressee.h>
namespace KABC {
class KABC_EXPORT SortMode
{
public:
virtual bool lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const = 0;
};
class KABC_EXPORT NameSortMode : public SortMode
{
public:
enum NameType
{
FormattedName,
FamilyName,
GivenName
};
NameSortMode();
NameSortMode( NameType type, bool ascending = true );
virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const;
private:
NameType mNameType;
bool mAscendingOrder;
class NameSortModePrivate;
NameSortModePrivate *d;
};
class KABC_EXPORT FieldSortMode : public SortMode
{
public:
FieldSortMode( KABC::Field *field, bool ascending = true );
virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const;
private:
KABC::Field *mField;
bool mAscendingOrder;
class FieldSortModePrivate;
FieldSortModePrivate *d;
};
}
#endif
KABC::SortMode
Sort method for sorting an addressee list.
Definition: sortmode.h:36
KABC::Addressee
address book entry
Definition: addressee.src.h:74

KDE Home | KDE Accessibility Home | Description of Access Keys