upnpframework/upnpcommonui/inc/upnpexternaldevicedialog.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     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:  Header file for the UPnPSelectionDialog class implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __UPNP_EXTERNAL_DEVICE_DIALOG_H__
       
    20 #define __UPNP_EXTERNAL_DEVICE_DIALOG_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <aknselectionlist.h>
       
    24 #include <aknnavide.h> // CAknNavigationDecorator
       
    25 #include "upnpavdeviceobserver.h"
       
    26 #include "upnpnavipanecontainer.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CAknIconArray;
       
    30 class MAknsSkinInstance;
       
    31 class CAknTitlePane;
       
    32 class CUPnPCommonUI;
       
    33 class CAknNavigationDecorator;    
       
    34 class MUPnPAVController;
       
    35 
       
    36 class CUpnpItem;
       
    37 class CUpnpAVDeviceList;
       
    38 /**
       
    39 * External device dialog class of Common UI library
       
    40 */
       
    41 NONSHARABLE_CLASS( CUPnPExternalDeviceDialog ) : public CAknDialog,
       
    42                                                  public MUPnPAVDeviceObserver
       
    43     {
       
    44     private:
       
    45         /**
       
    46         * C++ default constructor
       
    47         */
       
    48         CUPnPExternalDeviceDialog( MUPnPAVController& aAVControl,
       
    49                                    CUPnPCommonUI& aCommonUI );
       
    50 
       
    51         /**
       
    52         * EPOC default constructor.
       
    53         */
       
    54         void ConstructL(TInt aMenuResource );
       
    55 
       
    56 
       
    57     public: // Methods from MUPnPAVDeviceObserver
       
    58         /**
       
    59          * Notifies that a new UPnP device was discovered.
       
    60          *
       
    61          * @since Series 60 3.1
       
    62          * @param CUpnpDevice
       
    63          * @return None
       
    64          */
       
    65         void UPnPDeviceDiscovered( const CUpnpAVDevice& aDevice );
       
    66 
       
    67         /**
       
    68          * Notifies that a UPnP device was dissapeared.
       
    69          *
       
    70          * @since Series 60 3.1
       
    71          * @param CUpnpDevice
       
    72          * @return None
       
    73          */
       
    74         void UPnPDeviceDisappeared (const CUpnpAVDevice& aDevice );
       
    75         
       
    76         /**
       
    77          * Notifies that the WLAN connection has been lost. All sessions
       
    78          * are now usable and must be closed.
       
    79          *
       
    80          * @since Series 60 3.1
       
    81          * @return None
       
    82          */ 
       
    83         void WLANConnectionLost();
       
    84         
       
    85     protected:  // Functions from base classes
       
    86 
       
    87         /**
       
    88         * From CAknDialog, handles layout initialization
       
    89         * @since Series 60 3.1
       
    90         * @return none
       
    91         */
       
    92         void PreLayoutDynInitL();
       
    93         
       
    94         /**
       
    95         * From CEikdialog This function is called by the EIKON dialog 
       
    96         * framework just before the dialog is activated, after it 
       
    97         *has called PreLayoutDynInitL() and the dialog has been sized. 
       
    98         * 
       
    99         * @param none
       
   100         * @since Series 60 3.1
       
   101         * @return none
       
   102         */
       
   103         void PostLayoutDynInitL();
       
   104 
       
   105         /**
       
   106         * From CAknDialog, handles focus changes of the dialog
       
   107         * @since Series 60 3.1
       
   108         * @param TInt, pressed button id
       
   109         * @return True if ready to close dialog, False otherwise
       
   110         */
       
   111         TBool OkToExitL( TInt aButtonId );
       
   112 
       
   113         /**
       
   114         * From CAknDialog, dynamically modifies menu
       
   115         * @since Series 60 3.1
       
   116         * @param TInt, menu resource
       
   117         * @param CEikMenuPane, menu pane resource
       
   118         */
       
   119         void DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane);
       
   120 
       
   121         /**
       
   122         * From CAknDialog, handles menu commands
       
   123         * @since Series 60 3.1
       
   124         * @param TInt, command to be handled
       
   125         */
       
   126         void ProcessCommandL (TInt aCommand);
       
   127 
       
   128         /**
       
   129         * From CoeControl
       
   130         */
       
   131         void HandleResourceChange(TInt aType);
       
   132 
       
   133 
       
   134     public:
       
   135 
       
   136         /**
       
   137         * Two-phased constructor.
       
   138         * @param TInt, menu resource used with the dialog
       
   139         * @param CUPnPAVControl&, AV controller
       
   140         * @param CUPnPCommonUI&, pointer to common ui
       
   141         */
       
   142         static CUPnPExternalDeviceDialog* NewL(
       
   143             TInt aMenuResource,
       
   144             MUPnPAVController& aAVControl,
       
   145             CUPnPCommonUI& aCommonUI);
       
   146 
       
   147         // Destructor
       
   148         virtual ~CUPnPExternalDeviceDialog(); // destruct and give statistics
       
   149 
       
   150 
       
   151     private:    // New Functions
       
   152 
       
   153         /**
       
   154         * Loads a possibly skinned icon and adds it to icon array
       
   155         * @since Series 60 3.1
       
   156         * @param CAknIconArray, array of icons
       
   157         * @param MAknsSkinInstance, skin instance
       
   158         * @param TDesC, reference to icon file
       
   159         * @param TAknsItemID, skinned icon id
       
   160         * @param TInt, bitmap id
       
   161         * @param TInt, bitmap mask id
       
   162         */
       
   163         void AppendIconToArrayL(CAknIconArray* aArray,
       
   164                                 MAknsSkinInstance* aSkin,
       
   165                                 const TDesC& aMbmFile,
       
   166                                 const TAknsItemID& aID,
       
   167                                 TInt aBitmapId,
       
   168                                 TInt aMaskId);
       
   169 
       
   170 
       
   171         /**
       
   172         * Display Media Server Names.
       
   173         * @since Series 60 3.1
       
   174         */
       
   175         void DisplayMediaServersL();
       
   176 
       
   177         /**
       
   178         * Execute Browse dialog
       
   179         * @since Series 60 3.1
       
   180         * @return dialog return code
       
   181         */
       
   182         TInt ExecuteBrowseL();
       
   183         
       
   184         /**
       
   185         * Execute AdvFind dialog
       
   186         * @since Series 60 3.1
       
   187         * @return dialog return code
       
   188         */
       
   189         TInt ExecuteFindL();
       
   190         /**
       
   191          * Notifies that a new UPnP device was discovered.
       
   192          *
       
   193          * @since Series 60 3.1
       
   194          * @param CUpnpDevice, new device
       
   195          * @return None
       
   196          */
       
   197         void UPnPDeviceDiscoveredL(const CUpnpAVDevice& aDevice);
       
   198 
       
   199         /**
       
   200          * Notifies that a UPnP device was dissapeared.
       
   201          *
       
   202          * @since Series 60 3.1
       
   203          * @param CUpnpDevice, disappeared device
       
   204          * @return None
       
   205          */
       
   206         void UPnPDeviceDisappearedL(const CUpnpAVDevice& aDevice);
       
   207 
       
   208         /**
       
   209         * From CoeControl
       
   210         * @param TCoeHelpContext, context of desired help
       
   211         */
       
   212         void GetHelpContext(TCoeHelpContext& aContext) const;        
       
   213         
       
   214         /**
       
   215          * Updates navi pane animation
       
   216          *
       
   217          * @since Series 60 3.1
       
   218          * @param TBool, animation on/off         
       
   219          */
       
   220         void UpDateAnimationWindowL(TBool aAnimationState);
       
   221         
       
   222     
       
   223 
       
   224     private:
       
   225         CEikColumnListBox*                          iListBox; //not owned
       
   226         MUPnPAVController&                          iAVControl;
       
   227         
       
   228         CUpnpAVDeviceList*                          iDeviceArray; //owned
       
   229         CUPnPCommonUI&                              iCommonUI; //not owned
       
   230         // title pane
       
   231         CAknTitlePane*                              iTitlePane; //not owned
       
   232         CAknNavigationDecorator*                    iNaviDecorator; //owned
       
   233         // animation timer
       
   234         //not owned
       
   235         CUPnPNaviPaneContainer*                     iNaviContainer;
       
   236         CEikStatusPane*                             iStatusPane; //not owned
       
   237         //not owned
       
   238         CAknNavigationControlContainer*             iNaviPaneContainer;
       
   239         
       
   240         MUPnPAVDeviceObserver*                      iPreDeviceObserver;
       
   241         TBool                                       iNaviPaneActive;
       
   242     };
       
   243 
       
   244 #endif // __UPNP_EXTERNAL_DEVICE_DIALOG_H__