wlanutilities/wlanwizard/t_wlanwizard/stubs/eapqtvalidator.h
changeset 56 de27cc8389dd
parent 50 d4198dcb9983
child 58 301aeb18ae47
equal deleted inserted replaced
50:d4198dcb9983 56:de27cc8389dd
     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  *   Stub for EAP WIZARD testing: EAP QT configuration validator interface
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 2 %
       
    21  */
       
    22 
       
    23 #ifndef EAPQTVALIDATOR_H
       
    24 #define EAPQTVALIDATOR_H
       
    25 
       
    26 #include <QVariant>
       
    27 #include <eapqtconfigdefs.h>
       
    28 
       
    29 /*!
       
    30  * @addtogroup group_eap_config_api
       
    31  * @{
       
    32  */
       
    33 
       
    34 class HbLineEdit;
       
    35 
       
    36 /*!
       
    37  * Eap Qt Validator interface. This interface provides a method to configure
       
    38  * the editor to use required constraints, hints, editor classes and so one
       
    39  * depending on the EAP type and the configuration identifier.
       
    40  * See updateEditor() method for further details.
       
    41  * 
       
    42  * Another important method of this class is the validate() method. With
       
    43  * that method you can check that the content and format is valid for 
       
    44  * given configuration compination.
       
    45  * 
       
    46  * An instance of validator can be created with 
       
    47  * EapQtConfigInterface::validatorEap() method.
       
    48  */
       
    49 
       
    50 class EapQtValidator
       
    51 {
       
    52 public:
       
    53 
       
    54     /*!
       
    55      * Validation status.
       
    56      */
       
    57     enum Status {
       
    58         /// Ok
       
    59         StatusOk,
       
    60         /// Content is invalid
       
    61         StatusInvalid,
       
    62         /// The length is not valid
       
    63         StatusInvalidLength,
       
    64         /// Invalid characters detected
       
    65         StatusInvalidCharacters,
       
    66         /// Input is too short
       
    67         StatusTooShort, 
       
    68         /// Input is too long
       
    69         StatusTooLong,  
       
    70     };
       
    71     
       
    72 public:
       
    73 
       
    74     EapQtValidator() {};
       
    75     virtual ~EapQtValidator() {};
       
    76     virtual Status validate(QVariant value) = 0;
       
    77     virtual void updateEditor(HbLineEdit* edit) = 0;
       
    78     
       
    79 private:
       
    80 
       
    81     Q_DISABLE_COPY(EapQtValidator)
       
    82 };
       
    83 
       
    84 /*! @} */
       
    85 
       
    86 #endif