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