• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

kabc

  • sources
  • kde-4.12
  • kdepimlibs
  • kabc
sortmode.h
1 /*
2  This file is part of libkabc.
3  Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KABC_SORTMODE_H
22 #define KABC_SORTMODE_H
23 
24 #include "kabc_export.h"
25 #include "addressee.h"
26 
27 namespace KABC {
28 
29 class Field;
30 
37 class KABC_EXPORT SortMode
38 {
39  public:
40  virtual ~SortMode();
41 
46  virtual bool lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const = 0;
47 };
48 
54 class KABC_EXPORT NameSortMode : public SortMode
55 {
56  public:
60  enum NameType {
61  FormattedName,
62  FamilyName,
63  GivenName
64  };
65 
71  NameSortMode();
72 
83  explicit NameSortMode( NameType type, bool ascending = true );
84 
85  virtual ~NameSortMode();
86 
90  virtual bool lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const;
91 
92  private:
93  class Private;
94  Private *const d;
95 
96  Q_DISABLE_COPY( NameSortMode )
97 };
98 
105 class KABC_EXPORT FieldSortMode : public SortMode
106 {
107  public:
118  explicit FieldSortMode( KABC::Field *field, bool ascending = true );
119 
120  virtual ~FieldSortMode();
121 
125  virtual bool lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const;
126 
127  private:
128  class Private;
129  Private *const d;
130 
131  Q_DISABLE_COPY( FieldSortMode )
132 };
133 
134 }
135 
136 #endif
KABC::SortMode
Sort method for sorting an addressee list.
Definition: sortmode.h:37
KABC::NameSortMode::NameType
NameType
Specifies which parts of the name are used for comparison.
Definition: sortmode.h:60
KABC::NameSortMode::FamilyName
use the last name, e.g.
Definition: sortmode.h:62
KABC::NameSortMode::FormattedName
use the formatted name, e.g.
Definition: sortmode.h:61
KABC::Field
Represents a field in the Addressbook.
Definition: field.h:46
KABC::Addressee
address book entry
Definition: addressee.h:74
KABC::NameSortMode
Implements comparison by name.
Definition: sortmode.h:54
KABC::FieldSortMode
Implements comparison by an arbitrary field.
Definition: sortmode.h:105
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:01:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kabc

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal