upnpavcontroller/upnpavcontrollerclient/inc/upnpavrequest.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2006 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:      a data class for client-server comm.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef C_CUPNPAVREQUEST_H
       
    24 #define C_CUPNPAVREQUEST_H
       
    25 
       
    26 
       
    27 #include <e32base.h>
       
    28 //#include <s32strm.h>
       
    29 #include <s32mem.h>
       
    30 #include "upnpavbrowsingsession.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class CUpnpItem;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  UPnP AV Controller Client/Server communication helper class
       
    39 *  
       
    40 *
       
    41 *  @lib -
       
    42 *  @since Series 60 3.1
       
    43 */
       
    44 
       
    45 class CUpnpAVRequest : public CBase
       
    46     { 
       
    47     
       
    48 public:  // Constructors and destructor
       
    49         
       
    50     /**
       
    51      * Two-phased constructor.
       
    52      */
       
    53     static inline CUpnpAVRequest* NewLC();
       
    54     
       
    55     /**
       
    56      * Two-phased constructor.
       
    57      */
       
    58     static inline CUpnpAVRequest* NewL();
       
    59     
       
    60     /**
       
    61      * Destructor.
       
    62      */
       
    63     inline virtual ~CUpnpAVRequest();
       
    64     
       
    65 public:
       
    66 
       
    67     /**
       
    68      * Externalizes information to stream.
       
    69      * Leaves in case of errors.
       
    70      * @since Series 60 3.1
       
    71      * @param reference to RWriteStream
       
    72      * @return none
       
    73      */
       
    74     inline void ExternalizeL( RWriteStream& aStream ) const;
       
    75     
       
    76     /**
       
    77      * Internalizes information from stream.
       
    78      * Leaves in case of errors.
       
    79      * @since Series 60 3.1
       
    80      * @param reference to RReadStream
       
    81      * @return none
       
    82      */
       
    83     inline void InternalizeL( RReadStream& aStream );
       
    84 
       
    85     /**
       
    86      * Externalizes information to stream and returns the object as a heap
       
    87      * desctiptor.
       
    88      */    
       
    89     inline HBufC8* ToDes8L() const;
       
    90 
       
    91 private:
       
    92 
       
    93     /**
       
    94     * Constructor
       
    95     */
       
    96     inline CUpnpAVRequest();
       
    97 
       
    98     /**
       
    99      * Perform the second phase construction
       
   100      */
       
   101     inline void ConstructL();
       
   102 
       
   103 public: // New methods
       
   104 
       
   105     /**
       
   106      * Sets Id
       
   107      * @param aId Id
       
   108      */
       
   109     inline void SetIdL( const TDesC8& aId );
       
   110 
       
   111     /**
       
   112      * Retuns Id
       
   113      * @return Id
       
   114      */    
       
   115     inline const TDesC8& Id();
       
   116 
       
   117     /**
       
   118      * Sets Uuid
       
   119      * @param aUuid Uuid
       
   120      */    
       
   121     inline void SetUuidL( const TDesC8& aUuid );
       
   122 
       
   123     /**
       
   124      * Retuns Uuid
       
   125      * @return Uuid
       
   126      */        
       
   127     inline const TDesC8& Uuid();
       
   128     
       
   129     /**
       
   130      * Sets filepath
       
   131      * @param aFilePath filepath
       
   132      */    
       
   133     inline void SetFilePathL( const TDesC& aFilePath );
       
   134     
       
   135     /**
       
   136      * Retuns filepath
       
   137      * @return filepath
       
   138      */        
       
   139     inline const TDesC& FilePath();
       
   140 
       
   141     /**
       
   142      * Sets URI
       
   143      * @param aURI URI
       
   144      */    
       
   145     inline void SetURIL( const TDesC8& aURI );
       
   146     
       
   147     /**
       
   148      * Retuns URI
       
   149      * @return URI
       
   150      */        
       
   151     inline const TDesC8& URI();
       
   152     
       
   153     /**
       
   154      * Sets if a browse action is required
       
   155      * @param aBrowse ETrue is a browse action is required
       
   156      */    
       
   157     inline void SetRequiresBrowse( TBool aBrowse );
       
   158     
       
   159     /**
       
   160      * Retuns ETrue if a browse action is required
       
   161      * @return ETrue/EFalse
       
   162      */        
       
   163     inline TBool RequiresBrowse();
       
   164 
       
   165     /**
       
   166      * Sets used memory type
       
   167      * @param aMemoryType memory type
       
   168      */
       
   169     inline void SetMemoryType( MUPnPAVBrowsingSession::TMemoryType
       
   170         aMemoryType );
       
   171 
       
   172     /**
       
   173      * Retuns used memory type
       
   174      * @return memory type
       
   175      */        
       
   176     inline MUPnPAVBrowsingSession::TMemoryType MemoryType();
       
   177 
       
   178     /**
       
   179      * Sets the state of filesharing after operation
       
   180      * @param aFileSharing state of filesharing
       
   181      */
       
   182     inline void SetFileSharing( MUPnPAVBrowsingSession::TFileSharing
       
   183         aFileSharing );
       
   184 
       
   185     /**
       
   186      * Retuns state of filesharing
       
   187      * @return filesharing
       
   188      */        
       
   189     inline MUPnPAVBrowsingSession::TFileSharing FileSharing();
       
   190 
       
   191 private:
       
   192     
       
   193     HBufC8*                                 iId; // Owned
       
   194     HBufC8*                                 iUuid; // Owned
       
   195     HBufC*                                  iFilePath; // Owned
       
   196     HBufC8*                                 iURI; // Owned
       
   197     TBool                                   iRequiresBrowse; // Owned
       
   198     MUPnPAVBrowsingSession::TMemoryType     iMemoryType; // Owned
       
   199     MUPnPAVBrowsingSession::TFileSharing    iFileSharing; // Owned
       
   200     };
       
   201 
       
   202 #include "upnpavrequest.inl"
       
   203 
       
   204 #endif // C_CUPNPAVREQUEST_H