fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/inc/AknFepUserDictionaryEditDialog.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2009 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:          
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 /*
       
    28  * ============================================================================
       
    29  *  Name     : CAknFepUserDictionaryEditDialog 
       
    30  * ============================================================================
       
    31  */
       
    32 
       
    33 #ifndef AKNFEPUSERDICTIONARYEDITDIALOG_H_
       
    34 #define AKNFEPUSERDICTIONARYEDITDIALOG_H_
       
    35 
       
    36 #include <aknselectionlist.h>
       
    37 #include <aknfep.rsg>
       
    38 #include <aknsfld.h>
       
    39 #include <AknQueryDialog.h>
       
    40 #include <avkon.hrh>
       
    41 #include <AknsUtils.h>
       
    42 #include <AknsConstants.h>
       
    43 #include <aknconsts.h>
       
    44 #include <aknlists.h>
       
    45 #include <avkon.mbg>
       
    46 
       
    47 #include <StringLoader.h>
       
    48 #include <fbs.h>
       
    49 
       
    50 #include "AknFepPredOwnWordsModel.h"
       
    51 
       
    52 const TInt KMaxUDBLength = 64;
       
    53 
       
    54 class CAknFepUserDictionaryEditDialog : public CAknMarkableListDialog
       
    55 {
       
    56 
       
    57     public:
       
    58         /**
       
    59         * Function:     NewL
       
    60         *
       
    61         * Discussion:   Factory function used to create a new instance of
       
    62         *               CAknFepPredictiveSettingDialog
       
    63         *
       
    64         * Returns:      A newly created instance of CAknFepUserDictionaryEditDialog
       
    65         */
       
    66         static CAknFepUserDictionaryEditDialog* NewL(
       
    67                 TInt aOpenedItem,
       
    68                 CArrayFixFlat<TInt> *aSelectedItems,
       
    69                 MDesCArray *aArray);
       
    70 
       
    71         /**
       
    72         * Function:     NewLC
       
    73         *
       
    74         * Discussion:   Factory function used to create a new instance of
       
    75         *               CAknFepPredictiveSettingDialog and leave a pointer to it on the
       
    76         *               cleanup stack.
       
    77         *
       
    78         * Params:       aMenuResId - menu resource id.
       
    79         * Params:       aConfirmationQueryResId - Confirmation Query resource id.
       
    80         * Returns:      A newly created instance of CAknFepUserDictionaryEditDialog
       
    81         */
       
    82         static CAknFepUserDictionaryEditDialog* NewLC(
       
    83                 TInt aOpenedItem,
       
    84                 CArrayFixFlat<TInt> *aSelectedItems,
       
    85                 MDesCArray *aArray);
       
    86         
       
    87         // the static RunDlgLD launch function
       
    88         static void RunDlgLD();
       
    89         
       
    90         /**
       
    91         * Function:     ~CAknFepPredictiveSettingDialog
       
    92         *
       
    93         * Discussion:   Virtual destructor for CAknFepUserDictionaryEditDialog. Ensures that all
       
    94         *               allocated memory is returned to the heap before deletion
       
    95         *               of object.
       
    96         */
       
    97         virtual ~CAknFepUserDictionaryEditDialog();
       
    98         
       
    99     private:
       
   100         //virtual methods from CAknMarkableListDialog:
       
   101         void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane);
       
   102         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   103         TBool OkToExitL(TInt aButtonId);
       
   104         // the control initializer function
       
   105         void PreLayoutDynInitL();
       
   106                 
       
   107         void ProcessCommandL( TInt aCommandId );
       
   108         
       
   109         //Constructor
       
   110         CAknFepUserDictionaryEditDialog(
       
   111                 TInt aOpenedItem,
       
   112                 CArrayFixFlat<TInt> *aSelectedItems,
       
   113                 MDesCArray *aArray );
       
   114                 
       
   115                 
       
   116         
       
   117         //Own methods - 
       
   118         void UpdateMSKLabelL();
       
   119         
       
   120         //Query for new word from user. Also used to edit existing word
       
   121         TBool QueryWordL( const TDesC& aTitle, TDes& aNewWord );
       
   122         
       
   123         //Confirmation query for deletion
       
   124         TBool ConfirmDeleteL( const TDesC& aPrompt );
       
   125         
       
   126         //To handle different commands from the options menu or soft keys:
       
   127         void HandleEditCommandL();
       
   128         void HandleAddNewCommandL();
       
   129         void HandleDeleteCommandL();      
       
   130         
       
   131         //To get the correct index if a filtered list is being shown
       
   132         TInt CurrentItemIndex();
       
   133         const CArrayFix<TInt>* SelectedItemsL();     
       
   134         void HandleAddNewIntoFilteredListL( TInt &aOriginalItemIndex );
       
   135         
       
   136     private: //data
       
   137          
       
   138         CEikColumnListBox*  iOwnWordsListBox;
       
   139         TInt iOpenedItem;
       
   140         CArrayFixFlat<TInt>* iSelectedItems;
       
   141         CAknFepPredOwnWordsModel* iOwnWordsModel;
       
   142         TInt iMSKPosition;
       
   143                 
       
   144 };
       
   145 
       
   146 #endif /*AKNFEPUSERDICTIONARYEDITDIALOG_H_*/