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 bool GetUseGmtTime(); 40 41 private: 42 void _InitView(); 43 void _UpdateDateTime(BMessage* message); 44 void _NotifyClockSettingChanged(); 45 void _Revert(); 46 time_t _PrefletUptime() const; 47 48 TDateEdit* fDateEdit; 49 TTimeEdit* fTimeEdit; 50 BCalendarView* fCalendarView; 51 TAnalogClock* fClock; 52 53 bool fInitialized; 54 55 time_t fTimeAtStart; 56 bigtime_t fSystemTimeAtStart; 57 }; 58 59 60 #endif // _DATE_TIME_VIEW_H 61