voiceui/pbkinfoviewimpl/inc/pbkinfoviewdialog.h
changeset 13 57b735022c18
parent 1 b13cd05eeb2f
equal deleted inserted replaced
1:b13cd05eeb2f 13:57b735022c18
     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:  Pbk info view dialog.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef PBKINFOVIEWDIALOG_H
       
    20 #define PBKINFOVIEWDIALOG_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <eikdialg.h>
       
    25 #include <eiklbo.h>
       
    26 #include <aknlists.h>
       
    27 #include <AknDialog.h>
       
    28 #include <aknnavi.h>
       
    29 #include <AknInfoPopupNoteController.h>
       
    30 
       
    31 #include "pbkinfoviewdialogutil.h"
       
    32 #include "pbkinfoviewreshandler.h"
       
    33 #include "pbkinfoviewsindhandler.h"
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  Pbk info view dialog.
       
    39 */
       
    40 NONSHARABLE_CLASS (CPbkInfoViewDialog) : public CAknDialog, public MEikListBoxObserver
       
    41 	{
       
    42 	enum TInfoViewDialogIconIndex
       
    43 		{
       
    44 	    EIconIndexMobile = 0,
       
    45         EIconIndexPhone,
       
    46 	    EIconIndexVideo,
       
    47 	    EIconIndexEmail,
       
    48 	    EIconIndexVoip,
       
    49 	    EIconIndexEmpty
       
    50 		};
       
    51 	
       
    52     public:// Constructors and destructor
       
    53 
       
    54         /**
       
    55         * Two-phased constructor.
       
    56         */
       
    57         static CPbkInfoViewDialog* NewL( TInt aContactId );
       
    58         
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CPbkInfoViewDialog();
       
    63         
       
    64     public:
       
    65     
       
    66         /**
       
    67         * Overrides CAknDialog::ExecuteLD. Checks whether the contact has any
       
    68         * voice tags. If not an info note is displayed. Otherwise calls
       
    69         * CAknDialog::ExecuteLD
       
    70         * @param aResourceId The resource ID of the dialog to be loaded
       
    71         * @return see CAknDialog::ExecuteLD
       
    72         */
       
    73         TInt ExecuteLD( TInt aResourceId );
       
    74         
       
    75     private:
       
    76 
       
    77         /**
       
    78         * C++ default constructor.
       
    79         */
       
    80         CPbkInfoViewDialog( TInt aContactId );
       
    81 	
       
    82         /**
       
    83         * By default Symbian OS constructor is private.
       
    84         */
       
    85         void ConstructL();
       
    86 
       
    87 	private:
       
    88 	
       
    89 	    /**
       
    90         * Called by framework before the dialog is shown.
       
    91         * @param None
       
    92 		* @return None
       
    93         */
       
    94 		void PostLayoutDynInitL();
       
    95 
       
    96         /**
       
    97         * Called by framework after the dialog is shown.
       
    98         * @param None
       
    99 		* @return None
       
   100         */
       
   101 		void PreLayoutDynInitL();
       
   102 
       
   103 		/**
       
   104 		* Handles menu events.
       
   105 		* @param  aCommandId Command id.
       
   106 		* @return None.
       
   107 		*/
       
   108 		void ProcessCommandL( TInt aCommandId );
       
   109 
       
   110         /**
       
   111         * From the base class.
       
   112 		* Called by framework for key event handling.
       
   113         * @param aKeyEvent.
       
   114 		* @param TEventCode.
       
   115 		* @return Return code.
       
   116         */
       
   117 		TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,TEventCode aType );
       
   118 
       
   119         /**
       
   120         * From the base class.
       
   121 		* Called by framework before exiting the dialog.
       
   122         * @param Button id.
       
   123 		* @return ETrue to exit\ EFalse to not to exit.
       
   124         */
       
   125 		TBool OkToExitL(TInt aButtonId);
       
   126 
       
   127 		/**
       
   128         * From the base class.
       
   129 		* Called by framework before menu is shown.
       
   130         * @param aResourceId Menu resource id.
       
   131 		* @param aMenuPane Pointer to the menu.
       
   132         * @return None.
       
   133         */
       
   134 		void DynInitMenuPaneL( TInt aResourceID,	CEikMenuPane* aMenuPane );
       
   135 
       
   136 	   /**
       
   137 		* From the base class.
       
   138         * Called when dialog is activated.
       
   139         * @return None.
       
   140         */
       
   141 		void ActivateL();
       
   142 		
       
   143 		/**
       
   144 		* Method to get context sensitive help topic.
       
   145         * @param aContext Help topic to open.
       
   146 		* @return None.
       
   147         */
       
   148 		void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   149 		
       
   150 		/**
       
   151 		* Called when display resolution changes.
       
   152         * @param aType.
       
   153 		* @return None.
       
   154         */
       
   155 		void HandleResourceChange( TInt aType );
       
   156 		
       
   157 		/**
       
   158 		* Updates dialog cba.
       
   159 		* @param aResourceId Resource id.
       
   160 		* @return None.
       
   161 		*/
       
   162 		void UpdateCbaL( TInt aResourceId );
       
   163 		
       
   164 	    /**
       
   165         * Returns TInfoViewDialogIconIndex enumeration icon index.
       
   166 		* @param aIconId enumeration TPbkIconId from PbkIconId.hrh.
       
   167         * @return Icon index.
       
   168         */
       
   169 		TInt IconIndex( TInt aIconId );
       
   170 		
       
   171 		/**
       
   172         * Creates listbox items.
       
   173         * @return None.
       
   174         */
       
   175 		void CreateListBoxItemsL();
       
   176 		
       
   177 		/**
       
   178         * Shows popup for a voice command in the list.
       
   179         * @return None.
       
   180         */
       
   181 		void ShowPopupL();
       
   182 
       
   183 		/**
       
   184 		* Gets current listbox item.
       
   185 		* @param None.
       
   186 		* @return Current listbox item index.
       
   187 		*/
       
   188 		TInt CurrentItemIndex();
       
   189 		
       
   190 		/**
       
   191 	    * Displays an information note
       
   192 	    * @param aResourceId Id for the resource text to be shown
       
   193 	    */
       
   194         void ShowInformationNoteL( TInt aResourceId );
       
   195 
       
   196 		/**
       
   197 	    * Check if call is ongoing
       
   198 	    */		
       
   199 		TBool IsCallActive();
       
   200 		
       
   201 		/**
       
   202 	    * Show "Call in progress" note
       
   203 	    */		
       
   204 		void CallInProgressNoteL();
       
   205 		
       
   206 	private: // from MEikListBoxObserver
       
   207         /**
       
   208         * From MEikListBoxObserver, called by framework.
       
   209         * @param aListBox.
       
   210         * @param aEventType.
       
   211 		* @return None
       
   212         */
       
   213 		void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
   214 		
       
   215     private:
       
   216 
       
   217 		// Id of the contact in contacts db
       
   218 		TInt iContactId;
       
   219 		
       
   220 		// Contact is on sim or mmc card and has no voice tags
       
   221 		TBool iVoiceTaglessContact;
       
   222 
       
   223 		// Id of the dialog mode
       
   224 		TInt iDialogMode;
       
   225 
       
   226 		// List of voice commands, does not take ownership
       
   227 		CAknDoubleGraphicStyleListBox* iListBox;
       
   228 		
       
   229 		// For title and icon handling
       
   230 		CStatusPaneHandler* iStatusPaneHandler;
       
   231 		
       
   232 		// For hiding tabs, does not take ownership
       
   233 		CAknNavigationControlContainer* iNaviPane;
       
   234 		
       
   235 		// Popup controller
       
   236 		CAknInfoPopupNoteController* iPopupController;
       
   237 		
       
   238 		// Resource handler
       
   239 		CPbkInfoViewResHandler* iResHandler;
       
   240 
       
   241 		// Currently selected listbox item
       
   242 		TInt iCurrentListBoxIndex;
       
   243 		
       
   244 		// SIND handler
       
   245 		CPbkInfoViewSindHandler* iSindHandler;
       
   246     };
       
   247 
       
   248 #endif    // PBKINFOVIEWDIALOG_H
       
   249             
       
   250 // End of File