connectivitymodules/SeCon/plugins/ftp/inc/sconftpplugin.h
branchRCL_3
changeset 20 4a793f564d72
parent 0 d0791faffa3f
equal deleted inserted replaced
19:0aa8cc770c8a 20:4a793f564d72
       
     1 /*
       
     2 * Copyright (c) 2005-2009 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:  File Transfer Profile Plug-in header file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _SCONFTPPLUGIN_H
       
    20 #define _SCONFTPPLUGIN_H
       
    21 
       
    22 #include <obexserver.h>
       
    23 #include <SrcsInterface.h>
       
    24 
       
    25 #include "sconshutdownwatcher.h"
       
    26 
       
    27 // forward declaration
       
    28 class CSConFTP;
       
    29 class CSConServiceTimer;
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /*
       
    33 * File Transfer Profile Plugin class
       
    34 *
       
    35 */
       
    36 
       
    37 class CSConFTPplugin : public CSrcsInterface, public MObexServerNotify,
       
    38                           public MShutdownObserver
       
    39     {
       
    40     public:
       
    41         static CSConFTPplugin* NewL();
       
    42         ~CSConFTPplugin();
       
    43 
       
    44         /**
       
    45          * Returns active status of OBEX session
       
    46          * @return ETrue if session is active, else EFalse
       
    47          */
       
    48         TBool IsOBEXActive();
       
    49         
       
    50         /**
       
    51          * Device is shutting down, abort connection.
       
    52          */
       
    53         void NotifyShutdown();
       
    54 
       
    55     private:
       
    56         /**
       
    57          * Loads sconftp.dll module
       
    58          * @return none
       
    59          */
       
    60         void LoadFTPDllL();
       
    61         /**
       
    62          * Closes initialized services
       
    63          * @return none
       
    64          */
       
    65         void Disconnect();
       
    66         /**
       
    67          * Removes spaces and nulls from the end of the string
       
    68          * @param aDes String to be formatted
       
    69          * @return none
       
    70          */
       
    71         void TrimRightSpaceAndNull( TDes8& aDes ) const;
       
    72         /**
       
    73          * Current used transfer media (IR,USB,BT)
       
    74          * @param aMediaType Enumeration indicating the media type
       
    75          * @return none
       
    76          */
       
    77         void SetMediaType( TSrcsMediaType aMediaType );
       
    78         /**
       
    79          * MObexServerNotify implementation
       
    80          * @param aError Error code
       
    81          * @return none
       
    82          */
       
    83         void ErrorIndication( TInt aError );
       
    84         /**
       
    85          * MObexServerNotify implementation
       
    86          * @return none
       
    87          */
       
    88         void TransportUpIndication();
       
    89         /**
       
    90          * MObexServerNotify implementation
       
    91          * @return none
       
    92          */
       
    93         void TransportDownIndication();
       
    94         /**
       
    95          * MObexServerNotify implementation
       
    96          * @param aRemoteInfo Structure containing information used during OBEX
       
    97          * connection
       
    98          * @param aInfo Further information about the requested connection
       
    99          * @return System wide error code that indicates the success of the connection
       
   100          */
       
   101         TInt ObexConnectIndication( const TObexConnectInfo& aRemoteInfo,
       
   102                                     const TDesC8& aInfo );
       
   103         /**
       
   104          * MObexServerNotify implementation
       
   105          * @param aInfo Contains information about the disconnection
       
   106          * @return none
       
   107          */
       
   108         void ObexDisconnectIndication( const TDesC8& aInfo );
       
   109         /**
       
   110          * MObexServerNotify implementation
       
   111          * @return CObexBaseObject-derived object, which the object being put
       
   112          * will be parsed into.
       
   113          */
       
   114         CObexBufObject* PutRequestIndication();
       
   115         /**
       
   116          * MObexServerNotify implementation
       
   117          * @return System wide error code that indicates the success of the
       
   118          * PUT packet operation.
       
   119          */
       
   120         TInt PutPacketIndication();
       
   121         /**
       
   122          * MObexServerNotify implementation
       
   123          * @return System wide error code that indicates the success of the
       
   124          * PUT packet operation.
       
   125          */
       
   126         TInt PutCompleteIndication();
       
   127         /**
       
   128          * MObexServerNotify implementation
       
   129          * @param aRequiredObject Details about the object the remote client
       
   130          * has requested
       
   131          * @returnObject to return to the client
       
   132          */
       
   133         CObexBufObject* GetRequestIndication( CObexBaseObject
       
   134                                                 *aRequiredObject );
       
   135         /**
       
   136          * MObexServerNotify implementation
       
   137          * @return System wide error code that indicates the success of the
       
   138          * GET packet operation.
       
   139          */
       
   140         TInt GetPacketIndication();
       
   141         /**
       
   142          * MObexServerNotify implementation
       
   143          * @return System wide error code that indicates the success of the
       
   144          * GET packet operation.
       
   145          */
       
   146         TInt GetCompleteIndication();
       
   147         /**
       
   148          * MObexServerNotify implementation
       
   149          * @param aPathInfo SETPATH command parameters
       
   150          * @param aInfo Not currently used
       
   151          * @return System wide error code indicating the success of the
       
   152          * setpath command.
       
   153          */
       
   154         TInt SetPathIndication( const CObex::TSetPathInfo& aPathInfo,
       
   155                                 const TDesC8& aInfo );
       
   156         /**
       
   157          * SetObexServer
       
   158          * @param aObexServer pass obex server pointer to sevice controller
       
   159          * @return System wide error code.
       
   160          */
       
   161         TInt SetObexServer( CObexServer* aObexServer );
       
   162         /**
       
   163          * MObexServerNotify implementation
       
   164          * @return none
       
   165          */
       
   166         void AbortIndication();
       
   167 
       
   168         void ConstructL();
       
   169     CSConFTPplugin();
       
   170 
       
   171     private:
       
   172         RLibrary                    iFTPlib;
       
   173         CObexBufObject*             iObject;
       
   174         CBufFlat*                   iBuffer;
       
   175         CSConFTP*                   iFTPHandler;
       
   176         TInt                        iPutError;
       
   177         TBool                       iSessionActive;
       
   178         CSConServiceTimer*          iServiceTimer;
       
   179         TBool                       iStartTimer;
       
   180         TSrcsMediaType              iMediaType;
       
   181         CObexFileObject*            iFileObject;
       
   182         TBool                       iPutPacketIndicationCalled;
       
   183         CShutdownWatcher*           iShutdownWatcher;
       
   184         TBool                       iShutdownInProgress;
       
   185         CObexServer*                iObexServer;
       
   186         RSocketServ                 iSocketServer;
       
   187         RBTPhysicalLinkAdapter      iLinkAdapter;
       
   188     private:
       
   189         // Friend class is used,because existing impelentation has been working
       
   190         // properly. Avoiding re-design.
       
   191         friend class CSConServiceTimer;
       
   192     };
       
   193 
       
   194 #endif // SCONPCCONNPLUGIN_H