localconnectivityservice/obexsendservices/obexservicesendutils/inc/BTSBIPController.h
branchRCL_3
changeset 39 4096754ee773
parent 38 3dcb815346df
child 40 52a167391590
equal deleted inserted replaced
38:3dcb815346df 39:4096754ee773
     1 /*
       
     2 * Copyright (c) 2002 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:  Image push controller
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BT_BIP_CONTROLLER_H
       
    21 #define BT_BIP_CONTROLLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "BTServiceClient.h"
       
    25 #include "BTServiceStarter.h"
       
    26 #include "BTSController.h"
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  Control class for the Image sending
       
    32 */
       
    33 NONSHARABLE_CLASS (CBTSBIPController) : public CBTSController, 
       
    34                                         public MBTServiceClientObserver                                    
       
    35 
       
    36     {
       
    37     public:  // Constructors and destructor
       
    38         
       
    39         /**
       
    40         * Two-phased constructor.
       
    41         */
       
    42         static CBTSBIPController* NewL( MBTServiceObserver* aObserver,
       
    43             const TUint aRemotePort,
       
    44             const TBTDevAddr& aRemoteDevice,
       
    45             CBTServiceParameterList* aList  );
       
    46         
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         virtual ~CBTSBIPController();
       
    51 
       
    52     private: // Functions from base classes
       
    53 
       
    54         /**
       
    55         * From MBTServiceClientObserver A Connect operation has been completed.
       
    56         * @param aStatus The status of the operation.
       
    57         * @return None.
       
    58         */
       
    59         void ConnectCompleted( TInt aStatus );
       
    60 
       
    61         /**
       
    62         * From MBTServiceClientObserver The client connection has been closed.
       
    63         * @param None.
       
    64         * @return None.
       
    65         */
       
    66         void ClientConnectionClosed();
       
    67 
       
    68         /**
       
    69         * From MBTServiceClientObserver A Put operation has been completed. 
       
    70         * @param aStatus The status of the operation.
       
    71         * @param aPutResponse Response packet from remote device.
       
    72         * @return None.
       
    73         */
       
    74         void PutCompleted( TInt aStatus, const CObexHeaderSet* aPutResponse );
       
    75         
       
    76         /**
       
    77         * From MBTServiceClientObserver A Get operation has been completed. 
       
    78         * @param aStatus The status of the operation.
       
    79         * @param aGetResponse Response packet from remote device.
       
    80         * @return None.
       
    81         */
       
    82         void GetCompleted( TInt aStatus, CObexBufObject* aGetResponse );
       
    83         
       
    84         /**
       
    85         * From MBTServiceClientObserver A Connect operation is timed out.
       
    86         * @return None.
       
    87         */
       
    88         void ConnectTimedOut();
       
    89         
       
    90 
       
    91     private:
       
    92 
       
    93         /**
       
    94         * C++ default constructor.
       
    95         */
       
    96         CBTSBIPController( MBTServiceObserver* aObserver,
       
    97                            CBTServiceParameterList* aList );
       
    98 
       
    99         /**
       
   100         * By default Symbian 2nd phase constructor is private.
       
   101         */
       
   102         void ConstructL( const TUint aRemotePort,
       
   103                          const TBTDevAddr& aRemoteDeviceAddr );
       
   104     
       
   105     private:
       
   106 
       
   107         /**
       
   108         * Send image 
       
   109         * @param None.
       
   110         * @return None.
       
   111         */
       
   112         void SendL();
       
   113         
       
   114         /**
       
   115         * Send thumbnail image
       
   116         * @param aPutResponse Response packet containing the image handle
       
   117         * @return None.
       
   118         */
       
   119         void SendThumbnailL( const CObexHeaderSet* aPutResponse );
       
   120 
       
   121         /**
       
   122         * Get capabilities object from remote device 
       
   123         * @param None.
       
   124         * @return None.
       
   125         */
       
   126         void GetL();
       
   127 
       
   128         /**
       
   129         * Create temp file
       
   130         * @param aFileName Name of the file that was created
       
   131         * @return None.
       
   132         */
       
   133         void CreateTempFileL( TFileName& aFileName );
       
   134         
       
   135         /**
       
   136         * Generate a temp file name
       
   137         * @param aFileName File name that was created.
       
   138         * @return None.
       
   139         */
       
   140         void GenerateTempFileNameL( TFileName& aFileName );
       
   141         
       
   142         /**
       
   143         * Delete a temp file 
       
   144         * @param aFileName Name of the file.
       
   145         * @return None.
       
   146         */
       
   147         void DeleteTempFile( TFileName& aFileName );
       
   148 
       
   149         /**
       
   150         * Create image descriptor 
       
   151         * @param None.
       
   152         * @return HBufC8*.
       
   153         */
       
   154         HBufC8* CreateImageDescriptorL();
       
   155 
       
   156         /**
       
   157         * Handle GetCompleteIndication
       
   158         * @param aGetResponse Get response packet from remote device
       
   159         * @return None.
       
   160         */
       
   161         void HandleGetCompleteIndicationL( CObexBufObject* aGetResponse );
       
   162     
       
   163     private:    // Data
       
   164         
       
   165         TInt                        iFileIndex;
       
   166         TFileName                   iThumbnailFileName;
       
   167         TFileName                   iTempFileName;
       
   168 		
       
   169 
       
   170         // Not owned
       
   171         //        
       
   172         CBTServiceParameterList*    iListPtr;
       
   173         MBTServiceObserver*         iObserverPtr;
       
   174         
       
   175     };
       
   176 
       
   177 #endif      // BT_BIP_CONTROLLER_H
       
   178             
       
   179 // End of File