btobexprofiles/obexsendservices/obexservicesendutils/inc/BTServiceDelayedDestroyer.h
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  The base active object declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef BT_SERVICE_DELAYED_DESTROYER_H
       
    20 #define BT_SERVICE_DELAYED_DESTROYER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <btengdiscovery.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 NONSHARABLE_CLASS (CBTServiceDelayedDestroyer) : public CActive
       
    27     {
       
    28     
       
    29 public:
       
    30 
       
    31     static CBTServiceDelayedDestroyer* NewL(CActive::TPriority aPriority);
       
    32 
       
    33     static CBTServiceDelayedDestroyer* NewLC(CActive::TPriority aPriority);
       
    34 
       
    35     virtual ~CBTServiceDelayedDestroyer();
       
    36 
       
    37 public:
       
    38 
       
    39     /**
       
    40      * Calls SetActive().
       
    41      */
       
    42     void GoActive();
       
    43     
       
    44     // Sets the pointer which will be destroyed.
       
    45     // Must be called with GoActive, they are pairs, first 
       
    46     // call SetDestructPointer and then GoActive.
       
    47     void SetDestructPointer(CBTEngDiscovery* aPtr);
       
    48 
       
    49 private:    
       
    50 
       
    51     /**
       
    52      * From CActive. 
       
    53      * cancels the outstanding request.
       
    54      */
       
    55     virtual void DoCancel();
       
    56 
       
    57     /**
       
    58      * From CActive. 
       
    59      * Handles the request completion event.
       
    60      * Deletes CBTEngDiscovery object which is passed via SetDestructPointer method.
       
    61      */
       
    62     virtual void RunL();
       
    63 
       
    64     /**
       
    65      * From CActive. 
       
    66      * Handles the leave from RunL().
       
    67      * @param aError the leave code in RunL()
       
    68      * @return the error code to Active Scheduler
       
    69      */
       
    70     virtual TInt RunError(TInt aError);
       
    71 
       
    72 private:    
       
    73 
       
    74     CBTServiceDelayedDestroyer(CActive::TPriority aPriority);
       
    75 
       
    76 private:
       
    77     TRequestStatus iStatus;
       
    78     CBTEngDiscovery* iPtr;    
       
    79     };
       
    80 
       
    81 #endif  // BT_SERVICE_DELAYED_DESTROYER_H