00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 /* AbiSource Program Utilities 00003 * Copyright (C) 1998 AbiSource, Inc. 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 * 02110-1301 USA. 00019 */ 00020 00021 00022 00023 #ifndef UT_WIN32TIMER_H 00024 #define UT_WIN32TIMER_H 00025 00026 #include "ut_timer.h" 00027 00028 class ABI_EXPORT UT_Win32Timer : public UT_Timer 00029 { 00030 public: 00031 UT_Win32Timer(UT_TimerCallback pCallback, void* pData); 00032 ~UT_Win32Timer(); 00033 00034 virtual UT_sint32 set(UT_uint32 iMilliseconds); 00035 virtual void stop(void); 00036 virtual void start(void); 00037 00038 bool isActive(void) const { return m_bStarted; } 00039 00040 static UT_Win32Timer* findWin32Timer(UINT win32ID); 00041 static void pauseAllTimers(bool bPause){s_bPauseAllTimers = bPause;} 00042 static bool timersPaused(){return s_bPauseAllTimers;} 00043 00044 protected: 00045 UT_sint32 m_iMilliseconds; 00046 bool m_bStarted; 00047 UINT m_win32ID; 00048 00049 private: 00050 static bool s_bPauseAllTimers; 00051 }; 00052 00053 VOID CALLBACK Global_Win32TimerProc(HWND hwnd, 00054 UINT uMsg, 00055 UINT idEvent, 00056 DWORD dwTime); 00057 00058 #endif /* UT_WIN32TIMER_H */ 00059