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 #start_since SINCE_3_1_SDK 00081 class CClkDateTimeViewExtension; 00082 class RConeResourceLoader; 00083 #end_since SINCE_3_1_SDK 00084 // CLASS DECLARATION 00085 00093 class CClkDateTimeView : public CAknView, 00094 public MEikListBoxObserver, 00095 public MClkModelObserver 00096 { 00097 public: // Constructors and destructor 00098 00110 IMPORT_C static CClkDateTimeView* 00111 NewLC(TUid aViewId, TBool aClockUse = EFalse); 00112 00116 IMPORT_C ~CClkDateTimeView(); 00117 00118 public: // Functions from base classes 00119 00125 TUid Id() const; 00126 00132 void HandleCommandL(TInt aCommandId); 00133 00139 void HandleUpdateL(TInt aNotification); 00140 00141 public: // New functions 00142 00146 IMPORT_C void InitCurrentItem(); 00147 00152 void HandleSettingsChangeL(const TInt aChange); 00153 00157 void IncCurrentItem(); 00158 00162 void DecCurrentItem(); 00163 00169 TBool IsClockInUse() const; 00170 00175 TVwsViewId PrevViewId() const; 00176 00181 void HandleChangeCmdL(const TInt aItemId); 00182 00189 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); 00190 00191 protected: // Functions from base classes 00192 00200 void DoActivateL(const TVwsViewId& aPrevViewId, 00201 TUid aCustomMessageId, const TDesC8& aCustomMessage); 00202 00206 void DoDeactivate(); 00207 00208 00215 void HandleListBoxEventL( 00216 CEikListBox* aListBox, TListBoxEvent aEventType); 00217 00218 00219 protected: 00220 #start_since SINCE_3_1_SDK 00221 00230 void ConstructL(TUid aViewId, TBool aClockUse); 00231 #end_since SINCE_3_1_SDK 00232 00233 private: // New functions 00234 00241 TInt IndexOfCountry(TInt aGroupId, CTzLocalizedCityGroupArray* aCountryList); 00242 00246 void GetResourcesL(); 00247 00251 void PopulateListBoxL(); 00252 00257 void UpdateListBoxL(TInt aItemId); 00258 00262 void UpdateAllL(); 00263 00264 00270 TInt SetDateTimeL(TTime& aTime); 00271 00275 void SetWorkDays(); 00276 00280 void SetDateFormat(); 00281 00285 void SetDateSeparator(); 00286 00290 void SetTimeFormat(); 00291 00295 void SetTimeSeparator(); 00296 00300 void SetClockType(); 00301 00305 void NitzL(); 00306 00310 void SetNITZL(); 00311 00315 void SettingsL(); 00316 00320 void MakeDateItemL(); 00321 00325 void MakeZoneItemL(); 00326 00330 void MakeDateFormatItem(); 00331 00335 void MakeDateSeparItem(); 00336 00340 void MakeTimeItemL(); 00341 00345 void MakeTimeFormatItem(); 00346 00350 void MakeTimeSeparItem(); 00351 00355 void MakeNITZItem(); 00356 00360 void MakeWorkDaysItem(); 00361 00365 void MakeClockTypeItem(); 00366 00370 void MakeClockAlarmToneItem(); 00371 00372 00377 void MakeClockSnoozeTimeItem(); 00378 00382 void DeleteResourceBuf(); 00383 00388 TInt DateFmt(); 00389 00393 void HandleBackCmdL(); 00394 00398 void HandleWorkDaysCmdL(); 00399 00403 void HandleDateCmdL(); 00404 00408 void HandleDateFrmtCmdL(); 00409 00413 void HandleDateSeparCmdL(); 00414 00418 void HandleTimeCmdL(); 00419 00423 void HandleZoneCmdL(); 00424 00428 void HandleTimeFrmtCmdL(); 00429 00433 void HandleTimeSeparCmdL(); 00434 00440 void HandleNitzCmdL(TBool aDraw = ETrue); 00441 00445 void HandleClockTypeCmdL(); 00446 00451 void OpenFileListResourceLC( RConeResourceLoader& aResourceLoader ); 00452 00456 void HandleClockAlarmToneCmdL(); 00457 00458 00463 00473 00481 00486 00493 00499 00507 00514 00520 00526 00532 00538 00544 00551 00556 00568