accesssec_plat/eap_qt_configuration_api/inc/eapqtcertificateinfo.h
branchRCL_3
changeset 19 c74b3d9f6b9e
parent 18 bad0cc58d154
equal deleted inserted replaced
18:bad0cc58d154 19:c74b3d9f6b9e
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *   Certificate information data structure for EAP QT
       
    16  *   configuration interface
       
    17  *
       
    18  */
       
    19 
       
    20 /*
       
    21  * %version: 5 %
       
    22  */
       
    23 
       
    24 #ifndef EAPQTCERTIFICATEINFO_H
       
    25 #define EAPQTCERTIFICATEINFO_H
       
    26 
       
    27 // System includes
       
    28 #include <QMetaType>
       
    29 #include <QVariant>
       
    30 #include <eapqtconfigexport.h>
       
    31 
       
    32 // User includes
       
    33 
       
    34 // Forward declarations
       
    35 class EapQtCertificateInfoPrivate;
       
    36 
       
    37 // External data types
       
    38 
       
    39 // Constants
       
    40 
       
    41 // Class declaration
       
    42 class EAP_QT_CONFIG_INTERFACE_EXPORT EapQtCertificateInfo
       
    43 {
       
    44 
       
    45 public:
       
    46 
       
    47     // Data types
       
    48 
       
    49     enum ItemId
       
    50     {
       
    51         /*! QString */
       
    52         SubjectName = 0,
       
    53         /*! QString */
       
    54         IssuerName,
       
    55         /*! QString */
       
    56         SerialNumber,
       
    57         /*! QByteArray */
       
    58         SubjectKeyId,
       
    59         /*! QString */
       
    60         ThumbPrint,
       
    61         /*! QString */
       
    62         CertificateLabel,
       
    63         /* marker for the last item */
       
    64         ItemIdLast
       
    65     };
       
    66 
       
    67     // default constructor
       
    68     EapQtCertificateInfo();
       
    69     // destructor
       
    70     ~EapQtCertificateInfo();
       
    71 
       
    72     // copy constuctor
       
    73     EapQtCertificateInfo(const EapQtCertificateInfo& certInfo);
       
    74     // assignment
       
    75     EapQtCertificateInfo &operator=(const EapQtCertificateInfo& certInfo);
       
    76 
       
    77     // gets the certificate field referred to by an id from ItemId
       
    78     // returns QVariant::Invalid is the field has not been set
       
    79     QVariant value(const ItemId id) const;
       
    80 
       
    81     // sets the certificate field referred to by an id from ItemId
       
    82     // does nothing if newValue >= ItemIdLast
       
    83     void setValue(const ItemId id, const QVariant& newValue) const;
       
    84 
       
    85     // resets the object i.e. any successive call to
       
    86     // value() returns QVariant::Invalid
       
    87     void clear() const;
       
    88 
       
    89 private: // data
       
    90 
       
    91     QScopedPointer<EapQtCertificateInfoPrivate> d_ptr;
       
    92 
       
    93 };
       
    94 
       
    95 // Make the class known to QMetaType to support using QVariant
       
    96 Q_DECLARE_METATYPE(EapQtCertificateInfo)
       
    97 
       
    98 #endif // EAPQTCERTIFICATEINFO_H