upnpframework/upnpcommonui/inc/upnpselectiondialog.h
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Header file for the UPnPSelectionDialog class implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __UPNP_SELECTION_DIALOG_H__
       
    20 #define __UPNP_SELECTION_DIALOG_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include "upnpavdeviceobserver.h"
       
    24 #include "upnpcommonui.h"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MUPnPAVController;
       
    28 class CUpnpAVDeviceList;
       
    29 /**
       
    30 * Device selection dialog class of Common UI library
       
    31 */
       
    32 NONSHARABLE_CLASS( CUPnPSelectionDialog ): public CBase, 
       
    33                                            public MUPnPAVDeviceObserver
       
    34     {
       
    35 
       
    36     public:  // Constructors and destructor
       
    37 
       
    38         /**
       
    39         * Two-phased constructor.
       
    40         */
       
    41         static CUPnPSelectionDialog* NewL(MUPnPAVController& aAVControl);
       
    42         /**
       
    43         * Destructor.
       
    44         */
       
    45         virtual ~CUPnPSelectionDialog();
       
    46 
       
    47     public: // Methods from MUPnPAVDeviceObserver
       
    48         /**
       
    49          * Notifies that a new UPnP device was discovered.
       
    50          *
       
    51          * @since Series 60 3.1
       
    52          * @param CUpnpAVDevice
       
    53          * @return None
       
    54          */
       
    55         void UPnPDeviceDiscovered(const CUpnpAVDevice& aDevice);
       
    56 
       
    57         /**
       
    58          * Notifies that a UPnP device was dissapeared.
       
    59          *
       
    60          * @since Series 60 3.1
       
    61          * @param CUpnpAVDevice
       
    62          * @return None
       
    63          */
       
    64         void UPnPDeviceDisappeared(const CUpnpAVDevice& aDevice);
       
    65 
       
    66         /**
       
    67          * Notifies that the WLAN connection has been lost. All sessions
       
    68          * are now usable and must be closed.
       
    69          *
       
    70          * @since Series 60 3.1
       
    71          * @return None
       
    72          */ 
       
    73         void WLANConnectionLost();
       
    74         
       
    75     public:
       
    76 
       
    77         /**
       
    78          * Starts selection popup
       
    79          *
       
    80          * @since Series 60 3.1
       
    81          * @param CUpnpAVDevice, selected device
       
    82          */
       
    83         TInt StartPopupL(CUpnpAVDevice& aDevice);
       
    84 
       
    85         /**
       
    86          * Creates a selection popup.
       
    87          *
       
    88          * @since Series 60 3.1
       
    89          * @param const TDesC&, popup title
       
    90          * @param aDeviceType TUPnPDeviceTypesToSearch type of devices to
       
    91          *        search
       
    92          * @return None
       
    93          */
       
    94         void CreatePopupL( const TDesC& aTitle,
       
    95                            TUPnPDeviceTypesToSearch aDeviceType );
       
    96         
       
    97         /**
       
    98          * Destroy the selection dialog rather than pressing "Cancel" button
       
    99          *
       
   100          * @since Series 60 3.1
       
   101          * @param TInt exiting error 
       
   102          * @return None
       
   103          */
       
   104         void DismissItself( TInt aError );
       
   105         
       
   106     private:
       
   107 
       
   108         /**
       
   109         * C++ default constructor.
       
   110         */
       
   111         CUPnPSelectionDialog(MUPnPAVController& aAVControl);
       
   112 
       
   113         /**
       
   114         * By default Symbian 2nd phase constructor is private.
       
   115         */
       
   116         void ConstructL();
       
   117 
       
   118 
       
   119     private:    // New Functions
       
   120 
       
   121         /**
       
   122         * Loads a possibly skinned icon and adds it to icon array
       
   123         * @since Series 60 3.1
       
   124         * @param CAknIconArray, array of icons
       
   125         * @param MAknsSkinInstance, skin instance
       
   126         * @param TDesC, reference to icon file
       
   127         * @param TAknsItemID, skinned icon id
       
   128         * @param TInt, bitmap id
       
   129         * @param TInt, bitmap mask id
       
   130         */
       
   131         void AppendIconToArrayL(CAknIconArray* aArray,
       
   132                                 MAknsSkinInstance* aSkin,
       
   133                                 const TDesC& aMbmFile,
       
   134                                 const TAknsItemID& aID,
       
   135                                 TInt aBitmapId,
       
   136                                 TInt aMaskId);
       
   137 
       
   138         /**
       
   139         * Loads listbox items
       
   140         * @since Series 60 3.1
       
   141         */
       
   142         void LoadListItemsL(void);
       
   143 
       
   144         /**
       
   145         * From CAknDialog, handles layout initialization
       
   146         * @param const TDesC&, dialog title
       
   147         */
       
   148         void PreLayoutDynInitL(const TDesC& aTitle);
       
   149 
       
   150         /**
       
   151          * Notifies that a new UPnP device was discovered.
       
   152          *
       
   153          * @since Series 60 3.1
       
   154          * @param CUpnpAVDevice, new device
       
   155          * @return None
       
   156          */
       
   157         void UPnPDeviceDiscoveredL(const CUpnpAVDevice& aDevice);
       
   158 
       
   159         /**
       
   160          * Notifies that a UPnP device was dissapeared.
       
   161          *
       
   162          * @since Series 60 3.1
       
   163          * @param CUpnpAVDevice, disappeared device
       
   164          * @return None
       
   165          */
       
   166         void UPnPDeviceDisappearedL(const CUpnpAVDevice& aDevice);
       
   167 
       
   168         /**
       
   169          * Checks if a given device matches with the search criteria.
       
   170          *
       
   171          * @since Series 60 3.1
       
   172          * @param aDevice (CUpnpAVDevice*) the device
       
   173          * @return TBool
       
   174          */
       
   175         TBool MatchWithSearchCriteria( CUpnpAVDevice *aDevice );
       
   176         
       
   177         /**
       
   178          * Updates command set of the dialog by the search type of the devices.
       
   179          * 
       
   180          * @since Series S60 5.1
       
   181          * @param none
       
   182          * @return none
       
   183          */
       
   184         void UpdateCommandSetL();
       
   185 
       
   186     private:
       
   187 
       
   188         CAknPopupList*                              iPopup; //not owned
       
   189         CAknSingleGraphicPopupMenuStyleListBox*     iListBox; //owned
       
   190         CUpnpAVDeviceList*                          iDeviceArray; //owned
       
   191         
       
   192 
       
   193         MUPnPAVController&                          iAVControl;
       
   194         TUPnPDeviceTypesToSearch                    iTypeOfDevicesToSearch;
       
   195         //observer for device appearance
       
   196         MUPnPAVDeviceObserver*                      iDeviceObserver;
       
   197         
       
   198         TInt                                         iExitReason;
       
   199     };
       
   200 
       
   201 #endif // __UPNP_SELECTION_DIALOG_H__
       
   202 
       
   203 // End of file