24#ifndef INCLUDED_SALHELPER_TIMER_HXX
25#define INCLUDED_SALHELPER_TIMER_HXX
57 Nanosec = (MilliSecs % 1000) * 1000000L;
65 Nanosec = rTimeValue.Nanosec;
72 if ( Nanosec > 1000000000 )
74 Seconds += Nanosec / 1000000000;
75 Nanosec %= 1000000000;
82 Nanosec +=
Delta.Nanosec;
89 return ( (
Seconds == 0 ) && ( Nanosec == 0 ) );
95 if ( rTimeA.Seconds < rTimeB.Seconds )
97 else if ( rTimeA.Seconds > rTimeB.Seconds )
100 return ( rTimeA.Nanosec < rTimeB.Nanosec );
105 if ( rTimeA.Seconds > rTimeB.Seconds )
107 else if ( rTimeA.Seconds < rTimeB.Seconds )
110 return ( rTimeA.Nanosec > rTimeB.Nanosec );
115 return ( ( rTimeA.Seconds == rTimeB.Seconds ) &&
116 ( rTimeA.Nanosec == rTimeB.Nanosec ) );
141 void SAL_CALL
start();
145 void SAL_CALL
stop();
149 sal_Bool SAL_CALL isTicking()
const;
153 sal_Bool SAL_CALL isExpired()
const;
157 sal_Bool SAL_CALL expiresBefore(
const Timer* pTimer )
const;
165 void SAL_CALL setRemainingTime(
const TTimeValue& Remaining );
184 virtual ~Timer() SAL_OVERRIDE;
A simple base implementation for reference-counted objects.
Interface for the Timer and handling the event.
virtual void SAL_CALL onShot()=0
What should be done when the 'timer fires'.
TTimeValue m_aTimeOut
holds (initial) expiration time of this timer.
Timer * m_pNext
Pointer to the next timer (to fire).
void SAL_CALL operator=(const Timer &rTimer) SAL_DELETED_FUNCTION
Copy assignment operator deleted.
TTimeValue m_aExpired
holds the time of expiration of this timer.
TTimeValue m_aRepeatDelta
holds the time interveal of successive expirations.
Timer(const Timer &rTimer) SAL_DELETED_FUNCTION
Copy constructor deleted.
bool normalize(sal_uInt16 &rDay, sal_uInt16 &rMonth, sal_Int16 &rYear)
bool operator<(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
bool operator>(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
#define SALHELPER_DLLPUBLIC
Helper class for easier manipulation with TimeValue.
TTimeValue(const TimeValue &rTimeValue)
TTimeValue(sal_uInt32 MilliSecs)
void SAL_CALL normalize()
bool SAL_CALL isEmpty() const
TTimeValue(sal_uInt32 Secs, sal_uInt32 Nano)
void SAL_CALL addTime(const TTimeValue &Delta)