mtptransports/mtpcontroller/inc/cmtpoperator.h
changeset 0 d0791faffa3f
child 6 ef55b168cedb
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef CMTPOPERATOR_H_
       
    24 #define CMTPOPERATOR_H_
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <mtp/rmtpclient.h>
       
    28 #include "mmtpoperatornotifier.h"
       
    29 #include "mtpdebug.h"
       
    30 
       
    31 NONSHARABLE_CLASS( CMTPOperator ) : public CActive
       
    32     {
       
    33 private:
       
    34     enum TOperationType
       
    35         {
       
    36         EStartTransport,
       
    37         EStopTransport
       
    38         };
       
    39     
       
    40     struct TOperation
       
    41         {
       
    42         TInt iType;
       
    43         TUid iTransport;
       
    44         };
       
    45     
       
    46 public:
       
    47     static CMTPOperator* NewL( MMTPOperatorNotifier& aNotifier );
       
    48     
       
    49     ~CMTPOperator();
       
    50     
       
    51 public:
       
    52     void StartTransport( TUid aTransport );
       
    53     void StopTransport( TUid aTransport );
       
    54     
       
    55 private:// From CActive
       
    56     void DoCancel();
       
    57     void RunL();
       
    58     
       
    59 private:
       
    60     CMTPOperator( MMTPOperatorNotifier& aNotifier );
       
    61     void ConstructL();
       
    62     TInt AppendOperation( TOperationType aType, TUid aTransport );
       
    63     void Schedule( TInt aError );
       
    64     void HandleOperationL( const TOperation& aOperation );
       
    65 private:
       
    66     /**
       
    67      * FLOGGER debug trace member variable.
       
    68      */
       
    69     __FLOG_DECLARATION_MEMBER_MUTABLE;
       
    70     
       
    71     MMTPOperatorNotifier& iNotifier;
       
    72     
       
    73     RArray< TOperation > iPendingOperations;
       
    74     
       
    75     RMTPClient iMTPClient;
       
    76     };
       
    77 
       
    78 #endif /* CMTPOPERATOR_H_ */