xref: /haiku/src/preferences/time/TimeZoneListItem.h (revision de1fb0e4502f8db699f16d7bd08c9ff98da59030)
1 /*
2  * Copyright 2010, Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Adrien Destugues <pulkomandy@pulkomandy.ath.cx>
7  */
8 #ifndef _TIME_ZONE_LIST_ITEM_H
9 #define _TIME_ZONE_LIST_ITEM_H
10 
11 
12 #include <StringItem.h>
13 
14 
15 class BBitmap;
16 class BCountry;
17 class BTimeZone;
18 
19 
20 class TimeZoneListItem : public BStringItem {
21 public:
22 								TimeZoneListItem(const char* text,
23 									BCountry* country, BTimeZone* timeZone);
24 	virtual						~TimeZoneListItem();
25 
26 	virtual	void				DrawItem(BView* owner, BRect frame,
27 									bool complete = false);
28 
29 	virtual	void				Update(BView* owner, const BFont* font);
30 
HasCountry()31 			bool				HasCountry() const
32 									{ return fCountry != NULL; };
Country()33 			const BCountry&		Country() const { return *fCountry; };
34 			void				SetCountry(BCountry* country);
35 
HasTimeZone()36 			bool				HasTimeZone() const
37 									{ return fTimeZone != NULL; };
TimeZone()38 			const BTimeZone&	TimeZone() const
39 									{ return *fTimeZone; };
40 			void				SetTimeZone(BTimeZone* timeZone);
41 
42 			const BString&		ID() const;
43 			const BString&		Name() const;
44 			int					OffsetFromGMT() const;
45 
46 private:
47 			void				_DrawItemWithTextOffset(BView* owner,
48 									BRect frame, bool complete,
49 									float textOffset);
50 
51 			BCountry*			fCountry;
52 			BTimeZone*			fTimeZone;
53 			BBitmap*			fIcon;
54 };
55 
56 
57 #endif	// _TIME_ZONE_LIST_ITEM_H
58