KContacts::PhoneNumber

#include <phonenumber.h>

Public Types

typedef QVector< PhoneNumberList
 
typedef QFlags< TypeFlagType
 
enum  TypeFlag {
  Home = 1, Work = 2, Msg = 4, Pref = 8,
  Voice = 16, Fax = 32, Cell = 64, Video = 128,
  Bbs = 256, Modem = 512, Car = 1024, Isdn = 2048,
  Pcs = 4096, Pager = 8192, Undefined = 16384
}
 
typedef QVector< TypeFlagTypeList
 

Properties

QString id
 
bool isEmpty
 
bool isPreferred
 
QString normalizedNumber
 
QString number
 
bool supportsSms
 
Type type
 
QString typeLabel
 

Public Member Functions

 PhoneNumber ()
 
 PhoneNumber (const QString &number, Type type=Home)
 
 PhoneNumber (const PhoneNumber &other)
 
 ~PhoneNumber ()
 
QString id () const
 
bool isEmpty () const
 
bool isPreferred () const
 
QString normalizedNumber () const
 
QString number () const
 
bool operator!= (const PhoneNumber &other) const
 
PhoneNumberoperator= (const PhoneNumber &other)
 
bool operator== (const PhoneNumber &other) const
 
QMap< QString, QStringListparameters () const
 
void setId (const QString &identifier)
 
void setNumber (const QString &number)
 
void setParameters (const QMap< QString, QStringList > &params)
 
void setType (Type type)
 
bool supportsSms () const
 
QString toString () const
 
Type type () const
 
QString typeLabel () const
 

Static Public Member Functions

static QString typeFlagLabel (TypeFlag type)
 
static QString typeLabel (Type type)
 
static TypeList typeList ()
 

Friends

KCONTACTS_EXPORT QDataStreamoperator<< (QDataStream &, const PhoneNumber &)
 
KCONTACTS_EXPORT QDataStreamoperator>> (QDataStream &, PhoneNumber &)
 

Detailed Description

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.

Definition at line 27 of file phonenumber.h.

Member Typedef Documentation

List of phone numbers.

Definition at line 80 of file phonenumber.h.

Stores a combination of TypeFlag values.

Definition at line 69 of file phonenumber.h.

List of phone number types.

Definition at line 75 of file phonenumber.h.

Member Enumeration Documentation

Phone number types.

See also
Type
Enumerator
Home 

Home number.

Work 

Office number.

Msg 

Messaging.

Pref 

Preferred number.

Voice 

Voice.

Fax 

Fax machine.

Cell 

Cell phone.

Video 

Video phone.

Bbs 

Mailbox.

Modem 

Modem.

Car 

Car phone.

Isdn 

ISDN connection.

Pcs 

Personal Communication Service.

Pager 

Pager.

Definition at line 47 of file phonenumber.h.

Constructor & Destructor Documentation

PhoneNumber::PhoneNumber ( )

Creates an empty phone number object.

Definition at line 46 of file phonenumber.cpp.

PhoneNumber::PhoneNumber ( const QString number,
Type  type = Home 
)

Creates a phone number object.

Parameters
numberNumber
typeType as defined in enum. Multiple types can be specified by combining them by a logical or.

Definition at line 51 of file phonenumber.cpp.

PhoneNumber::PhoneNumber ( const PhoneNumber other)

Copy constructor.

Fast operation, PhoneNumber's data is implicitly shared.

Parameters
otherThe PhoneNumber object to copy from

Definition at line 57 of file phonenumber.cpp.

PhoneNumber::~PhoneNumber ( )

Destroys the phone number.

Definition at line 62 of file phonenumber.cpp.

Member Function Documentation

QString KContacts::PhoneNumber::id ( ) const

Returns the unique identifier.

bool KContacts::PhoneNumber::isEmpty ( ) const

Returns true, if the phone number is empty.

bool KContacts::PhoneNumber::isPreferred ( ) const

Returns whether this phone number is marked as preferred.

Since
5.12
QString KContacts::PhoneNumber::normalizedNumber ( ) const

Returns the phone number normalized for dialing.

This has all formatting stripped for passing to dialers or tel: URLs.

See also
number()
Since
5.12
QString KContacts::PhoneNumber::number ( ) const

Returns the phone number.

This is the number as entered/stored with all formatting preserved. Preferred for display.

See also
normalizedNumber()
bool PhoneNumber::operator!= ( const PhoneNumber other) const

Not-Equal operator.

Definition at line 87 of file phonenumber.cpp.

PhoneNumber & PhoneNumber::operator= ( const PhoneNumber other)

Assignment operator.

Fast operation, PhoneNumber's data is implicitly shared.

Parameters
otherThe PhoneNumber object to asssign to this

Definition at line 92 of file phonenumber.cpp.

bool PhoneNumber::operator== ( const PhoneNumber other) const

Equality operator.

Returns
true if number, type and identifier are equal, otherwise false

Definition at line 66 of file phonenumber.cpp.

void PhoneNumber::setId ( const QString identifier)

Sets the unique identifier.

Definition at line 106 of file phonenumber.cpp.

void PhoneNumber::setNumber ( const QString number)

Sets the phone number.

Definition at line 116 of file phonenumber.cpp.

void PhoneNumber::setType ( Type  type)

Sets the type.

Multiple types can be specified by combining them by a logical or.

Parameters
typeThe Type of the phone number

Definition at line 139 of file phonenumber.cpp.

bool KContacts::PhoneNumber::supportsSms ( ) const

Returns whether this phone number is expected to support receiving SMS messages.

Since
5.12
QString PhoneNumber::toString ( ) const

Returns a string representation of the phone number.

Definition at line 263 of file phonenumber.cpp.

Type KContacts::PhoneNumber::type ( ) const

Returns the type.

Can be a multiple types combined by a logical or.

See also
TypeFlag
typeLabel()
QString PhoneNumber::typeFlagLabel ( TypeFlag  type)
static

Returns the translated label for phone number type.

Parameters
typeAn OR'ed combination of TypeFlag
See also
typeLabel()
Since
4.5

Definition at line 166 of file phonenumber.cpp.

QString KContacts::PhoneNumber::typeLabel ( ) const

Returns a translated string of the address' type.

QString PhoneNumber::typeLabel ( Type  type)
static

Returns the translated label for phone number type.

In opposite to typeFlagLabel( TypeFlag type ), it returns all types of the phone number concatenated by '/'.

Parameters
typeAn OR'ed combination of TypeFlag
See also
type()

Definition at line 204 of file phonenumber.cpp.

PhoneNumber::TypeList PhoneNumber::typeList ( )
static

Returns a list of all available types.

Definition at line 154 of file phonenumber.cpp.

Friends And Related Function Documentation

KCONTACTS_EXPORT QDataStream& operator<< ( QDataStream ,
const PhoneNumber  
)
friend

Serializes the phone number object into the stream.

Parameters
streamThe stream to write into
numberThe phone number object to serialize
KCONTACTS_EXPORT QDataStream& operator>> ( QDataStream ,
PhoneNumber  
)
friend

Initializes the phone number object from the stream.

Parameters
streamThe stream to read from
numberThe phone number object to deserialize into

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 14 2020 22:54:51 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.