bluetoothengine/btpbap/inc/DisconnectHelper.h
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2007-2007 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:  This is the Disconnection helper class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DISCONNECTHELPER_H
       
    20 #define DISCONNECTHELPER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 /**
       
    25  *  Callback interface for completing disconnection helper
       
    26  *
       
    27  *  @since S60 v3.2
       
    28  */
       
    29 class MDisconnectionCallback
       
    30     {
       
    31 
       
    32 public:
       
    33 
       
    34     /**
       
    35      * From MDisconnectionCallback.
       
    36      * Callback funtion for completing asynchronous disconnection request
       
    37      *
       
    38      * @since S60 v3.2
       
    39      */
       
    40     virtual void CompleteDisconnection()=0;
       
    41     };
       
    42 
       
    43 
       
    44 /**
       
    45  *  Helper class for handling asynchronous disconnection request
       
    46  *
       
    47  *  @since S60 v3.2
       
    48  */
       
    49 class CDisconnectHelper : public CActive
       
    50     {
       
    51 
       
    52 public:
       
    53 
       
    54     /**
       
    55      * Two-phased constructor.
       
    56      * @param aParams the LocodServicePluginParams
       
    57      */
       
    58     static CDisconnectHelper* NewL( MDisconnectionCallback* aObserver );
       
    59 
       
    60     /**
       
    61      * Destructor.
       
    62      */
       
    63     ~CDisconnectHelper();
       
    64 
       
    65     /**
       
    66      * Activate helper class for handling asynchronous disconnection
       
    67      *
       
    68      * @since S60 v3.2
       
    69      * @return Error code
       
    70      */
       
    71      TInt Activate();
       
    72 
       
    73     /**
       
    74      * From CActive
       
    75      *
       
    76      * @since S60 v3.2
       
    77      */
       
    78      void RunL();
       
    79 
       
    80     /**
       
    81      * From CActive
       
    82      *
       
    83      * @since S60 v3.2
       
    84      */
       
    85      void DoCancel();
       
    86 
       
    87 private:
       
    88 
       
    89     CDisconnectHelper( MDisconnectionCallback* aObserver );
       
    90 
       
    91     void ConstructL();
       
    92 
       
    93 private: // data
       
    94 
       
    95     /*
       
    96      * Callback interface, which is used when disconnect helper
       
    97      * is completed.
       
    98      * Not own.
       
    99      */
       
   100     MDisconnectionCallback* iObserver;
       
   101 
       
   102     };
       
   103 
       
   104 #endif // BTPBAPPLUGIN