1 /* 2 * Copyright 2004-2012, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Mike Berg <mike@berg-net.us> 7 * Julun <host.haiku@gmx.de> 8 * Hamish Morrison <hamish@lavabit.com> 9 */ 10 #ifndef ZONE_VIEW_H 11 #define ZONE_VIEW_H 12 13 14 #include <LayoutBuilder.h> 15 #include <TimeZone.h> 16 17 18 class BButton; 19 class BMessage; 20 class BOutlineListView; 21 class BPopUpMenu; 22 class BRadioButton; 23 class BTimeZone; 24 class TimeZoneListItem; 25 class TimeZoneListView; 26 class TTZDisplay; 27 28 29 class TimeZoneView : public BGroupView { 30 public: 31 TimeZoneView(const char* name); 32 virtual ~TimeZoneView(); 33 34 virtual void AttachedToWindow(); 35 virtual void MessageReceived(BMessage* message); 36 bool CheckCanRevert(); 37 38 protected: 39 virtual void DoLayout(); 40 41 private: 42 void _UpdateDateTime(BMessage* message); 43 44 void _SetSystemTimeZone(); 45 46 void _UpdatePreview(); 47 void _UpdateCurrent(); 48 BString _FormatTime(const BTimeZone& timeZone); 49 50 void _ReadRTCSettings(); 51 void _WriteRTCSettings(); 52 void _UpdateGmtSettings(); 53 void _ShowOrHidePreview(); 54 55 void _InitView(); 56 void _BuildZoneMenu(); 57 58 void _Revert(); 59 60 TimeZoneListView* fZoneList; 61 BButton* fSetZone; 62 TTZDisplay* fCurrent; 63 TTZDisplay* fPreview; 64 BRadioButton* fLocalTime; 65 BRadioButton* fGmtTime; 66 67 int32 fLastUpdateMinute; 68 bool fUseGmtTime; 69 bool fOldUseGmtTime; 70 71 TimeZoneListItem* fCurrentZoneItem; 72 TimeZoneListItem* fOldZoneItem; 73 bool fInitialized; 74 }; 75 76 77 #endif // ZONE_VIEW_H 78