24 #ifndef INCLUDED_SALHELPER_TIMER_HXX 25 #define INCLUDED_SALHELPER_TIMER_HXX 56 Seconds = MilliSecs / 1000;
57 Nanosec = (MilliSecs % 1000) * 1000000L;
72 if ( Nanosec > 1000000000 )
74 Seconds += Nanosec / 1000000000;
75 Nanosec %= 1000000000;
89 return ( ( Seconds == 0 ) && ( Nanosec == 0 ) );
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;
161 void SAL_CALL setAbsoluteTime(
const TTimeValue& Time );
165 void SAL_CALL setRemainingTime(
const TTimeValue& Remaining );
174 void SAL_CALL addTime(
const TTimeValue& Time );
188 virtual void SAL_CALL onShot() = 0;
218 friend class TimerManager;
223 #endif // INCLUDED_SALHELPER_TIMER_HXX #define SAL_OVERRIDE
C++11 "override" feature.
Definition: types.h:391
TTimeValue(const TimeValue &rTimeValue)
Definition: timer.hxx:62
TTimeValue(sal_uInt32 Secs, sal_uInt32 Nano)
Definition: timer.hxx:46
TTimeValue m_aExpired
holds the time of expiration of this timer.
Definition: timer.hxx:198
TTimeValue()
Definition: timer.hxx:40
bool operator<(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:93
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:378
bool operator>(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:103
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:113
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:587
Interface for the Timer and handling the event.
Definition: timer.hxx:123
bool isEmpty() const
Definition: timer.hxx:87
sal_uInt32 Nanosec
Definition: time.h:78
unsigned char sal_Bool
Definition: types.h:38
void addTime(const TTimeValue &Delta)
Definition: timer.hxx:79
TTimeValue m_aRepeatDelta
holds the time interveal of successive expirations.
Definition: timer.hxx:202
TTimeValue(sal_uInt32 MilliSecs)
Definition: timer.hxx:54
TTimeValue m_aTimeOut
holds (initial) expiration time of this timer.
Definition: timer.hxx:194
#define SALHELPER_DLLPUBLIC
Definition: salhelperdllapi.h:32
Time since Jan-01-1970.
Definition: time.h:76
A simple base implementation for reference-counted objects.
Definition: simplereferenceobject.hxx:61
sal_uInt32 Seconds
Definition: time.h:77
Definition: condition.hxx:33
Timer * m_pNext
Pointer to the next timer (to fire).
Definition: timer.hxx:206
void normalize()
Definition: timer.hxx:70
Helper class for easier manipulation with TimeValue.
Definition: timer.hxx:38