mtpdataproviders/mtppictbridgedp/inc/cmtppictbridgeprinter.h
changeset 0 d0791faffa3f
child 47 63cf70d3ecd8
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 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  @file
       
    18  @internalComponent
       
    19  */
       
    20 
       
    21 
       
    22 #ifndef CMTPPICTBRIDGEPRINTER_H
       
    23 #define CMTPPICTBRIDGEPRINTER_H
       
    24 #include <mtp/tmtptypeevent.h>
       
    25 #include "mtpdebug.h"
       
    26 
       
    27 class CMTPTypeObjectInfo;
       
    28 class MMTPConnection;
       
    29 class CPtpServer;
       
    30 class CPtpSession;
       
    31 class MServiceHandlerObserver;
       
    32 class CPtpReceivedMsgHandler;
       
    33 class CMTPPictBridgeUsbConnection; 
       
    34 
       
    35 class CMTPPictBridgePrinter : public CBase
       
    36     {
       
    37     public:
       
    38         enum TPrinterStatus
       
    39             {
       
    40             ENotConnected,
       
    41             EConnected,
       
    42             ENotPrinter
       
    43             };
       
    44         static CMTPPictBridgePrinter* NewL(CPtpServer& aServer);
       
    45         ~CMTPPictBridgePrinter();
       
    46         void ConnectionClosed();
       
    47         void DpsDiscovery(const TFileName& aFileName, MMTPConnection* aConnectionP);
       
    48         void SendDpsFileL(const TDesC& aFile, TBool aTimeout, TInt aSize); 
       
    49         void CancelSendDpsFile();
       
    50         void DpsFileSent(TInt aError);
       
    51         
       
    52         void DpsObjectReceived(TUint32 aHandle);
       
    53         void ObjectReceived(TDes& aFile);
       
    54 
       
    55         void DeRegisterDpsPrinterNotify(CPtpSession* aSession);
       
    56         void RegisterDpsPrinterNotify(CPtpSession* aSession);
       
    57 
       
    58         void RegisterObserver(MServiceHandlerObserver* aObserverP);
       
    59         void  NoDpsDiscovery();
       
    60         TBool SendObjectPending() const;
       
    61         MMTPConnection* ConnectionP() const;
       
    62         TPrinterStatus Status() const;
       
    63         CPtpReceivedMsgHandler* MsgHandlerP() const;
       
    64         inline const CMTPPictBridgeUsbConnection* UsbConnectionP() const { return iUsbConnectionP; }
       
    65     private:
       
    66         void ConstructL();
       
    67         CMTPPictBridgePrinter(CPtpServer& aServer);
       
    68         void CreateRequestObjectTransfer(TUint32 aHandle, TMTPTypeEvent& aEvent);
       
    69     private:
       
    70         CPtpServer& iServer;
       
    71         MMTPConnection* iPrinterConnectionP;  // not owned
       
    72         TPrinterStatus iPrinterStatus;
       
    73         CPtpSession* iDpsPrinterNotifyCbP; // not owned
       
    74         CPtpReceivedMsgHandler* iMsgHandlerP; // owned
       
    75         MServiceHandlerObserver* iObserverP; // not owned
       
    76         TUint32 iOutgoingObjectHandle;
       
    77         CMTPPictBridgeUsbConnection* iUsbConnectionP; // owned
       
    78         TMTPTypeEvent iEvent;
       
    79         /**
       
    80         FLOGGER debug trace member variable.
       
    81         */
       
    82         __FLOG_DECLARATION_MEMBER_MUTABLE;
       
    83     };
       
    84 #endif // CMTPPICTBRIDGEPRINTER_H