KContacts::PhoneNumber
#include <phonenumber.h>
Public Types | |
typedef QList< PhoneNumber > | List |
typedef QFlags< TypeFlag > | Type |
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 QList< TypeFlag > | TypeList |
Properties | |
QString | id |
bool | isEmpty |
bool | isPreferred |
QString | normalizedNumber |
QString | number |
bool | supportsSms |
Type | type |
QString | typeLabel |
Public Member Functions | |
PhoneNumber () | |
PhoneNumber (const PhoneNumber &other) | |
PhoneNumber (const QString &number, Type type=Home) | |
~PhoneNumber () | |
QString | id () const |
bool | isEmpty () const |
bool | isPreferred () const |
QString | normalizedNumber () const |
QString | number () const |
bool | operator!= (const PhoneNumber &other) const |
PhoneNumber & | operator= (const PhoneNumber &other) |
bool | operator== (const PhoneNumber &other) const |
void | setId (const QString &identifier) |
void | setNumber (const QString &number) |
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 () |
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 30 of file phonenumber.h.
Member Typedef Documentation
◆ List
List of phone numbers.
Definition at line 84 of file phonenumber.h.
◆ Type
Stores a combination of TypeFlag values.
Definition at line 73 of file phonenumber.h.
◆ TypeList
List of phone number types.
Definition at line 79 of file phonenumber.h.
Member Enumeration Documentation
◆ TypeFlag
Phone number types.
- See also
- Type
Definition at line 51 of file phonenumber.h.
Property Documentation
◆ id
|
readwrite |
Definition at line 37 of file phonenumber.h.
◆ isEmpty
|
read |
Definition at line 42 of file phonenumber.h.
◆ isPreferred
|
read |
Definition at line 43 of file phonenumber.h.
◆ normalizedNumber
|
read |
Definition at line 39 of file phonenumber.h.
◆ number
|
readwrite |
Definition at line 38 of file phonenumber.h.
◆ supportsSms
|
read |
Definition at line 44 of file phonenumber.h.
◆ type
|
readwrite |
Definition at line 40 of file phonenumber.h.
◆ typeLabel
|
read |
Definition at line 41 of file phonenumber.h.
Constructor & Destructor Documentation
◆ PhoneNumber() [1/3]
PhoneNumber::PhoneNumber | ( | ) |
Creates an empty phone number object.
Definition at line 47 of file phonenumber.cpp.
◆ PhoneNumber() [2/3]
Creates a phone number object.
- Parameters
-
number Number type Type as defined in enum. Multiple types can be specified by combining them by a logical or.
Definition at line 52 of file phonenumber.cpp.
◆ PhoneNumber() [3/3]
PhoneNumber::PhoneNumber | ( | const PhoneNumber & | other | ) |
Copy constructor.
Fast operation, PhoneNumber's data is implicitly shared.
- Parameters
-
other The PhoneNumber object to copy from
Definition at line 58 of file phonenumber.cpp.
◆ ~PhoneNumber()
PhoneNumber::~PhoneNumber | ( | ) |
Destroys the phone number.
Definition at line 63 of file phonenumber.cpp.
Member Function Documentation
◆ id()
QString PhoneNumber::id | ( | ) | const |
Returns the unique identifier.
Definition at line 112 of file phonenumber.cpp.
◆ isEmpty()
bool PhoneNumber::isEmpty | ( | ) | const |
Returns true, if the phone number is empty.
Definition at line 102 of file phonenumber.cpp.
◆ isPreferred()
bool PhoneNumber::isPreferred | ( | ) | const |
Returns whether this phone number is marked as preferred.
- Since
- 5.12
Definition at line 250 of file phonenumber.cpp.
◆ normalizedNumber()
QString 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
Definition at line 127 of file phonenumber.cpp.
◆ number()
QString PhoneNumber::number | ( | ) | const |
Returns the phone number.
This is the number as entered/stored with all formatting preserved. Preferred for display.
- See also
- normalizedNumber()
Definition at line 122 of file phonenumber.cpp.
◆ operator!=()
bool PhoneNumber::operator!= | ( | const PhoneNumber & | other | ) | const |
Not-Equal operator.
Definition at line 88 of file phonenumber.cpp.
◆ operator=()
PhoneNumber & PhoneNumber::operator= | ( | const PhoneNumber & | other | ) |
Assignment operator.
Fast operation, PhoneNumber's data is implicitly shared.
- Parameters
-
other The PhoneNumber object to asssign to this
Definition at line 93 of file phonenumber.cpp.
◆ operator==()
bool PhoneNumber::operator== | ( | const PhoneNumber & | other | ) | const |
Equality operator.
- Returns
true
if number, type and identifier are equal, otherwisefalse
Definition at line 67 of file phonenumber.cpp.
◆ setId()
void PhoneNumber::setId | ( | const QString & | identifier | ) |
Sets the unique identifier
.
Definition at line 107 of file phonenumber.cpp.
◆ setNumber()
void PhoneNumber::setNumber | ( | const QString & | number | ) |
Sets the phone number
.
Definition at line 117 of file phonenumber.cpp.
◆ setType()
void PhoneNumber::setType | ( | Type | type | ) |
Sets the type
.
Multiple types can be specified by combining them by a logical or.
- Parameters
-
type The Type of the phone number
Definition at line 139 of file phonenumber.cpp.
◆ supportsSms()
bool PhoneNumber::supportsSms | ( | ) | const |
Returns whether this phone number is expected to support receiving SMS messages.
- Since
- 5.12
Definition at line 255 of file phonenumber.cpp.
◆ toString()
QString PhoneNumber::toString | ( | ) | const |
Returns a string representation of the phone number.
Definition at line 260 of file phonenumber.cpp.
◆ type()
PhoneNumber::Type PhoneNumber::type | ( | ) | const |
Returns the type.
Can be a multiple types combined by a logical or.
- See also
- TypeFlag
- typeLabel()
Definition at line 144 of file phonenumber.cpp.
◆ typeFlagLabel()
Returns the translated label for phone number type
.
- Parameters
-
type An OR'ed combination of TypeFlag
- See also
- typeLabel()
- Since
- 4.5
Definition at line 166 of file phonenumber.cpp.
◆ typeLabel() [1/2]
QString PhoneNumber::typeLabel | ( | ) | const |
Returns a translated string of the address' type.
Definition at line 149 of file phonenumber.cpp.
◆ typeLabel() [2/2]
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
-
type An OR'ed combination of TypeFlag
- See also
- type()
Definition at line 204 of file phonenumber.cpp.
◆ typeList()
|
static |
Returns a list of all available types.
Definition at line 154 of file phonenumber.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:06:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.