kabc
phonenumber.h
00001 /* 00002 This file is part of libkabc. 00003 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KABC_PHONENUMBER_H 00022 #define KABC_PHONENUMBER_H 00023 00024 #include "kabc_export.h" 00025 00026 #include <QtCore/QSharedDataPointer> 00027 #include <QtCore/QString> 00028 00029 namespace KABC { 00030 00038 class KABC_EXPORT PhoneNumber 00039 { 00040 friend KABC_EXPORT QDataStream &operator<<( QDataStream &, const PhoneNumber & ); 00041 friend KABC_EXPORT QDataStream &operator>>( QDataStream &, PhoneNumber & ); 00042 00043 public: 00047 enum TypeFlag { 00048 Home = 1, 00049 Work = 2, 00050 Msg = 4, 00051 Pref = 8, 00052 Voice = 16, 00053 Fax = 32, 00054 Cell = 64, 00055 Video = 128, 00056 Bbs = 256, 00057 Modem = 512, 00058 Car = 1024, 00059 Isdn = 2048, 00060 Pcs = 4096, 00061 Pager = 8192 00062 }; 00063 00064 Q_DECLARE_FLAGS( Type, TypeFlag ) 00065 00066 00069 typedef QList<TypeFlag> TypeList; 00070 00074 typedef QList<PhoneNumber> List; 00075 00079 PhoneNumber(); 00080 00088 PhoneNumber( const QString &number, Type type = Home ); //krazy:exclude=explicit 00089 00097 PhoneNumber( const PhoneNumber &other ); 00098 00102 ~PhoneNumber(); 00103 00110 bool operator==( const PhoneNumber & ) const; 00111 00115 bool operator!=( const PhoneNumber & ) const; 00116 00124 PhoneNumber &operator=( const PhoneNumber &other ); 00125 00129 bool isEmpty() const; 00130 00134 void setId( const QString &identifier ); 00135 00139 QString id() const; 00140 00144 void setNumber( const QString &number ); 00145 00149 QString number() const; 00150 00157 void setType( Type type ); 00158 00165 Type type() const; 00166 00170 QString typeLabel() const; 00171 00175 static TypeList typeList(); 00176 00187 static QString typeLabel( Type type ); 00188 00197 static QString typeFlagLabel( TypeFlag type ); 00198 00202 QString toString() const; 00203 00204 private: 00205 class Private; 00206 QSharedDataPointer<Private> d; 00207 }; 00208 00209 Q_DECLARE_OPERATORS_FOR_FLAGS( PhoneNumber::Type ) 00210 00217 KABC_EXPORT QDataStream &operator<<( QDataStream &stream, const PhoneNumber &number ); 00218 00225 KABC_EXPORT QDataStream &operator>>( QDataStream &stream, const PhoneNumber &number ); 00226 00227 } 00228 00229 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 05:09:41 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 05:09:41 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.