1 /* 2 * Copyright 2004-2010, 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 */ 9 #ifndef ZONE_VIEW_H 10 #define ZONE_VIEW_H 11 12 13 #include <TimeZone.h> 14 #include <View.h> 15 16 17 class BMessage; 18 class BPopUpMenu; 19 class BOutlineListView; 20 class BButton; 21 class TTZDisplay; 22 class TimeZoneListItem; 23 24 25 class TimeZoneView : public BView { 26 public: 27 TimeZoneView(BRect frame); 28 virtual ~TimeZoneView(); 29 30 virtual void AttachedToWindow(); 31 virtual void MessageReceived(BMessage* message); 32 bool CheckCanRevert(); 33 34 private: 35 void _UpdateDateTime(BMessage* message); 36 37 void _SetSystemTimeZone(); 38 39 void _UpdatePreview(); 40 void _UpdateCurrent(); 41 BString _FormatTime(TimeZoneListItem* zoneItem); 42 43 void _InitView(); 44 void _BuildRegionMenu(); 45 46 void _Revert(); 47 48 private: 49 BOutlineListView* fZoneList; 50 BButton* fSetZone; 51 TTZDisplay* fCurrent; 52 TTZDisplay* fPreview; 53 54 int32 fLastUpdateMinute; 55 56 TimeZoneListItem* fCurrentZoneItem; 57 TimeZoneListItem* fOldZoneItem; 58 bool fInitialized; 59 }; 60 61 62 #endif // ZONE_VIEW_H 63