upnpframework/upnpfiletransferengine/inc/upnpfiletransferengine.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  Header file for the CUpnpFileTransferEngine class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef UPNP_FILE_TRANSFER_ENGINE_H
       
    20 #define UPNP_FILE_TRANSFER_ENGINE_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CUpnpContainer;
       
    27 class CUpnpItem;
       
    28 class MUPnPAVBrowsingSession;
       
    29 class MUPnPAVController;
       
    30 class CUpnpFileTransferHandler;
       
    31 class CDesC8ArrayFlat;
       
    32 class CUpnpUploadHandler;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 * CUpnpFileTransferEngine
       
    38 * The class works as an interface component, providing file transfer features
       
    39 * for the clients.
       
    40 *
       
    41 * @since S60 3.0
       
    42 */
       
    43 class CUpnpFileTransferEngine : public CBase
       
    44     {
       
    45 
       
    46     public: // Constructors and destructor
       
    47 
       
    48         /**
       
    49          * Two-phased constructor.
       
    50          *
       
    51          * Leaves (KErrArgument) if the provided UpnpAvBrowsingSession
       
    52          * pointer is not valid.
       
    53          *
       
    54          * @since S60 3.0
       
    55          * @param aBrowsingSession (MUPnPAVBrowsingSession*) pointer to the
       
    56          *        browsing session
       
    57          */
       
    58          IMPORT_C static CUpnpFileTransferEngine* NewL(
       
    59                             MUPnPAVBrowsingSession* aBrowsingSession );
       
    60 
       
    61         /**
       
    62          * Destructor.
       
    63          */
       
    64         virtual ~CUpnpFileTransferEngine();
       
    65 
       
    66     public: // New methods for transfering content to handset
       
    67 
       
    68         /**
       
    69          * Copies items (whose object ids are provided) from a remote Upnp
       
    70          * Media Server to the handset. The files are stored in the location
       
    71          * defined in the settings of the Home Media application.
       
    72          *
       
    73          * Leaves using e32err.h error codes if operation fails.
       
    74          *
       
    75          * @since S60 3.2
       
    76          * @param aObjectIds (CDesC8ArrayFlat*) list of object IDs to copy
       
    77          * @return TInt a number of copied files
       
    78          */
       
    79         IMPORT_C TInt CopyToHandsetL( CDesC8ArrayFlat* aObjectIds );
       
    80 
       
    81     public: // Transfer content from handset to remote UPnP Media Server
       
    82 
       
    83        /**
       
    84          * Copies local files to a remote media server. DLNA Any Container
       
    85          * feature will be used. Removes files from the array which are 
       
    86          * succesfully moved.
       
    87          *
       
    88          * Leaves (KErrArgument) if the provided array of items is empty.
       
    89          *
       
    90          * @since S60 3.2
       
    91          * @param aFileNames (RPointerArray*) pointer to the array of 
       
    92          *        file names (including path) of the files to copy
       
    93          */
       
    94         IMPORT_C void CopyLocalFilesToRemoteServerL(
       
    95                                 RPointerArray<TDesC16>* aFilePaths );
       
    96 
       
    97         /**
       
    98          * Moves local files to a remote media server. DLNA Any Container
       
    99          * feature will be used. Removes files from the array which are 
       
   100          * succesfully moved.
       
   101          *
       
   102          * Leaves (KErrArgument) if the provided array of files is empty.
       
   103          *
       
   104          * @since S60 3.0
       
   105          * @param aFileNames (RPointerArray*) pointer to the array of 
       
   106          *        file names (including path) of the files to move
       
   107          */
       
   108         IMPORT_C void MoveLocalFilesToRemoteServerL(
       
   109                                 RPointerArray<TDesC16>* aFilePaths );
       
   110 
       
   111         /**
       
   112          * Copies a playlist from the local handset to a remote Upnp Media
       
   113          * Server.
       
   114          *
       
   115          * Leaves (KErrArgument) if the provided playlist name is not valid
       
   116          * or the provided array of items is empty.
       
   117          *
       
   118          * @since S60 3.1
       
   119          * @param aPlaylistName (const TDesC&) the name of the playlist
       
   120          * @param aFileNames (RPointerArray&) reference to the array of 
       
   121          *        file names (including path) of the files to copy
       
   122          */
       
   123         IMPORT_C void CopyLocalPlaylistToRemoteServerL(
       
   124                                 const TDesC& aPlaylistName,
       
   125                                 RPointerArray<TDesC16>* aFilePaths );
       
   126 
       
   127     public: // Transfer content from remote UPnP Media Server to handset
       
   128 
       
   129         /**
       
   130          * Copies items from a remote Upnp Media Server to the handset to
       
   131          * the location defined in the Home Media application).
       
   132          *
       
   133          * Leaves (KErrArgument) if the provided array of items is empty.
       
   134          *
       
   135          * @since S60 3.0
       
   136          * @param aItems (RPointerArray&) reference to the array of 
       
   137          *        CUpnpItems, the items to copy
       
   138          */
       
   139         IMPORT_C void CopyRemoteItemsToHandsetL(
       
   140                                 RPointerArray<CUpnpItem>& aItems );
       
   141 
       
   142         /**
       
   143          * Copies a container from a remote Upnp Media Server to the location
       
   144          * defined in the Home Media application).
       
   145          * 
       
   146          * Leaves (KErrArgument) if the provided UpnpContainer is not valid.
       
   147          *
       
   148          * @since S60 3.0
       
   149          * @param aSourceContainer (CUpnpContainer*) pointer to the source 
       
   150          *        UpnpContainer object
       
   151          */
       
   152         IMPORT_C void CopyRemoteContainerToHandsetL(
       
   153                                 CUpnpContainer* aSourceContainer );
       
   154 
       
   155         /**
       
   156          * Copies a playlist from a remote Upnp Media Server to the location
       
   157          * defined in the Home Media application).
       
   158          *
       
   159          * Leaves (KErrArgument) if the provided UpnpContainer is not valid.
       
   160          *
       
   161          * @since S60 3.0
       
   162          * @param aSourceContainer (CUpnpContainer*) pointer to the source 
       
   163          *        UpnpContainer object
       
   164          */
       
   165         IMPORT_C void CopyRemotePlaylistToHandsetL(
       
   166                                 CUpnpContainer* aSourceContainer );
       
   167     public:
       
   168 
       
   169         /**
       
   170          * Return the number of items copied from a container
       
   171          *
       
   172          * @since S60 3.1
       
   173          * @param none
       
   174          * @return TInt number of items copied
       
   175          */
       
   176         IMPORT_C TInt ItemCopiedFromContainer();
       
   177     
       
   178     private: // Construction methods
       
   179 
       
   180         // Constructor
       
   181         CUpnpFileTransferEngine();
       
   182 
       
   183         /**
       
   184          * ConstructL.
       
   185          * @param aController (MUPnPAVBrowsingSession*) pointer to a valid
       
   186          *        UpnpAvController BrowsingsSession
       
   187          */
       
   188         void ConstructL( MUPnPAVBrowsingSession* aBrowsingSession );
       
   189 
       
   190     private: // Data members
       
   191 
       
   192         /*
       
   193          * Pointer to the file transfer handler. Owned.
       
   194          */
       
   195         CUpnpFileTransferHandler* iFileTransferHandler;
       
   196 
       
   197         /*
       
   198          * Pointer to the browsing session which the client provides. Not
       
   199          * owned.
       
   200          */
       
   201         MUPnPAVBrowsingSession* iBrowsingSession;
       
   202         CUpnpUploadHandler* iUploadHandler; //owned
       
   203     };
       
   204 
       
   205 #endif // UPNP_FILE_TRANSFER_ENGINE_H
       
   206 
       
   207 // End of file