diff -r 5aa7c7ec6b8e -r 3487b2ea501a controlpanelplugins/langandregplugin/src/cplanguageview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelplugins/langandregplugin/src/cplanguageview.h Mon Oct 04 00:18:12 2010 +0300 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Language plugin view class + * + */ +#ifndef CPLANGUAGEVIEW_H +#define CPLANGUAGEVIEW_H + +#include +#include +#include +#include +#include "cplanguagepluginutil.h" +#include "extendedlocaleutil.h" +#include "cplanguageplugin_global.h" + +class QStringList; +class QPluginLoader; +class HbDataFormModel; +class HbDataFormModelItem; +class HbInputLanguage; +class QModelIndex; + +class CpLanguageView : public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpLanguageView(QGraphicsItem *parent = 0); + virtual ~CpLanguageView(); + +private slots: + //handle combobox index changes + void onRegionChanged(int index); + void onPrimaryInputLanguageChanged(int index); + void onSecondaryInputLanguageChanged(int index); + + //observe input language changed event + void onPrimaryInputLanguageChanged(const HbInputLanguage &inputLanguage); + void onSecondaryInputLanguageChanged(const HbInputLanguage &inputLanguage); + + //launch regional setting view + void launchRegionalSettingsView(); + + //handle data form page changed event + void onDataFormItemActivated(const QModelIndex &modelIndex); +protected: + //From CpBaseSettingView + virtual void close(); +private: + void fillDataFormComboBoxItem(HbDataFormModelItem *comboBoxItem, + const QStringList &items, int currentIndex = -1); + void updateSecondaryInputLanguageItem(); + bool promptRestart(); + int restartDevice(); + LanguageRegionMapping *languageRegionMapping(const QString &language); +private: + QList mLanguageRegionMapping; + + LanguageRegionMapping mPreviousSetting; + LanguageRegionMapping mCurrentSetting; + + HbDataFormModel *mModel; + + QList mLanguagePages; + HbDataFormModelItem *mCurrentLanguagePage; + + //Current items + HbDataFormModelItem *mCurrentRegionItem; + HbDataFormModelItem *mCurrentPrimaryInputLanguageItem; + HbDataFormModelItem *mCurrentSecondaryInputLanguageItem; + + QList mPrimaryInputLanguages; + QList mSecondaryInputLanguages; + QStringList mSupportedLanguages; + QStringList mSupportedRegions; + + QPluginLoader *mClockPluginLoader; + + bool mChineseVariant; + + LANGUAGEPLUGIN_TEST_FRIEND_CLASS(TestLanguagePlugin) +}; +#endif //CPLANGUAGEVIEW_H