commonuis/CommonDialogs/src/CAknCommonDialogsPopupList.h
changeset 0 2f259fa3e83a
child 7 08e69e956a8c
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Popup list used to display memory selection dialog
       
    15 *                and file selection dialog.
       
    16  *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CAKNCOMMONDIALOGSPOPUPLIST_H
       
    21 #define CAKNCOMMONDIALOGSPOPUPLIST_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <aknPopup.h>
       
    25 #include "CAknCommonDialogsBase.h"
       
    26 #include "MAknCommonDialogsEventObserver.h"
       
    27 #include "maknmemoryselectiondriveobserver.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CEikListBox;
       
    31 
       
    32 //  CLASS DEFINITION
       
    33 /**
       
    34  *  A class derived from CAknPopupList in order to catch events and report
       
    35  *  them to the event handler.
       
    36  *
       
    37  *  @lib CommonDialogs.lib
       
    38  *  @since 1.2
       
    39  */
       
    40 NONSHARABLE_CLASS(CAknCommonDialogsPopupList) : public CAknPopupList,
       
    41 public MAknMemorySelectionDriveObserver
       
    42     {
       
    43 public: // Constructors and destructor
       
    44 
       
    45     /**
       
    46      * Static constructor.
       
    47      * @param aObserver An observer to which events are reported.
       
    48      * @param aListBox A parameter for CAknPopupList.
       
    49      * @param aType A parameter for CAknPopupList.
       
    50      * @param aIsEndKeyPress Get call termination key event.
       
    51      * @return Returns a pointer to an instance of itself.
       
    52      */
       
    53     static CAknCommonDialogsPopupList* NewL(
       
    54             MAknCommonDialogsEventObserver& aObserver,
       
    55             CEikListBox* aListBox,
       
    56             AknPopupLayouts::TAknPopupLayouts aType,
       
    57             TBool& aIsEndKeyPress );
       
    58 
       
    59     ~CAknCommonDialogsPopupList();
       
    60 
       
    61     /**
       
    62      * From MAknMemoryCardInsertObserver
       
    63      * Update popuplist with new memory names
       
    64      * @param aItemArray Memory names from memory selection model
       
    65      */
       
    66     virtual void NotifyDrivesChangedL(const MDesCArray* aItemArray);
       
    67 
       
    68     /**
       
    69      * From CCoeControl. To handle the Pointer events.
       
    70      * @param aPointerEvent The Pointer event details.
       
    71      */
       
    72     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
    73 
       
    74 private: // Constructors
       
    75 
       
    76     /**
       
    77      * Second phase construction.
       
    78      * @param aListBox A parameter for CAknPopupList.
       
    79      * @param aType A parameter for CAknPopupList.
       
    80      */
       
    81     void ConstructL(
       
    82             CEikListBox* aListBox,
       
    83             AknPopupLayouts::TAknPopupLayouts aType );
       
    84 
       
    85     /**
       
    86      * Constructor.
       
    87      * @param aObserver An observer to which events are reported.
       
    88      * @param aIsEndKeyPress Get call termination key event
       
    89      */
       
    90     CAknCommonDialogsPopupList( MAknCommonDialogsEventObserver& aObserver,
       
    91             TBool& aIsEndKeyPress );
       
    92 
       
    93 private: // Functions from base classes 
       
    94 
       
    95     /**
       
    96      * From CAknPopupList
       
    97      */
       
    98     void ProcessCommandL( TInt aCommandId );
       
    99 
       
   100     /**
       
   101      * From CAknPopupList
       
   102      */
       
   103     TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   104 
       
   105     /**
       
   106      * From CAknPopupList
       
   107      */
       
   108     void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   109 
       
   110 private: // New functions
       
   111 
       
   112     /**
       
   113      * Implements reporting events to event handler.
       
   114      * @param aEvent The event to report.
       
   115      * @return Returns ETrue if it is allowed to exit popup.
       
   116      */
       
   117     TBool ReportPopupEventL( MAknCommonDialogsEventObserver::TEvent aEvent );
       
   118 
       
   119     /**
       
   120      * Updates the listbox and the pop-up list after listbox items have changed.
       
   121      * @param aFocus Focus of the current item.
       
   122      * @param aTopIndex Index of the topmost item.
       
   123      */
       
   124     void UpdateItemsAndRedrawPopupL( TInt aFocus, TInt aTopIndex );
       
   125 
       
   126     /**
       
   127      * Processes the highlight change event of listbox
       
   128      * @param aListBox Listbox being observed.
       
   129      */
       
   130     void HandleListBoxHighlightChangedL( CEikListBox* aListBox );
       
   131 
       
   132 private: // Data
       
   133 
       
   134     // Ref: Observer to report events
       
   135     MAknCommonDialogsEventObserver& iObserver;
       
   136     
       
   137     // Ref: Get EndCall key event
       
   138     TBool& iEndKey;
       
   139 
       
   140     };
       
   141 
       
   142 #endif // CAKNCOMMONDIALOGSPOPUPLIST_H
       
   143 // End of File