localconnectivityservice/obexsendservices/obexserviceirsend/inc/IRClient.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:  Obex client
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef IR_SERVICE_CLIENT_H
       
    21 #define IR_SERVICE_CLIENT_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 
       
    26 #include <obex.h>
       
    27 #include <obexutilsdialog.h>
       
    28 #include <AiwServiceHandler.h>
       
    29 
       
    30 
       
    31 // FORWARD DECLARATION
       
    32 
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 *  An active object managing the Obex client.
       
    40 */
       
    41 class CIRClient : public CActive, 
       
    42                   MObexUtilsProgressObserver,
       
    43                   MObexUtilsDialogObserver                         
       
    44                          
       
    45     {
       
    46     public:  // Constructors and destructor
       
    47         
       
    48         /**
       
    49         * Two-phased constructor.        
       
    50         * @return None.
       
    51         */
       
    52         static CIRClient* NewL();
       
    53         
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         virtual ~CIRClient();
       
    58 
       
    59     public: // New functions        
       
    60         
       
    61 
       
    62         /**
       
    63         * Issues an Obex Put-request.        
       
    64         * @param aHeaderList The headers to be associated with the object.
       
    65         * @param aFileName A filename of the Put Object.
       
    66         * @return None.
       
    67         */
       
    68         void PutObjectL( );
       
    69 
       
    70         /**
       
    71         * Closes Obex Client connection.
       
    72         * @param None.
       
    73         * @return None.
       
    74         */
       
    75         void CloseClientConnection();
       
    76         
       
    77         
       
    78         void StartSendL( const CAiwGenericParamList& aOutParamList );
       
    79 
       
    80     private: // Functions from base classes
       
    81 
       
    82         /**
       
    83         * From MBTServiceProgressGetter Returns the progess status.
       
    84         * @return The number of bytes sent.
       
    85         */
       
    86         TInt GetProgressStatus();
       
    87         
       
    88         void DialogDismissed( TInt aButtonId );
       
    89         
       
    90         void PutCompleted();
       
    91 
       
    92         
       
    93     private: // Functions from base classes
       
    94         
       
    95 
       
    96         /**
       
    97         * From CActive Get's called when a request is cancelled.
       
    98         * @param None.
       
    99         * @return None.
       
   100         */
       
   101         void DoCancel();
       
   102 
       
   103         /**
       
   104         * From CActive Get's called when a request is completed.
       
   105         * @param None.
       
   106         * @return None.
       
   107         */
       
   108 	    void RunL();
       
   109 	    
       
   110 	    void AddFileHandleL(RFile aFile);
       
   111 	    
       
   112 	    void AddFileL(const TDesC& aFilePath);
       
   113 	    
       
   114 	    void SendL();
       
   115 	    
       
   116 	    TInt FileListsize();
       
   117 	    
       
   118 	    void ShowNote();
       
   119 
       
   120     private:    // Data definitions
       
   121 
       
   122         enum TIRServiceClientState
       
   123             {            
       
   124             EIRCliConnecting,
       
   125             EIRCliPutting,
       
   126             EIRCliGetting,
       
   127             EIRCliDisconnected
       
   128             };
       
   129 
       
   130     private:
       
   131 
       
   132         /**
       
   133         * C++ default constructor.
       
   134         */
       
   135         CIRClient( );
       
   136 
       
   137         /**
       
   138         * By default Symbian 2nd phase constructor is private.
       
   139         */
       
   140         void ConstructL();
       
   141 
       
   142     private:    // Data
       
   143 
       
   144         TIRServiceClientState       iClientState;
       
   145 
       
   146         CObexClient*                iClient;
       
   147         CBufFlat*                   iObjectBuffer;
       
   148         CObexBufObject*             iPutBufObject;        
       
   149         CObexNullObject*            iConnectObject;
       
   150         TInt                        iTotalBytesSent;        
       
   151         TInt                        iObjectIndex;
       
   152         RArray<RFile>               iFileArray;
       
   153         RFs                         iFileSession;
       
   154         CBufFlat*                   iBuffer;
       
   155         CObexUtilsDialog*           iDialog;
       
   156         
       
   157 
       
   158         // Not owned
       
   159         //
       
   160         
       
   161     };
       
   162 
       
   163 #endif      // BT_SERVICE_CLIENT_H
       
   164             
       
   165 // End of File