clkdatetimeview.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : ClkDateTimeView.h
00004 *  Part of     : ClkDateTimeView / ClkDateTimeView.dll
00005 *  Interface   : 
00006 *  Description : Declaration of "Date & Time" settings view class.
00007 *  Version     : 
00008 *
00009 *  Copyright © 2002 Nokia Corporation.
00010 *  This material, including documentation and any related 
00011 *  computer programs, is protected by copyright controlled by 
00012 *  Nokia Corporation. All rights are reserved. Copying, 
00013 *  including reproducing, storing, adapting or translating, any 
00014 *  or all of this material requires the prior written consent of 
00015 *  Nokia Corporation. This material also contains confidential 
00016 *  information which may not be disclosed to others without the 
00017 *  prior written consent of Nokia Corporation.
00018 * ==============================================================================
00019 */
00020 
00021 #ifndef CLKDATETIMEVIEW_H
00022 #define CLKDATETIMEVIEW_H
00023 
00024 //  INCLUDES
00025 #include <coecntrl.h>
00026 #include <aknview.h>
00027 #include <aknlists.h>
00028 #include <tzlocalizationdatatypes.h>
00029 
00030 #include <ClkMdlObserver.h>
00031 
00032 
00033 
00034 // CONSTANTS
00035 const TInt KMaxItemLength=128;
00036 const TInt KMaxValueLength=64;
00037 const TUid KMainViewId = {1};
00038 const TUid KClkDateTimeViewId = {10};
00039 const TInt KNotiferPriority = CActive::EPriorityIdle;
00040 
00041 //Complete path for resource file 
00042 _LIT(KRESOURCE, "Z:\\Resource\\Apps\\clockapp.rsc");
00043 //Complete path of sound file used for alarm
00044 _LIT(KHardCodedAlarmTone, "z:\\Resource\\Sounds\\Simple\\clock.rng");
00045 
00046 // DATA TYPES
00047 //class containing the information about the date time setting 
00048 class TClkDateTimeInfo
00049     {
00050     public:
00051         TTime           iTime;
00052         TDateFormat     iDateFormat;
00053         TInt            iDateSepar;
00054         TTimeFormat     iTimeFormat;
00055         TInt            iTimeSepar;
00056         TBool           iNITZ;
00057         TClockFormat    iClockFormat;
00058                 TTimeIntervalSeconds   iGMTOffset;
00059     };
00060 
00061 enum TClkDateTimeViewPanic
00062     {
00063     EClkDateTimeViewBadLocale,
00064     EClkDateTimeViewBadCommandId,
00065     EClkDateTimeViewBadItemIndex
00066     };
00067 
00068 #ifdef _DEBUG
00069 // FUNCTION PROTOTYPES
00070 GLREF_C void Panic(TClkDateTimeViewPanic aPanic);
00071 // _DEBUG
00072 #endif
00073 
00074 //  FORWARD DECLARATION
00075 class CClkDateTimeViewContainer;
00076 class CClkNitzModel;
00077 class CClkIntermediateObserver;
00078 class CEnvironmentChangeNotifier;
00079 class CDRMHelper;
00080 class CClkDateTimeViewExtension;
00081 class RConeResourceLoader;
00082 // CLASS DECLARATION
00083 
00091 class CClkDateTimeView : public CAknView,  
00092                                          public MEikListBoxObserver, 
00093                                          public MClkModelObserver
00094     {
00095     public:  // Constructors and destructor
00096 
00108         IMPORT_C static CClkDateTimeView*
00109             NewLC(TUid aViewId, TBool aClockUse = EFalse);
00110 
00114         IMPORT_C ~CClkDateTimeView();
00115 
00116     public: // Functions from base classes
00117 
00123         TUid Id() const;
00124 
00130         void HandleCommandL(TInt aCommandId);
00131 
00137         void HandleUpdateL(TInt aNotification);
00138 
00139     public: // New functions
00140 
00144         IMPORT_C void InitCurrentItem();
00145 
00150         void HandleSettingsChangeL(const TInt aChange);
00151 
00155         void IncCurrentItem();
00156 
00160         void DecCurrentItem();
00161 
00167         TBool IsClockInUse() const;
00168 
00173         TVwsViewId PrevViewId() const;
00174 
00179         void HandleChangeCmdL(const TInt aItemId);
00180 
00187         void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
00188 
00189     protected:  // Functions from base classes
00190 
00198         void DoActivateL(const TVwsViewId& aPrevViewId,
00199             TUid aCustomMessageId, const TDesC8& aCustomMessage);
00200 
00204         void DoDeactivate();
00205 
00206 
00213         void HandleListBoxEventL(
00214             CEikListBox* aListBox, TListBoxEvent aEventType);
00215 
00216 
00217         protected:
00226         void ConstructL(TUid aViewId, TBool aClockUse);
00227 
00228     private:    // New functions
00229 
00236         TInt IndexOfCountry(TInt aGroupId, CTzLocalizedCityGroupArray* aCountryList);
00237 
00241         void GetResourcesL();
00242 
00246         void PopulateListBoxL();
00247 
00252         void UpdateListBoxL(TInt aItemId);
00253 
00257         void UpdateAllL();
00258 
00259 
00265         TInt SetDateTimeL(TTime& aTime);
00266 
00270                 void SetWorkDays();
00271         
00275         void SetDateFormat();
00276 
00280         void SetDateSeparator();
00281 
00285         void SetTimeFormat();
00286 
00290         void SetTimeSeparator();
00291 
00295         void SetClockType();
00296 
00300         void NitzL();
00301 
00305         void SetNITZL();
00306 
00310         void SettingsL();
00311 
00315         void MakeDateItemL();
00316         
00320                 void MakeZoneItemL();
00321 
00325         void MakeDateFormatItem();
00326 
00330         void MakeDateSeparItem();
00331 
00335         void MakeTimeItemL();
00336 
00340         void MakeTimeFormatItem();
00341 
00345         void MakeTimeSeparItem();
00346 
00350         void MakeNITZItem();
00351         
00355                 void MakeWorkDaysItem();
00356                 
00360         void MakeClockTypeItem();
00361 
00365         void MakeClockAlarmToneItem();
00366 
00367 
00372                 void MakeClockSnoozeTimeItemL();
00373 
00377         void DeleteResourceBuf();
00378 
00383         TInt DateFmt();
00384 
00388         void HandleBackCmdL();
00389 
00393                 void HandleWorkDaysCmdL();
00394         
00398         void HandleDateCmdL();
00399 
00403         void HandleDateFrmtCmdL();
00404 
00408         void HandleDateSeparCmdL();
00409 
00413         void HandleTimeCmdL();
00414         
00418         void HandleZoneCmdL();
00419 
00423         void HandleTimeFrmtCmdL();
00424 
00428         void HandleTimeSeparCmdL();
00429 
00435         void HandleNitzCmdL(TBool aDraw = ETrue);
00436 
00440         void HandleClockTypeCmdL();
00441 
00446                 void OpenFileListResourceLC( RConeResourceLoader& aResourceLoader );
00447         
00451         void HandleClockAlarmToneCmdL();
00452 
00453 
00458 
00468 
00476 
00481 
00488 
00494 
00502 
00509 
00515 
00521 
00527 
00533 
00539 
00546 
00551 
00561 

Copyright © Nokia Corporation 2001-2008
Back to top