cbs/cbsui/UiInc/CCbsUiLanguageSettingPage.h
branchRCL_3
changeset 20 987c9837762f
parent 0 ff3b6d0fd310
equal deleted inserted replaced
19:7d48bed6ce0c 20:987c9837762f
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     Shows which of the language setting has been selected,
       
    16 *     All, Selected or Other.
       
    17 *
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef __CBS_UI_LANGUAGE_SETTING_PAGE_H
       
    23 #define __CBS_UI_LANGUAGE_SETTING_PAGE_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include <aknradiobuttonsettingpage.h> // CAknRadioButtonSettingPage
       
    27 #include <CbsCommon.h>
       
    28 
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class MCbs;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * This settings page is popped up if a user selects a language setting 
       
    37 * from the SettingsView.
       
    38 */
       
    39 class CCbsUiLanguageSettingPage : public CAknRadioButtonSettingPage
       
    40     {            
       
    41     public: // Constructor
       
    42 
       
    43         /**
       
    44         * C++ constructor.
       
    45         *
       
    46         * @param aRerourceID Resource id.
       
    47         * @param aCurrentSelectionIndex item to be selected
       
    48         * @param aItemArray array of items
       
    49         * @param aServer to update this level selections
       
    50         */
       
    51         CCbsUiLanguageSettingPage( 
       
    52             TInt aResourceID,     
       
    53             TInt& aCurrentSelectionIndex,
       
    54             CDesCArrayFlat* aItemArray,
       
    55             MCbs& aServer );
       
    56 
       
    57 
       
    58     protected:  // From CEikDialog
       
    59 
       
    60         /**
       
    61         * Sets the selected languages into the server.
       
    62         *
       
    63         * @param aAccept selected key
       
    64         */
       
    65         TBool OkToExitL( TBool aAccept );
       
    66 
       
    67     protected: // From CCoeControl
       
    68 
       
    69         /*
       
    70         * Launches a CCbsUiLanguageDlg if EKeyOk is pressed and the focus
       
    71         * is on the selected.
       
    72         *
       
    73         * @param aKeyEvent what kind of key produced this event
       
    74         * @param aType Which kind of action produced this event
       
    75         */
       
    76         TKeyResponse OfferKeyEventL( 
       
    77             const TKeyEvent& aKeyEvent, TEventCode aType );
       
    78 
       
    79     private: // New functions
       
    80 
       
    81         /**
       
    82         * Gets languages from the server and marks selected languages to
       
    83         * aIndexArray.
       
    84         *
       
    85         * @param aIndexArray indexes of selected languages
       
    86         * @param aLanguages it will contain selected languages from the server
       
    87         */
       
    88         void GetLanguagesL( CArrayFix<TInt>& aIndexArray, TCbsDbLanguages& aLanguages );
       
    89 
       
    90         /**
       
    91         * Launches the language dialog.
       
    92         */
       
    93         void LaunchLanguageDialogL();
       
    94 
       
    95         /**
       
    96         * Sets selected languages into server according to aIndexArray.
       
    97         *
       
    98         * @param aIndexArray    contains selected languages
       
    99         * @param aLanguages     Contains information about previously selected
       
   100         *                       languages.
       
   101         */
       
   102         void SetLanguagesL( CArrayFix<TInt>& aIndexArray, TCbsDbLanguages& aLanguages );
       
   103 
       
   104     private: // Data
       
   105 
       
   106         // The server. This class doesn't own this.        
       
   107         MCbs& iServer;
       
   108 
       
   109         // Current selection index
       
   110         TInt& iSelectionIndex;
       
   111 
       
   112         // To update the selection
       
   113         CDesCArrayFlat& iArray;
       
   114 
       
   115         // it should be possible to launch language dialog only once
       
   116         TInt iCurrentLaunchingId;
       
   117 
       
   118     };
       
   119 
       
   120 #endif      // __CBS_UI_LANGUAGE_SETTING_PAGE_H
       
   121             
       
   122 // End of File