upnpavcontroller/upnpavcontrollerclient/inc/upnpavdevicelist.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2005 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:      Implements a list of UPnP Devices
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef C_UPNPAVDEVICELIST_H
       
    24 #define C_UPNPAVDEVICELIST_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <e32base.h>
       
    28 #include <s32mem.h>
       
    29 
       
    30 // CONSTANTS
       
    31 // None
       
    32 
       
    33 // MACROS
       
    34 // None
       
    35 
       
    36 // DATA TYPES
       
    37 //None
       
    38 // FORWARD DECLARATIONS
       
    39 class CUpnpAVDevice;
       
    40 
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45  *  UPnP AV Device list class
       
    46  *
       
    47  *  @lib upnpavcontrollerclient.lib
       
    48  *  @since Series 60 3.1
       
    49  */
       
    50 class CUpnpAVDeviceList : public CBase
       
    51     {
       
    52 public:  // Constructors and destructor
       
    53     
       
    54     /**
       
    55      * Two-phased constructor.
       
    56      */
       
    57     IMPORT_C static CUpnpAVDeviceList* NewL();
       
    58 
       
    59     /**
       
    60      * Two-phased constructor.
       
    61      */
       
    62     IMPORT_C static CUpnpAVDeviceList* NewLC();
       
    63     
       
    64     /**
       
    65      * Destructor.
       
    66      */
       
    67     virtual ~CUpnpAVDeviceList();
       
    68 
       
    69 public: // New functions
       
    70     
       
    71     /**
       
    72      * Operator
       
    73      */
       
    74     IMPORT_C CUpnpAVDevice* operator[]( TInt aIndex ) const;
       
    75         
       
    76     /**
       
    77      * Serialize the whole list to a heap based descriptor.
       
    78      *
       
    79      * @return pointer to the descriptor where the list is serialized.
       
    80      */
       
    81     IMPORT_C HBufC8* ToDes8L() const;       
       
    82 
       
    83     /**
       
    84      * Appends a new device
       
    85      * 
       
    86      * @param none
       
    87      * @return TUPnPObjectType information of the type
       
    88      */
       
    89     IMPORT_C void AppendDeviceL( CUpnpAVDevice& aDevice );
       
    90     
       
    91     /**
       
    92      * Removes a device
       
    93      * 
       
    94      * @param aId id of the object to be removed and destroyed
       
    95      */
       
    96     IMPORT_C void RemoveAndDestroy( TInt aIndex );
       
    97 
       
    98     /**
       
    99      * Detaches a device
       
   100      * 
       
   101      * @param aId id of the object to be removed and destroyed
       
   102      */
       
   103     IMPORT_C void Remove( TInt aIndex );
       
   104 
       
   105     /**
       
   106      * Removes all devices
       
   107      */        
       
   108     IMPORT_C void ResetAndDestroy();
       
   109 
       
   110     /**
       
   111      * Detaches all devices
       
   112      */        
       
   113     IMPORT_C void Reset();
       
   114     
       
   115     /**
       
   116      * Returns the count of devices
       
   117      *
       
   118      * @return TInt count information
       
   119      */
       
   120     IMPORT_C TInt Count( ) const;  
       
   121 
       
   122 public:
       
   123 
       
   124     /**
       
   125      * Externalizes list
       
   126      *
       
   127      * @param reference to RWriteStream
       
   128      */
       
   129     IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
       
   130     
       
   131     /**
       
   132      * Internalizes itemlist information from stream.
       
   133      * 
       
   134      * @param reference to RReadStream
       
   135      */
       
   136     IMPORT_C void InternalizeL( RReadStream& aStream );
       
   137 
       
   138 protected:
       
   139 
       
   140     /**
       
   141      * C++ default constructor.
       
   142      */
       
   143     CUpnpAVDeviceList();
       
   144 
       
   145     /**
       
   146      * By default Symbian 2nd phase constructor is private.
       
   147      */
       
   148     void ConstructL( );
       
   149     
       
   150 private:
       
   151     
       
   152     // Device array
       
   153     RPointerArray<CUpnpAVDevice>   iDevices;
       
   154     };
       
   155 
       
   156 
       
   157 
       
   158 #endif      // C_UPNPAVDEVICELIST_H   
       
   159             
       
   160 // End of File