securitysettings/qtconfigutils/eapqtconfiginterface/src/eapqtvalidatorpacstorepassword.cpp
author hgs
Mon, 24 May 2010 20:32:47 +0300
changeset 26 9abfd4f00d37
permissions -rw-r--r--
201021

/*
 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
 *
 * Contributors:
 *
 * Description: 
 *   EAP method validator: PAC Store password
 *
 */

/*
 * %version: 4 %
 */

#include <HbEditorInterface>
#include <HbLineEdit>
#include "eapqtvalidatorpacstorepassword.h"

EapQtValidatorPacStorePassword::EapQtValidatorPacStorePassword()
{
}

EapQtValidatorPacStorePassword::~EapQtValidatorPacStorePassword()
{
}

EapQtValidator::Status EapQtValidatorPacStorePassword::validate(QVariant value)
{
    // TODO: implement this
    if (value.toString().length() > 0) {
        return EapQtValidator::StatusOk;
    }   
    return EapQtValidator::StatusInvalid;
}

void EapQtValidatorPacStorePassword::updateEditor(HbLineEdit *edit)
{
    HbEditorInterface editInterface(edit);
    editInterface.setInputConstraints(HbEditorConstraintLatinAlphabetOnly);
    edit->setInputMethodHints(Qt::ImhNoPredictiveText | Qt::ImhPreferLowercase);
    // TODO:
    edit->setMaxLength(1000);
}