Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_VCL_IDLE_HXX
21 : #define INCLUDED_VCL_IDLE_HXX
22 :
23 : #include <tools/link.hxx>
24 : #include <vcl/scheduler.hxx>
25 :
26 201625 : class VCL_DLLPUBLIC Idle : public Scheduler
27 : {
28 : protected:
29 : Link<Idle *, void> maIdleHdl; // Callback Link
30 :
31 : public:
32 : Idle( const sal_Char *pDebugName = NULL );
33 : Idle( const Idle& rIdle );
34 :
35 : virtual void Start() SAL_OVERRIDE;
36 :
37 : /// Make it possible to associate a callback with this idle handler
38 : /// of course, you can also sub-class and override 'Invoke'
39 243660 : void SetIdleHdl( const Link<Idle *, void>& rLink ) { maIdleHdl = rLink; }
40 2631 : const Link<Idle *, void>& GetIdleHdl() const { return maIdleHdl; }
41 : virtual void Invoke() SAL_OVERRIDE;
42 : virtual bool ReadyForSchedule( bool bTimer ) SAL_OVERRIDE;
43 : virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) SAL_OVERRIDE;
44 : Idle& operator=( const Idle& rIdle );
45 : };
46 :
47 : #endif // INCLUDED_VCL_IDLE_HXX
48 :
49 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|