1 /* 2 * Copyright 2004-2009, 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 <View.h> 14 #include <Path.h> 15 16 17 class BMessage; 18 class BPopUpMenu; 19 class BListView; 20 class BButton; 21 class TTZDisplay; 22 23 24 class TimeZoneView : public BView { 25 public: 26 TimeZoneView(BRect frame); 27 virtual ~TimeZoneView(); 28 29 virtual void AttachedToWindow(); 30 virtual void MessageReceived(BMessage *message); 31 bool CheckCanRevert(); 32 33 private: 34 void UpdateDateTime(BMessage *message); 35 void ChangeRegion(BMessage *); 36 void SetTimeZone(); 37 void SetTimeZone(const char *zone); 38 void SetPreview(); 39 void SetCurrent(const char *text); 40 void InitView(); 41 void ReadTimeZoneLink(); 42 void BuildRegionMenu(); 43 void _Revert(); 44 45 // returns index of current zone 46 int32 FillCityList(const char *area); 47 48 status_t _GetTimezonesPath(BPath& path); 49 50 private: 51 BPopUpMenu *fRegionPopUp; 52 BListView *fCityList; 53 BButton *fSetZone; 54 TTZDisplay *fCurrent; 55 TTZDisplay *fPreview; 56 57 int32 fHour; 58 int32 fMinute; 59 BPath fCurrentZone; 60 BPath fOldZone; 61 bool fInitialized; 62 }; 63 64 #endif //Zone_View_H 65 66