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 TAnalogClock; 20 21 22 namespace BPrivate { 23 class BCalendarView; 24 class DateEdit; 25 class TimeEdit; 26 } 27 using BPrivate::BCalendarView; 28 using BPrivate::DateEdit; 29 using BPrivate::TimeEdit; 30 31 32 class DateTimeView : public BGroupView { 33 public: 34 DateTimeView(const char* name); 35 virtual ~DateTimeView(); 36 37 virtual void AttachedToWindow(); 38 virtual void MessageReceived(BMessage* message); 39 40 bool CheckCanRevert(); 41 42 private: 43 void _InitView(); 44 void _UpdateDateTime(BMessage* message); 45 void _Revert(); 46 time_t _PrefletUptime() const; 47 48 DateEdit* fDateEdit; 49 TimeEdit* 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