xref: /haiku/src/preferences/time/ZoneView.h (revision 1214ef1b2100f2b3299fc9d8d6142e46f70a4c3f)
1 /*
2  * Copyright 2004-2007, 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 
32 	private:
33 		void 			UpdateDateTime(BMessage *message);
34 		void 			ChangeRegion(BMessage *);
35 		void 			SetTimeZone();
36 		void 			SetTimeZone(const char *zone);
37 		void 			SetPreview();
38 		void 			SetCurrent(const char *text);
39 		void 			InitView();
40 		void 			ReadTimeZoneLink();
41 		void 			BuildRegionMenu();
42 
43 		// returns index of current zone
44 		int32 			FillCityList(const char *area);
45 
46 	private:
47 		BPopUpMenu 		*fRegionPopUp;
48 		BListView 		*fCityList;
49 		BButton 		*fSetZone;
50 		TTZDisplay 		*fCurrent;
51 		TTZDisplay		*fPreview;
52 
53 		int32 			fHour;
54 		int32 			fMinute;
55 		BPath 			fCurrentZone;
56 		bool 			fInitialized;
57 };
58 
59 #endif //Zone_View_H
60 
61