bluetoothengine/btui/btuidelegate/btdelegatepair.h
author hgs
Fri, 03 Sep 2010 16:17:59 +0300
changeset 57 5ebadcda06cb
parent 42 b72428996822
permissions -rw-r--r--
201035_7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     1
/*
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     3
* All rights reserved.
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     8
*
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
     9
* Initial Contributors:
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    11
*
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    12
* Contributors:
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    13
*
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    14
* Description: 
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    15
*
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    16
*/
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    17
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    18
#ifndef BTDELEGATEPAIR_H
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    19
#define BTDELEGATEPAIR_H
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    20
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    21
#include <e32base.h>
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    22
#include <btengconnman.h>
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    23
#include <hbdialog.h>
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    24
#include <hbdocumentloader.h>
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    25
#include "btabstractdelegate.h"
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    26
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    27
class BtuiModel;
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    28
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    29
/*!
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    30
    \class BtDelegatePair
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    31
    \brief the base class for handling Bluetooth Pair functionality.
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    32
 */
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    33
class BtDelegatePair : public BtAbstractDelegate,
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    34
        public MBTEngConnObserver
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    35
{
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    36
    Q_OBJECT
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    37
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    38
public:
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    39
    explicit BtDelegatePair(             
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    40
            BtSettingModel* settingModel, 
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    41
            BtDeviceModel* deviceModel, QObject *parent = 0 );
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    42
    
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    43
    virtual ~BtDelegatePair();
57
5ebadcda06cb 201035_7
hgs
parents: 42
diff changeset
    44
    
5ebadcda06cb 201035_7
hgs
parents: 42
diff changeset
    45
    int supportedEditorTypes() const;
31
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    46
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    47
    virtual void exec( const QVariant &params );
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    48
    
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    49
    virtual void cancel();
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    50
    
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    51
public slots:
42
hgs
parents: 31
diff changeset
    52
    void powerDelegateCompleted(int error);
31
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    53
protected:
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    54
    //From MBTEngConnObserver
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    55
    virtual void ConnectComplete( TBTDevAddr& aAddr, TInt aErr, 
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    56
                                   RBTDevAddrArray* aConflicts );
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    57
    virtual void DisconnectComplete( TBTDevAddr& aAddr, TInt aErr );
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    58
    virtual void PairingComplete( TBTDevAddr& aAddr, TInt aErr );
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    59
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    60
private:
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    61
    void launchWaitDialog();
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    62
    void emitCommandComplete(int error);
42
hgs
parents: 31
diff changeset
    63
    void exec_pair();
31
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    64
    
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    65
private:
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    66
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    67
    CBTEngConnMan *mBtengConnMan;
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    68
    HbDialog *mWaitDialog;
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    69
    QString mdeviceName;
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    70
    
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    71
    HbDocumentLoader *mLoader;
42
hgs
parents: 31
diff changeset
    72
    BtAbstractDelegate* mAbstractDelegate;
hgs
parents: 31
diff changeset
    73
    QModelIndex deviceIndex;
31
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    74
    
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    75
    Q_DISABLE_COPY(BtDelegatePair)
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    76
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    77
};
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    78
a0ea99b6fa53 201019_1
hgs
parents:
diff changeset
    79
#endif /* BTDELEGATEPAIR_H */