btobexprofiles/obexserviceman/obexservicemanclient/inc/ObexSMRequester.h
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2 * Copyright (c) 2006-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:  obexservicemanager client request class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef OBEXSMREQUESTER_H
       
    20 #define OBEXSMREQUESTER_H
       
    21 
       
    22 #include <locodservicepluginobserver.h>
       
    23 
       
    24 #include <e32def.h>
       
    25 #include "ObexSMPlugin.h"
       
    26 
       
    27 class MObexSMRequestObserver;
       
    28 
       
    29 
       
    30 /**
       
    31  *  Active object request class
       
    32  *
       
    33  *  Its instance will be used to control Asynchronous request
       
    34  *  from ECom plugin to obex service manager server
       
    35  *
       
    36  *  @lib obexserviceman.lib
       
    37  *  @since S60 3.2
       
    38  */
       
    39 NONSHARABLE_CLASS(CObexSMRequester) : public CActive
       
    40     {
       
    41 
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Two-phased constructor.
       
    46      *
       
    47      * @param aObserver the request completing observer
       
    48      * @param aBearer the bearer identification
       
    49      * @param aBearStatus the status of this bearer, ETrue
       
    50                  if it is available EFalse otherwise.
       
    51      */
       
    52     static CObexSMRequester* NewL(MObexSMRequestObserver* aObserver,
       
    53                                 TLocodBearer aBearer, TBool aBearStatus); 
       
    54 
       
    55     /**
       
    56      * Two-phased constructor.
       
    57      *
       
    58      * @param aObserver the request completing observer
       
    59      * @param aBearer the bearer identification
       
    60      * @param aBearStatus the status of this bearer, ETrue
       
    61                  if it is available EFalse otherwise.
       
    62      */
       
    63     static CObexSMRequester* NewLC(MObexSMRequestObserver* aObserver,
       
    64                                 TLocodBearer aBearer, TBool aBearStatus); 
       
    65     /**
       
    66      * Destructor.
       
    67      */
       
    68     virtual ~CObexSMRequester();
       
    69 
       
    70     /**
       
    71      * Request function   
       
    72      *   
       
    73      * @since S60 3.2     
       
    74      */
       
    75     void ActivateRequest();
       
    76     /**
       
    77      * Get Request Status     
       
    78      *
       
    79      * @since S60 3.2    
       
    80      * @return the requested status 
       
    81      */
       
    82     TBool GetStatus();
       
    83     
       
    84     /**
       
    85      * Get the requested bearer
       
    86      *
       
    87      * @since S60 3.2    
       
    88      * @return the requested bearer
       
    89      */
       
    90     TLocodBearer GetBearer();
       
    91 
       
    92 protected:
       
    93 
       
    94     // from base class CActive
       
    95     /**
       
    96      * From CActive. 
       
    97      * Cancel current activity.
       
    98      *
       
    99      * @since S60 3.2     
       
   100      */
       
   101     void DoCancel();
       
   102 
       
   103     /**
       
   104      * From CActive. 
       
   105      * Called when read or write operation is ready.
       
   106      *
       
   107      * @since S60 3.2     
       
   108      */
       
   109     void RunL();
       
   110 
       
   111     /**
       
   112      * From CActive. 
       
   113      * Called if RunL() leaves. Retry listening after error.
       
   114      *
       
   115      * @since S60 3.x
       
   116      * @param aError the error code
       
   117      */
       
   118     TInt RunError( TInt aError );
       
   119 
       
   120 private:
       
   121 
       
   122 
       
   123     CObexSMRequester(MObexSMRequestObserver* aObserver, TLocodBearer aBearer, TBool aBearStatus);
       
   124 
       
   125     void ConstructL();
       
   126 
       
   127 private: // data    
       
   128 
       
   129     MObexSMRequestObserver* iObserver;
       
   130     TLocodBearer            iBearer;
       
   131     TBool                   iBearStatus; 
       
   132     };
       
   133 
       
   134 
       
   135 #endif //  OBEXSMREQUESTER_H