bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / svtools / filechangedchecker.hxx
blobec8d8a41fdaca5aa1b14fe1bfced8e9b258ad088
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>
15 #include <osl/time.h>
16 #include <rtl/ustring.hxx>
17 #include <vcl/idle.hxx>
19 #include <functional>
21 class Timer;
23 /** Periodically checks if a file has been modified
25 Instances of this class setup a vcl timer to occasionally wake up
26 check whether file modification time has changed.
28 class SVT_DLLPUBLIC FileChangedChecker
30 private:
31 Idle mIdle;
32 OUString const mFileName;
33 TimeValue mLastModTime;
34 ::std::function<void ()> const mpCallback;
36 bool SVT_DLLPRIVATE getCurrentModTime(TimeValue& o_rValue) const;
37 DECL_LINK(TimerHandler, Timer *, void);
39 public:
40 void resetTimer();
41 bool hasFileChanged();
42 FileChangedChecker(const OUString& rFilename,
43 const ::std::function<void ()>& rCallback);
46 #endif