cpsecplugins/cpadvancedsecplugin/inc/advsecsettingssecuritymodulemodel.h
author hgs
Wed, 20 Oct 2010 14:51:23 +0300
changeset 66 67b3e3c1fc87
parent 63 989397f9511c
permissions -rw-r--r--
201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63
989397f9511c 201039_03
hgs
parents:
diff changeset
     1
/*
989397f9511c 201039_03
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
989397f9511c 201039_03
hgs
parents:
diff changeset
     3
* All rights reserved.
989397f9511c 201039_03
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
989397f9511c 201039_03
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0""
989397f9511c 201039_03
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
989397f9511c 201039_03
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
989397f9511c 201039_03
hgs
parents:
diff changeset
     8
*
989397f9511c 201039_03
hgs
parents:
diff changeset
     9
* Initial Contributors:
989397f9511c 201039_03
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
989397f9511c 201039_03
hgs
parents:
diff changeset
    11
*
989397f9511c 201039_03
hgs
parents:
diff changeset
    12
* Contributors:
989397f9511c 201039_03
hgs
parents:
diff changeset
    13
*
989397f9511c 201039_03
hgs
parents:
diff changeset
    14
* Description:  Security module model in advanced security settings
989397f9511c 201039_03
hgs
parents:
diff changeset
    15
*
989397f9511c 201039_03
hgs
parents:
diff changeset
    16
*/
989397f9511c 201039_03
hgs
parents:
diff changeset
    17
989397f9511c 201039_03
hgs
parents:
diff changeset
    18
#ifndef ADVSECSETTINGSSECURITYMODULEMODEL_H
989397f9511c 201039_03
hgs
parents:
diff changeset
    19
#define ADVSECSETTINGSSECURITYMODULEMODEL_H
989397f9511c 201039_03
hgs
parents:
diff changeset
    20
989397f9511c 201039_03
hgs
parents:
diff changeset
    21
#include <QObject>
989397f9511c 201039_03
hgs
parents:
diff changeset
    22
#include <QMap>
989397f9511c 201039_03
hgs
parents:
diff changeset
    23
989397f9511c 201039_03
hgs
parents:
diff changeset
    24
class AdvSecSettingsSecurityModule;
989397f9511c 201039_03
hgs
parents:
diff changeset
    25
class AdvSecSettingsSecurityModuleModelPrivate;
989397f9511c 201039_03
hgs
parents:
diff changeset
    26
989397f9511c 201039_03
hgs
parents:
diff changeset
    27
989397f9511c 201039_03
hgs
parents:
diff changeset
    28
/**
989397f9511c 201039_03
hgs
parents:
diff changeset
    29
 * Security module model in advanced security settings.
989397f9511c 201039_03
hgs
parents:
diff changeset
    30
 */
989397f9511c 201039_03
hgs
parents:
diff changeset
    31
class AdvSecSettingsSecurityModuleModel : public QObject
989397f9511c 201039_03
hgs
parents:
diff changeset
    32
{
989397f9511c 201039_03
hgs
parents:
diff changeset
    33
    Q_OBJECT
989397f9511c 201039_03
hgs
parents:
diff changeset
    34
989397f9511c 201039_03
hgs
parents:
diff changeset
    35
public:     // constructor and destructor
989397f9511c 201039_03
hgs
parents:
diff changeset
    36
    explicit AdvSecSettingsSecurityModuleModel(QObject *parent = 0);
989397f9511c 201039_03
hgs
parents:
diff changeset
    37
    virtual ~AdvSecSettingsSecurityModuleModel();
989397f9511c 201039_03
hgs
parents:
diff changeset
    38
989397f9511c 201039_03
hgs
parents:
diff changeset
    39
public:     // new definitions
989397f9511c 201039_03
hgs
parents:
diff changeset
    40
    enum SecurityModuleDetailsField {
989397f9511c 201039_03
hgs
parents:
diff changeset
    41
        Label,
989397f9511c 201039_03
hgs
parents:
diff changeset
    42
        Version,
989397f9511c 201039_03
hgs
parents:
diff changeset
    43
        Location,
989397f9511c 201039_03
hgs
parents:
diff changeset
    44
        SerialNumber,
989397f9511c 201039_03
hgs
parents:
diff changeset
    45
        Manufacturer
989397f9511c 201039_03
hgs
parents:
diff changeset
    46
    };
989397f9511c 201039_03
hgs
parents:
diff changeset
    47
    enum AuthenticationStatus {
989397f9511c 201039_03
hgs
parents:
diff changeset
    48
        EPinEntered         = 0x01, // Set if the module is open, PIN already entered
989397f9511c 201039_03
hgs
parents:
diff changeset
    49
        EPinRequested       = 0x02, // Set if PIN code required to open the module
989397f9511c 201039_03
hgs
parents:
diff changeset
    50
        EPinChangeAllowed   = 0x04, // Set if PIN code change is allowed
989397f9511c 201039_03
hgs
parents:
diff changeset
    51
        EPinBlocked         = 0x10, // Set if PIN code is blocked, requires unblocking PIN
989397f9511c 201039_03
hgs
parents:
diff changeset
    52
        EBlockedPermanently = 0x20, // Set if PIN code blocked and cannot be unblocked
989397f9511c 201039_03
hgs
parents:
diff changeset
    53
    };
989397f9511c 201039_03
hgs
parents:
diff changeset
    54
989397f9511c 201039_03
hgs
parents:
diff changeset
    55
public:     // new functions
989397f9511c 201039_03
hgs
parents:
diff changeset
    56
    void initialize();
989397f9511c 201039_03
hgs
parents:
diff changeset
    57
    int moduleCount() const;
989397f9511c 201039_03
hgs
parents:
diff changeset
    58
    QMap<QString,QString> moduleLabelsAndLocations() const;
989397f9511c 201039_03
hgs
parents:
diff changeset
    59
    void getModuleDetails(int moduleIndex);
989397f9511c 201039_03
hgs
parents:
diff changeset
    60
    void getModuleStatus(int moduleIndex);
989397f9511c 201039_03
hgs
parents:
diff changeset
    61
    // Functions related to PIN-G (aka access PIN, login PIN)
989397f9511c 201039_03
hgs
parents:
diff changeset
    62
    void setPinCodeRequestState(int moduleIndex, bool isRequested);
989397f9511c 201039_03
hgs
parents:
diff changeset
    63
    void changePinCode(int moduleIndex);  // unblocks PIN code if EPinBlocked
989397f9511c 201039_03
hgs
parents:
diff changeset
    64
    void closeModule(int moduleIndex);
989397f9511c 201039_03
hgs
parents:
diff changeset
    65
    // Functions related to PIN-NR (aka signature PIN, signing PIN)
989397f9511c 201039_03
hgs
parents:
diff changeset
    66
    bool isSigningPinSupported(int moduleIndex) const;
989397f9511c 201039_03
hgs
parents:
diff changeset
    67
    void changeSigningPinCode(int moduleIndex);
989397f9511c 201039_03
hgs
parents:
diff changeset
    68
    bool isDeletable(int moduleIndex) const;
989397f9511c 201039_03
hgs
parents:
diff changeset
    69
    void deleteModule(int moduleIndex);
989397f9511c 201039_03
hgs
parents:
diff changeset
    70
989397f9511c 201039_03
hgs
parents:
diff changeset
    71
signals:
989397f9511c 201039_03
hgs
parents:
diff changeset
    72
    void initializeCompleted();
989397f9511c 201039_03
hgs
parents:
diff changeset
    73
    void detailsCompleted(QMap<int,QString> details);
989397f9511c 201039_03
hgs
parents:
diff changeset
    74
    void statusCompleted(int authenticationStatus);
989397f9511c 201039_03
hgs
parents:
diff changeset
    75
    void statusChanged(int moduleIndex, int authenticationStatus);
989397f9511c 201039_03
hgs
parents:
diff changeset
    76
    void pinCodeRequestStateCompleted();
989397f9511c 201039_03
hgs
parents:
diff changeset
    77
    void pinCodeChangeCompleted();
989397f9511c 201039_03
hgs
parents:
diff changeset
    78
    void closeCompleted();
989397f9511c 201039_03
hgs
parents:
diff changeset
    79
    void signingPinCodeChangeCompleted();
989397f9511c 201039_03
hgs
parents:
diff changeset
    80
    void deleteCompleted();
989397f9511c 201039_03
hgs
parents:
diff changeset
    81
    void errorOccurred(int error);
989397f9511c 201039_03
hgs
parents:
diff changeset
    82
989397f9511c 201039_03
hgs
parents:
diff changeset
    83
private:    // new functions
989397f9511c 201039_03
hgs
parents:
diff changeset
    84
    void handleInitializeCompleted();
989397f9511c 201039_03
hgs
parents:
diff changeset
    85
    void handleStatusCompleted(int authenticationStatus);
989397f9511c 201039_03
hgs
parents:
diff changeset
    86
    void handleStatusChanged(int moduleIndex, int authenticationStatus);
989397f9511c 201039_03
hgs
parents:
diff changeset
    87
    void handlePinCodeRequestSet();
989397f9511c 201039_03
hgs
parents:
diff changeset
    88
    void handlePinCodeChanged();
989397f9511c 201039_03
hgs
parents:
diff changeset
    89
    void handleModuleClosed();
989397f9511c 201039_03
hgs
parents:
diff changeset
    90
    void handleSigningPinCodeChanged();
989397f9511c 201039_03
hgs
parents:
diff changeset
    91
    void handleModuleDeleted();
989397f9511c 201039_03
hgs
parents:
diff changeset
    92
    void handleError(int error);
989397f9511c 201039_03
hgs
parents:
diff changeset
    93
989397f9511c 201039_03
hgs
parents:
diff changeset
    94
private:    // data
989397f9511c 201039_03
hgs
parents:
diff changeset
    95
    Q_DISABLE_COPY(AdvSecSettingsSecurityModuleModel)
989397f9511c 201039_03
hgs
parents:
diff changeset
    96
    friend class AdvSecSettingsSecurityModuleModelPrivate;
989397f9511c 201039_03
hgs
parents:
diff changeset
    97
    AdvSecSettingsSecurityModuleModelPrivate *d_ptr;
989397f9511c 201039_03
hgs
parents:
diff changeset
    98
};
989397f9511c 201039_03
hgs
parents:
diff changeset
    99
989397f9511c 201039_03
hgs
parents:
diff changeset
   100
#endif // ADVSECSETTINGSSECURITYMODULEMODEL_H