/usr/include/kabc/phonenumber.h is in kdepimlibs5-dev 4:4.14.10-1ubuntu7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | /*
This file is part of libkabc.
Copyright (c) 2001 Cornelius Schumacher <schumacher@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_PHONENUMBER_H
#define KABC_PHONENUMBER_H
#include "kabc_export.h"
#include <QtCore/QSharedDataPointer>
#include <QtCore/QString>
namespace KABC {
/**
* @short Phonenumber information.
*
* This class provides phone number information. A phone number is classified by
* a type. The following types are available, it's possible to use multiple types
* Types for a number by combining them through a logical or.
*/
class KABC_EXPORT PhoneNumber
{
friend KABC_EXPORT QDataStream &operator<<( QDataStream &, const PhoneNumber & );
friend KABC_EXPORT QDataStream &operator>>( QDataStream &, PhoneNumber & );
public:
/**
Phone number types.
*/
enum TypeFlag {
Home = 1, /**< Home number */
Work = 2, /**< Office number */
Msg = 4, /**< Messaging */
Pref = 8, /**< Preferred number */
Voice = 16, /**< Voice */
Fax = 32, /**< Fax machine */
Cell = 64, /**< Cell phone */
Video = 128, /**< Video phone */
Bbs = 256, /**< Mailbox */
Modem = 512, /**< Modem */
Car = 1024, /**< Car phone */
Isdn = 2048, /**< ISDN connection */
Pcs = 4096, /**< Personal Communication Service*/
Pager = 8192 /**< Pager */
};
Q_DECLARE_FLAGS( Type, TypeFlag )
/**
* List of phone number types.
*/
typedef QList<TypeFlag> TypeList;
/**
* List of phone numbers.
*/
typedef QList<PhoneNumber> List;
/**
* Creates an empty phone number object.
*/
PhoneNumber();
/**
* Creates a phone number object.
*
* @param number Number
* @param type Type as defined in enum. Multiple types can be
* specified by combining them by a logical or.
*/
PhoneNumber( const QString &number, Type type = Home ); //krazy:exclude=explicit
/**
* Copy constructor.
*
* Fast operation, PhoneNumber's data is implicitly shared.
*
* @param other The PhoneNumber object to copy from
*/
PhoneNumber( const PhoneNumber &other );
/**
* Destroys the phone number.
*/
~PhoneNumber();
/**
* Equality operator.
*
* @return @c true if number, type and identifier are equal,
* otherwise @c false
*/
bool operator==( const PhoneNumber & ) const;
/**
* Not-Equal operator.
*/
bool operator!=( const PhoneNumber & ) const;
/**
* Assignment operator.
*
* Fast operation, PhoneNumber's data is implicitly shared.
*
* @param other The PhoneNumber object to asssign to @c this
*/
PhoneNumber &operator=( const PhoneNumber &other );
/**
* Returns true, if the phone number is empty.
*/
bool isEmpty() const;
/**
* Sets the unique @p identifier.
*/
void setId( const QString &identifier );
/**
* Returns the unique identifier.
*/
QString id() const;
/**
* Sets the phone @p number.
*/
void setNumber( const QString &number );
/**
* Returns the phone number.
*/
QString number() const;
/**
* Sets the @p type.
* Multiple types can be specified by combining them by a logical or.
*
* @param type The #Type of the phone number
*/
void setType( Type type );
/**
* Returns the type. Can be a multiple types combined by a logical or.
*
* @see #TypeFlag
* @see typeLabel()
*/
Type type() const;
/**
* Returns a translated string of the address' type.
*/
QString typeLabel() const;
/**
* Returns a list of all available types
*/
static TypeList typeList();
/**
* Returns the translated label for phone number @p type.
*
* In opposite to typeFlagLabel( TypeFlag type ), it returns all types
* of the phone number concatenated by '/'.
*
* @param type An OR'ed combination of #TypeFlag
*
* @see type()
*/
static QString typeLabel( Type type );
/**
* Returns the translated label for phone number @p type.
*
* @param type An OR'ed combination of #TypeFlag
*
* @see typeLabel()
* @since 4.5
*/
static QString typeFlagLabel( TypeFlag type );
/**
* Returns a string representation of the phone number.
*/
QString toString() const;
private:
class Private;
QSharedDataPointer<Private> d;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( PhoneNumber::Type )
/**
* Serializes the phone @p number object into the @p stream.
*
* @param stream The stream to write into
* @param number The phone number object to serialize
*/
KABC_EXPORT QDataStream &operator<<( QDataStream &stream, const PhoneNumber &number );
/**
* Initializes the phone @p number object from the @p stream.
*
* @param stream The stream to read from
* @param number The phone number object to deserialize into
*/
KABC_EXPORT QDataStream &operator>>( QDataStream &stream, const PhoneNumber &number );
}
#endif
|