src/contacts/details/qcontactphonenumber.h
changeset 0 876b1a06bc25
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 
       
    43 #ifndef QCONTACTPHONENUMBER_H
       
    44 #define QCONTACTPHONENUMBER_H
       
    45 
       
    46 #include <QString>
       
    47 
       
    48 #include "qtcontactsglobal.h"
       
    49 #include "qcontactdetail.h"
       
    50 #include "qcontactfilter.h"
       
    51 
       
    52 QTM_BEGIN_NAMESPACE
       
    53 
       
    54 /* Leaf class */
       
    55 //! [0]
       
    56 class Q_CONTACTS_EXPORT QContactPhoneNumber : public QContactDetail
       
    57 {
       
    58 public:
       
    59 #ifdef Q_QDOC
       
    60     static const QLatin1Constant DefinitionName;
       
    61     static const QLatin1Constant FieldNumber;
       
    62     static const QLatin1Constant FieldSubTypes;
       
    63     static const QLatin1Constant SubTypeLandline;
       
    64     static const QLatin1Constant SubTypeMobile;
       
    65     static const QLatin1Constant SubTypeFax;
       
    66     static const QLatin1Constant SubTypePager;
       
    67     static const QLatin1Constant SubTypeVoice;
       
    68     static const QLatin1Constant SubTypeModem;
       
    69     static const QLatin1Constant SubTypeVideo;
       
    70     static const QLatin1Constant SubTypeCar;
       
    71     static const QLatin1Constant SubTypeBulletinBoardSystem;
       
    72     static const QLatin1Constant SubTypeMessagingCapable;
       
    73     static const QLatin1Constant SubTypeAssistant;
       
    74     static const QLatin1Constant SubTypeDtmfMenu;
       
    75 
       
    76     static const QLatin1Constant SubTypeFacsimile; // deprecated key
       
    77 #else
       
    78     Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactPhoneNumber, "PhoneNumber")
       
    79     Q_DECLARE_LATIN1_CONSTANT(FieldNumber, "PhoneNumber");
       
    80     Q_DECLARE_LATIN1_CONSTANT(FieldSubTypes, "SubTypes");
       
    81     Q_DECLARE_LATIN1_CONSTANT(SubTypeLandline, "Landline");
       
    82     Q_DECLARE_LATIN1_CONSTANT(SubTypeMobile, "Mobile");
       
    83     Q_DECLARE_LATIN1_CONSTANT(SubTypeFax, "Fax");
       
    84     Q_DECLARE_LATIN1_CONSTANT(SubTypePager, "Pager");
       
    85     Q_DECLARE_LATIN1_CONSTANT(SubTypeVoice, "Voice");
       
    86     Q_DECLARE_LATIN1_CONSTANT(SubTypeModem, "Modem");
       
    87     Q_DECLARE_LATIN1_CONSTANT(SubTypeVideo, "Video");
       
    88     Q_DECLARE_LATIN1_CONSTANT(SubTypeCar, "Car");
       
    89     Q_DECLARE_LATIN1_CONSTANT(SubTypeBulletinBoardSystem, "BulletinBoardSystem");
       
    90     Q_DECLARE_LATIN1_CONSTANT(SubTypeMessagingCapable, "MessagingCapable");
       
    91     Q_DECLARE_LATIN1_CONSTANT(SubTypeAssistant, "Assistant");
       
    92     Q_DECLARE_LATIN1_CONSTANT(SubTypeDtmfMenu, "DtmfMenu");
       
    93 
       
    94     // deprecated keys
       
    95     Q_DECLARE_LATIN1_CONSTANT(SubTypeFacsimile, "Fax");
       
    96 #endif
       
    97 
       
    98     void setNumber(const QString& number) {setValue(FieldNumber, number);}
       
    99     QString number() const {return value(FieldNumber);}
       
   100 
       
   101     void setSubTypes(const QStringList& subTypes) {setValue(FieldSubTypes, subTypes);}
       
   102     void setSubTypes(const QString& subType) {setValue(FieldSubTypes, QStringList(subType));}
       
   103     QStringList subTypes() const {return value<QStringList>(FieldSubTypes);}
       
   104 
       
   105     // Convenience filter
       
   106     static QContactFilter match(const QString& number);
       
   107 };
       
   108 //! [0]
       
   109 
       
   110 QTM_END_NAMESPACE
       
   111 
       
   112 #endif
       
   113