upnp/upnpstack/controlpointbase/inc/upnpcpbdevicelistutils.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2007-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:  Declares utils function for devices list class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_UPNPCPBDEVICELISTUTILS_H
       
    20 #define C_UPNPCPBDEVICELISTUTILS_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CUpnpDevice;
       
    27 
       
    28 /**
       
    29  * Class with utils functions for device list
       
    30  *
       
    31  * @lib controlpointbase.lib
       
    32  * @since S60 v5.0
       
    33  */
       
    34 class UpnpCpbDeviceListUtils
       
    35     {
       
    36 public:
       
    37     /**
       
    38      * Get device from list
       
    39      *
       
    40      * @since S60 v5.0
       
    41      * @param aUuid Device uuid that should be return
       
    42      * @param aList List with devices
       
    43      * @return Pointer to the device
       
    44      */
       
    45     static CUpnpDevice* GetFromList(
       
    46         const TDesC8& aUuid, RPointerArray<CUpnpDevice>& aList);
       
    47 
       
    48     /**
       
    49      * Get root device from list
       
    50      *
       
    51      * @since S60 v5.0
       
    52      * @param aUuid Device uuid that parent root device should be return
       
    53      * @param aList List with devices
       
    54      * @return Pointer to the device or NULL if root device on specified list not found
       
    55      */
       
    56     static CUpnpDevice* GetRootFromList(
       
    57         const TDesC8& aUuid, RPointerArray<CUpnpDevice>& aList );
       
    58 
       
    59     /**
       
    60      * Check list contains the device
       
    61      *
       
    62      * @since S60 v5.0
       
    63      * @param aUuid Device uuid that should be search
       
    64      * @param aList List with devices
       
    65      * @return ETrue if array contains device, EFalse if not
       
    66      */
       
    67     static TBool ExistOnList(
       
    68         const TDesC8& aUuid, RPointerArray<CUpnpDevice>& aList );
       
    69 
       
    70     /**
       
    71      * Add device to list
       
    72      *
       
    73      * @since S60 v5.0
       
    74      * @param aDevice Device that should be added
       
    75      * @param aList List with devices
       
    76      * @return ETrue if device is added, EFalse if not
       
    77      */
       
    78     static TBool AddDeviceL(
       
    79         CUpnpDevice* aDevice, RPointerArray<CUpnpDevice>& aList );
       
    80 
       
    81     /**
       
    82      * Add device to list
       
    83      *
       
    84      * @since S60 v5.0
       
    85      * @param aDevice Device that should be added
       
    86      * @param aList List with devices
       
    87      * @param aError result of append function
       
    88      * @return ETrue if device is added, EFalse if not
       
    89      */
       
    90     static TBool UpnpCpbDeviceListUtils::AddDevice(
       
    91         CUpnpDevice* aDevice, RPointerArray<CUpnpDevice>& aList, TInt& aError);
       
    92 
       
    93     /**
       
    94      * Add devices to devices list
       
    95      *
       
    96      * @since S60 v5.0
       
    97      * @param aSource List with devices
       
    98      * @param aTarget Target list
       
    99      */
       
   100     static void AddDevicesL(
       
   101         RPointerArray<CUpnpDevice>& aSource, RPointerArray<CUpnpDevice>& aTarget );
       
   102     };
       
   103 
       
   104 #endif // C_UPNPCPBDEVICELISTUTILS_H