1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
12 #include <svtools/svtdllapi.h>
15 #include <rtl/ustring.hxx>
16 #include <vcl/timer.hxx>
20 /** Periodically checks if a file has been modified
22 Instances of this class setup a vcl timer to occasionally wake up
23 check whether file modification time has changed.
25 class SVT_DLLPUBLIC FileChangedChecker
30 TimeValue mLastModTime
;
31 ::std::function
<void ()> mpCallback
;
33 bool SVT_DLLPRIVATE
getCurrentModTime(TimeValue
& o_rValue
) const;
34 DECL_DLLPRIVATE_LINK(TimerHandler
, Timer
*, void);
38 // bUpdate = true when file has changed, get the return and the object get the new time
39 // = false when file has changed, only get the return, not change the object
40 bool hasFileChanged(bool bUpdate
= true);
41 FileChangedChecker(OUString aFilename
,
42 ::std::function
<void ()> aCallback
);
43 // without Timer function
44 FileChangedChecker(OUString aFilename
);