/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/* * This file is part of LibreOffice published API.
*/
/** Helper class for easier manipulation with TimeValue. * * Times are seconds in UTC since 01.01.1970
*/ struct SAL_WARN_UNUSED TTimeValue : public TimeValue
{
TTimeValue()
{
Seconds = 0;
Nanosec = 0;
}
/** Returns sal_True if timer is running.
*/
sal_Bool SAL_CALL isTicking() const;
/** Is the timer expired?
*/
sal_Bool SAL_CALL isExpired() const;
/** Does pTimer expires before us?
*/
sal_Bool SAL_CALL expiresBefore( const Timer* pTimer ) const;
/** Set the absolute time when the timer should fire.
*/ void SAL_CALL setAbsoluteTime( const TTimeValue& Time );
/** Set the time to fire to 'now' + Remaining.
*/ void SAL_CALL setRemainingTime( const TTimeValue& Remaining );
/** Set the time to fire to 'now' + Remaining with repeat interveal * Repeat.
*/ void SAL_CALL setRemainingTime( const TTimeValue& Remaining, const TTimeValue& Repeat );
/** Adds Time to the 'fire time'.
*/ void SAL_CALL addTime( const TTimeValue& Time );
/** Returns the remaining time before timer expiration relative to now.
*/
TTimeValue SAL_CALL getRemainingTime() const;
/** Internal method to shutdown the timer thread
*/ staticvoid SAL_CALL joinThread();
/** Internal method to re-start the timer thread if necessary
*/ staticvoid SAL_CALL startThread();
protected:
/** Destructor.
*/ virtual ~Timer() SAL_OVERRIDE;
/** What should be done when the 'timer fires'.
*/ virtualvoid SAL_CALL onShot() = 0;
protected:
/** holds (initial) expiration time of this timer.
*/
TTimeValue m_aTimeOut;
/** holds the time of expiration of this timer.
*/
TTimeValue m_aExpired;
/** holds the time interveal of successive expirations.
*/
TTimeValue m_aRepeatDelta;
/** Pointer to the next timer (to fire).
*/
Timer* m_pNext;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.