xref: /haiku/src/preferences/time/DateTimeView.h (revision 579f1dbca962a2a03df54f69fdc6e9423f91f20e)
1 /*
2  * Copyright 2004-2011, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Andrew McCall <mccall@@digitalparadise.co.uk>
7  *		Mike Berg <mike@berg-net.us>
8  *		Julun <host.haiku@gmx.de>
9  *		Philippe Saint-Pierre <stpere@gmail.com>
10  *		Hamish Morrison <hamish@lavabit.com>
11  */
12 #ifndef _DATE_TIME_VIEW_H
13 #define _DATE_TIME_VIEW_H
14 
15 
16 #include <LayoutBuilder.h>
17 
18 
19 class TDateEdit;
20 class TTimeEdit;
21 class TAnalogClock;
22 
23 
24 namespace BPrivate {
25 	class BCalendarView;
26 }
27 using BPrivate::BCalendarView;
28 
29 
30 class DateTimeView : public BGroupView {
31 public:
32 								DateTimeView(const char* name);
33 	virtual 					~DateTimeView();
34 
35 	virtual	void			 	AttachedToWindow();
36 	virtual	void 				MessageReceived(BMessage* message);
37 
38 			bool				CheckCanRevert();
39 
40 private:
41 			void 				_InitView();
42 			void 				_UpdateDateTime(BMessage* message);
43 			void				_Revert();
44 			time_t				_PrefletUptime() const;
45 
46 			TDateEdit*			fDateEdit;
47 			TTimeEdit*			fTimeEdit;
48 			BCalendarView*		fCalendarView;
49 			TAnalogClock*		fClock;
50 
51 			bool				fInitialized;
52 
53 			time_t				fTimeAtStart;
54 			bigtime_t			fSystemTimeAtStart;
55 };
56 
57 
58 #endif	// _DATE_TIME_VIEW_H
59