securitysettings/qtconfigutils/eapqtconfiginterface/src/eapqtvalidatorrealm.cpp
changeset 39 fe6b6762fccd
parent 33 938269283a16
child 52 c23bdf5a328a
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.
    11  *
    11  *
    12  * Contributors:
    12  * Contributors:
    13  *
    13  *
    14  * Description: 
    14  * Description: 
    15  *   EAP method validator: realm
    15  *   EAP method realm format validator
    16  *
    16  *
    17  */
    17  */
    18 
    18 
    19 /*
    19 /*
    20  * %version: 6 %
    20  * %version: 8 %
    21  */
    21  */
    22 
    22 
       
    23 // System includes
    23 #include <HbEditorInterface>
    24 #include <HbEditorInterface>
    24 #include <HbLineEdit>
    25 #include <HbLineEdit>
    25 
    26 
       
    27 // User includes
    26 #include "eapqtvalidatorrealm.h"
    28 #include "eapqtvalidatorrealm.h"
    27 #include "eapqtconfiginterface_p.h"
    29 #include "eapqtconfiginterface_p.h"
    28 
    30 
    29 EapQtValidatorRealm::EapQtValidatorRealm(EapQtExpandedEapType type) :
    31 /*!
       
    32  *  \class EapQtValidatorRealm
       
    33  *  \brief EAP method realm format validator
       
    34  */
       
    35 
       
    36 // External function prototypes
       
    37 
       
    38 // Local constants
       
    39 
       
    40 // ======== LOCAL FUNCTIONS ========
       
    41 
       
    42 // ======== MEMBER FUNCTIONS ========
       
    43 
       
    44 EapQtValidatorRealm::EapQtValidatorRealm(const EapQtExpandedEapType& type) :
    30     mEapType(type)
    45     mEapType(type)
    31 {
    46 {
    32 }
    47 }
    33 
    48 
    34 EapQtValidatorRealm::~EapQtValidatorRealm()
    49 EapQtValidatorRealm::~EapQtValidatorRealm()
    35 {
    50 {
    36 }
    51 }
    37 
    52 
    38 EapQtValidator::Status EapQtValidatorRealm::validate(QVariant value)
    53 EapQtValidator::Status EapQtValidatorRealm::validate(const QVariant& value)
    39 {
    54 {
       
    55     qDebug("EapQtValidatorRealm::validate()");
       
    56 
    40     Status status(StatusOk);
    57     Status status(StatusOk);
    41 
    58 
    42     switch (mEapType.type()) {
    59     switch (mEapType.type()) {
    43     case EapQtExpandedEapType::TypeEapAka:
    60     case EapQtExpandedEapType::TypeEapAka:
    44     case EapQtExpandedEapType::TypeEapFast:
    61     case EapQtExpandedEapType::TypeEapFast:
    57     }
    74     }
    58 
    75 
    59     return status;
    76     return status;
    60 }
    77 }
    61 
    78 
    62 EapQtValidator::Status EapQtValidatorRealm::validateGeneral(QVariant value)
    79 EapQtValidator::Status EapQtValidatorRealm::validateGeneral(const QVariant& value)
    63 {
    80 {
    64     Status status(StatusOk);
    81     Status status(StatusOk);
    65     QString str = value.toString();
    82     QString str = value.toString();
    66 
    83 
    67     // input must be of correct type
    84     // input must be of correct type
    80     qDebug("EapQtValidatorRealm::validateGeneral - return status: %d", status);
    97     qDebug("EapQtValidatorRealm::validateGeneral - return status: %d", status);
    81 
    98 
    82     return status;
    99     return status;
    83 }
   100 }
    84 
   101 
    85 void EapQtValidatorRealm::updateEditor(HbLineEdit *edit)
   102 void EapQtValidatorRealm::updateEditor(HbLineEdit* const edit)
    86 {
   103 {
       
   104     qDebug("EapQtValidatorRealm::updateEditor()");
       
   105 
    87     Q_ASSERT(edit);
   106     Q_ASSERT(edit);
    88     if(edit == NULL) {
   107     if(edit == NULL) {
    89         return;
   108         return;
    90     }
   109     }
    91 
   110 
   105         // no realm for other types
   124         // no realm for other types
   106         break;
   125         break;
   107     }
   126     }
   108 }
   127 }
   109 
   128 
   110 void EapQtValidatorRealm::updateEditorGeneral(HbLineEdit *edit)
   129 void EapQtValidatorRealm::updateEditorGeneral(HbLineEdit* const edit)
   111 {
   130 {
   112     qDebug("EapQtValidatorRealm::updateEditorGeneral()");
   131     qDebug("EapQtValidatorRealm::updateEditorGeneral()");
   113 
   132 
   114     Q_ASSERT(edit);
   133     Q_ASSERT(edit);
   115 
   134