bump product version to 4.2.0.1
[LibreOffice.git] / include / svtools / filechangedchecker.hxx
blobacff32dd52118c7d8a8779a2bf6a74635630a021
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_SVTOOLS_FILECHANGEDCHECKER_HXX
11 #define INCLUDED_SVTOOLS_FILECHANGEDCHECKER_HXX
13 #include <svtools/svtdllapi.h>
14 #include <boost/function.hpp>
15 #include <osl/file.hxx>
16 #include <vcl/timer.hxx>
18 /** Periodically checks if a file has been modified
20 Instances of this class setup a vcl timer to occasionally wake up
21 check whether file modification time has changed.
23 class SVT_DLLPUBLIC FileChangedChecker
25 private :
26 Timer mTimer;
27 OUString mFileName;
28 TimeValue mLastModTime;
29 ::boost::function0<void> mpCallback;
31 bool SVT_DLLPRIVATE getCurrentModTime(TimeValue& o_rValue) const;
32 DECL_LINK(TimerHandler, void *);
34 public :
35 void resetTimer();
36 bool hasFileChanged();
37 FileChangedChecker(const OUString& rFilename, const ::boost::function0<void>& rCallback);
40 #endif