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 // Deprecation warning
00025 // This header file has been deprecated. Will be removed in one of the next SDK releases.
00026 
00027 //  System includes
00028 #include <coecntrl.h>
00029 #include <aknview.h>
00030 #include <aknlists.h>
00031 #include <tzlocalizationdatatypes.h>
00032 #include <ClkMdlObserver.h>
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 //              
00048 // @deprecated
00049 // class containing the information about the date time setting 
00050 class TClkDateTimeInfo
00051     {
00052     public:
00053         TTime           iTime;
00054         TDateFormat     iDateFormat;
00055         TInt            iDateSepar;
00056         TTimeFormat     iTimeFormat;
00057         TInt            iTimeSepar;
00058         TBool           iNITZ;
00059         TClockFormat    iClockFormat;
00060                 TTimeIntervalSeconds   iGMTOffset;
00061     };
00062     
00063 // @deprecated
00064 enum TClkDateTimeViewPanic
00065     {
00066     EClkDateTimeViewBadLocale,
00067     EClkDateTimeViewBadCommandId,
00068     EClkDateTimeViewBadItemIndex
00069     };
00070 
00071 #ifdef _DEBUG
00072 // FUNCTION PROTOTYPES
00073 GLREF_C void Panic(TClkDateTimeViewPanic aPanic);
00074 #endif  // _DEBUG
00075 
00076 //  FORWARD DECLARATION
00077 class CClkDateTimeViewContainer;
00078 class CClkNitzModel;
00079 class CClkIntermediateObserver;
00080 class CEnvironmentChangeNotifier;
00081 class CDRMHelper;
00082 class CClkDateTimeViewExtension;
00083 class RConeResourceLoader;
00084 class CTzId;
00085 
00086 // Class declaration
00094 class CClkDateTimeView : public CAknView,  
00095                                          public MEikListBoxObserver, 
00096                                          public MClkModelObserver
00097     {
00098     public:  // Constructors and destructor
00099 
00113         IMPORT_C static CClkDateTimeView*
00114             NewLC(TUid aViewId, TBool aClockUse = EFalse);
00115 
00120         IMPORT_C ~CClkDateTimeView();
00121 
00122     public: // Functions from base classes
00123 
00129         TUid Id() const;
00130 
00136         void HandleCommandL(TInt aCommandId);
00137 
00143         void HandleUpdateL( TInt aNotification );
00144 
00151                 void HandleForegroundEventL( TBool aForeground );
00152 
00153     public: // New functions
00154 
00159         IMPORT_C void InitCurrentItem();
00160 
00165         void HandleSettingsChangeL(const TInt aChange);
00166 
00170         void IncCurrentItem();
00171 
00175         void DecCurrentItem();
00176 
00182         TBool IsClockInUse() const;
00183 
00188         TVwsViewId PrevViewId() const;
00189 
00194         void HandleChangeCmdL(const TInt aItemId);
00195 
00202         void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
00203 
00204     protected:  // Functions from base classes
00205 
00213         void DoActivateL(const TVwsViewId& aPrevViewId,
00214             TUid aCustomMessageId, const TDesC8& aCustomMessage);
00215 
00219         void DoDeactivate();
00220 
00221 
00228         void HandleListBoxEventL(
00229             CEikListBox* aListBox, TListBoxEvent aEventType);
00230 
00231 
00232         protected:
00241         void ConstructL(TUid aViewId, TBool aClockUse);
00242 
00243     private:    // New functions
00244 
00251         TInt IndexOfCountry(TInt aGroupId, CTzLocalizedCityGroupArray* aCountryList);
00252 
00256         void GetResourcesL();
00257 
00261         void PopulateListBoxL();
00262 
00267         void UpdateListBoxL(TInt aItemId);
00268 
00272         void UpdateAllL();
00273 
00279         TInt SetDateTimeL(TTime& aTime);
00280 
00284                 void SetWorkDays();
00285         
00289         void SetDateFormat();
00290 
00294         void SetDateSeparator();
00295 
00299         void SetTimeFormat();
00300 
00304         void SetTimeSeparator();
00305 
00309         void SetClockType();
00310 
00314         void NitzL();
00315 
00319         void SetNITZL();
00320 
00324         void SettingsL();
00325 
00329         void MakeDateItemL();
00330         
00334                 void MakeZoneItemL();
00335 
00339         void MakeDateFormatItem();
00340 
00344         void MakeDateSeparItem();
00345 
00349         void MakeTimeItemL();
00350 
00354         void MakeTimeFormatItem();
00355 
00359         void MakeTimeSeparItem();
00360 
00364         void MakeNITZItem();
00365         
00369                 void MakeWorkDaysItem();
00370                 
00374         void MakeClockTypeItem();
00375 
00379         void MakeClockAlarmToneItem();
00380 
00384                 void MakeClockSnoozeTimeItemL();
00385 
00389         void DeleteResourceBuf();
00390 
00395         TInt DateFmt();
00396 
00400         void HandleBackCmdL();
00401 
00405                 void HandleWorkDaysCmdL();
00406         
00410         void HandleDateCmdL();
00411 
00415         void HandleDateFrmtCmdL();
00416 
00420         void HandleDateSeparCmdL();
00421 
00425         void HandleTimeCmdL();
00426         
00430         void HandleZoneCmdL();
00431 
00435         void HandleTimeFrmtCmdL();
00436 
00440         void HandleTimeSeparCmdL();
00441 
00447         void HandleNitzCmdL(TBool aDraw = ETrue);
00448 
00452         void HandleClockTypeCmdL();
00453 
00458                 void OpenFileListResourceLC( RConeResourceLoader& aResourceLoader );
00459         
00463         void HandleClockAlarmToneCmdL();
00464 
00468                 void HandleClockSnoozeTimeCmdL();
00469 
00477         TInt QueryPopupSettingPageL(
00478             CDesCArray& aItemArray, TInt aIndex, const TDesC& aLabel);
00479 
00485         static TInt DoNotiferCallbackL(TAny* aThis);
00486 
00490         void ShowNitzSetOffConfNoteL();
00491 
00497         static TInt TimerCallback(TAny* aThis);
00498 
00503         static void DeleteResFile(TAny* aThis);
00504 
00511                 void UnRegisterSound(const TFileName& aFile);
00512 
00513        
00518         void AppendToItem(const TDesC& aDes);
00519         
00524         void InsertToItem(const TDesC& aDes);
00525 
00526                 
00530                 void UnregisterAndReregisterL();
00531                 
00536                 void MakeGmtOffsetStringL(TInt aUtcOffset);
00537         
00542                 void SelectZoneL(TBool nitz);
00543 
00548                 void ConstructGmtStringL();
00549 
00555                 TBool IsDstOnL(TInt aTimeZoneId);
00556 
00560                 void ShowAlarmExistNote();
00561                 
00568                 void GetOffSetWithDstL( TInt32& aDstOffset, const CTzId& aTzId );
00569 
00570                 
00571         public:         
00579                 void UpdateDTViewL(TUint32 aId, const TDesC16& aNewValue);
00580                 
00585                 TBool GetAlarmFlag();
00586                 
00587     private:    // Data
00588         CClkDateTimeViewContainer*  iContainer; // Owned
00589         MDesCArray*                 iItemList;
00590         CDesCArray*                 iItemArray;
00591         TClkDateTimeInfo            iDateTimeInfo;
00592         TVwsViewId                  iPrevViewId;
00593         TUid                        iViewId;
00594         TInt                        iOffset;
00595         CDesCArrayFlat*             iDateFrmtItemLists;  // Owned
00596         CDesCArrayFlat*             iDateSeparItemLists;  // Owned
00597         CDesCArrayFlat*             iTimeSeparItemLists;  // Owned
00598         CEnvironmentChangeNotifier* iNotifier;      // Owned
00599         CClkNitzModel*              iNitzModel;     // Owned
00600         CClkIntermediateObserver*   iModelObserver; // Owned
00601         CPeriodic*                  iTimer; // Owned
00602         // used to control key event
00603         TBool                       iIsClockInUse;
00604         TInt                        iCurrentItem;
00605         TInt                        iTopItem;
00606         TInt                        iNumOfItemsInView;
00607 
00608         // used to control menu event
00609         TBool                       iMenuChange;
00610 
00611         // Used in setting list item.
00612         HBufC*                      iItem; // Owned
00613         TBuf<KMaxValueLength>       iValue;
00614 
00615         // From resource. All owned.
00616         HBufC*      iDate;
00617         HBufC*      iDateFrmt;
00618         HBufC*      iDateSepar;
00619         HBufC*      iTime;
00620         HBufC*          iZone;
00621         HBufC*      iTimeFrmt;
00622         HBufC*      iTimeSepar;
00623         HBufC*      iNITZ;
00624         HBufC*      iClockType;
00625         HBufC*      iAbbrev24H;
00626         HBufC*      iAbbrev12H;
00627         HBufC*          iLocalTime;
00628         HBufC*      iNitzOn;
00629         HBufC*      iNitzOff;
00630         HBufC*      iAnalog;
00631         HBufC*      iDigital;
00632         HBufC*      iTone;
00633         HBufC*      iTimeZone;
00634                 HBufC*          iDST;
00635         HBufC*      iDstOn;
00636         HBufC*      iDstOff;
00637         HBufC*      iGMTString;       
00638                 HBufC*          iGMTPrefixTxt;
00639                 HBufC*          iZoneString;
00640         
00641                 HBufC*          iSoundOffTxt;           // Owned
00642                 HBufC*          iDefaultToneTxt;        // Owned
00643                 HBufC*          iToneListHeader;        // Owned
00644         CClkDateTimeViewExtension*  iExtension;
00645         TInt        iResourceOffset;    // for working
00646                 TInt            iListItemCount;         // How many items in the list
00647         TFileName   iAlarmToneName;     // Tone name
00648                 TFileName       iDefaultAlarmToneName; // Default alarm tone
00649         CDRMHelper* iDRMHelper; // owned
00650         
00651                 //Not used any more but kept to preserve BC
00652         TAny*           iDummy;
00653                 
00654                 TBool           iClockAlarmFlag;
00655     };
00656 #endif      // CLKDATETIMEVIEW_H
00657 
00658 // End of File

Copyright © Nokia Corporation 2001-2007
Back to top