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
15class BBitmap;
16class BCountry;
17class BTimeZone;
18
19
20class TimeZoneListItem : public BStringItem {
21public:
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
31			bool				HasCountry() const
32									{ return fCountry != NULL; };
33			const BCountry&		Country() const { return *fCountry; };
34			void				SetCountry(BCountry* country);
35
36			bool				HasTimeZone() const
37									{ return fTimeZone != NULL; };
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
46private:
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