qtmobility/src/contacts/details/qcontactaddress.h
changeset 1 2b40d63a9c3d
child 4 90517678cc4f
equal deleted inserted replaced
0:cfcbf08528c4 1:2b40d63a9c3d
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 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 QCONTACTADDRESS_H
       
    44 #define QCONTACTADDRESS_H
       
    45 
       
    46 #include <QString>
       
    47 
       
    48 #include "qtcontactsglobal.h"
       
    49 #include "qcontactdetail.h"
       
    50 #include "qcontact.h"
       
    51 
       
    52 QTM_BEGIN_NAMESPACE
       
    53 
       
    54 /* Leaf class */
       
    55 class Q_CONTACTS_EXPORT QContactAddress : public QContactDetail
       
    56 {
       
    57 public:
       
    58 #ifdef Q_QDOC
       
    59     const char* DefinitionName;
       
    60     const char* FieldStreet;
       
    61     const char* FieldLocality;
       
    62     const char* FieldRegion;
       
    63     const char* FieldPostcode;
       
    64     const char* FieldCountry;
       
    65     const char* FieldSubTypes;
       
    66     const char* FieldPostOfficeBox;
       
    67     const char* SubTypeParcel;
       
    68     const char* SubTypePostal;
       
    69     const char* SubTypeDomestic;
       
    70     const char* SubTypeInternational;
       
    71 #else
       
    72     Q_DECLARE_CUSTOM_CONTACT_DETAIL(QContactAddress, "StreetAddress")
       
    73     Q_DECLARE_LATIN1_LITERAL(FieldStreet, "Street");
       
    74     Q_DECLARE_LATIN1_LITERAL(FieldLocality, "Locality");
       
    75     Q_DECLARE_LATIN1_LITERAL(FieldRegion, "Region");
       
    76     Q_DECLARE_LATIN1_LITERAL(FieldPostcode, "Postcode");
       
    77     Q_DECLARE_LATIN1_LITERAL(FieldCountry, "Country");
       
    78     Q_DECLARE_LATIN1_LITERAL(FieldSubTypes, "SubTypes");
       
    79     Q_DECLARE_LATIN1_LITERAL(FieldPostOfficeBox, "PostOfficeBox");
       
    80     Q_DECLARE_LATIN1_LITERAL(SubTypeParcel, "Parcel");
       
    81     Q_DECLARE_LATIN1_LITERAL(SubTypePostal, "Postal");
       
    82     Q_DECLARE_LATIN1_LITERAL(SubTypeDomestic, "Domestic");
       
    83     Q_DECLARE_LATIN1_LITERAL(SubTypeInternational, "International");
       
    84 #endif
       
    85 
       
    86     void setStreet(const QString& street) {setValue(FieldStreet, street);}
       
    87     QString street() const {return value(FieldStreet);}
       
    88     void setLocality(const QString& locality) {setValue(FieldLocality, locality);}
       
    89     QString locality() const {return value(FieldLocality);}
       
    90     void setRegion(const QString& region) {setValue(FieldRegion, region);}
       
    91     QString region() const {return value(FieldRegion);}
       
    92     void setPostcode(const QString& postcode) {setValue(FieldPostcode, postcode);}
       
    93     QString postcode() const {return value(FieldPostcode);}
       
    94     void setCountry(const QString& country) {setValue(FieldCountry, country);}
       
    95     QString country() const {return value(FieldCountry);}
       
    96     void setPostOfficeBox(const QString& postOfficeBox) {setValue(FieldPostOfficeBox, postOfficeBox);}
       
    97     QString postOfficeBox() const {return value(FieldPostOfficeBox);}
       
    98 
       
    99     void setSubTypes(const QStringList& subTypes) {setValue(FieldSubTypes, subTypes);}
       
   100     void setSubTypes(const QString& subType) {setValue(FieldSubTypes, QStringList(subType));}
       
   101     QStringList subTypes() const {return value<QStringList>(FieldSubTypes);}
       
   102 };
       
   103 
       
   104 QTM_END_NAMESPACE
       
   105 
       
   106 #endif
       
   107