diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-07-31 16:35:49 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-07-13 12:10:29 +0200 |
commit | 36f93104d58abbe55cc4d245f4c81436a2b1eba5 (patch) | |
tree | 436bc9aa5e06e2dea6494de61e585f7a602edef5 /sw/inc | |
parent | 00aa0892e7385cd8395dd39814077958be42e720 (diff) |
Don't update document stats for non-idle views
This functionality should be merged into the DocumentTimerManager,
which itself should run the different document idle tasks via
seperate jobs instead of a single idle, if they don't depend on
each other.
To implement a non-busy, suspendable Idle, this adds an AutoIdle
class, which is automatically re-scheduled after being processed.
It also adds a SwDocIdle, which isn't ready to schedule for busy
documents.
Change-Id: I185137ed3423ecaae0f7edb39018d26c4244d359
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/SwDocIdle.hxx | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/sw/inc/SwDocIdle.hxx b/sw/inc/SwDocIdle.hxx new file mode 100644 index 000000000000..6bc65e24766c --- /dev/null +++ b/sw/inc/SwDocIdle.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SW_INC_SWDOCIDLE_HXX +#define INCLUDED_SW_INC_SWDOCIDLE_HXX + +#include <doc.hxx> +#include <vcl/idle.hxx> + +namespace sw { + +/** + * An Idle, which is just ready to be scheduled for idle documents. + * + * Currently it's missing the notification, when busy documents become idle + * again, so it relies on any task being triggered to recheck, which is + * quite probably not a problem, as busy documents have a high chance to have + * generated idle tasks. + */ +class SwDocIdle : public AutoIdle +{ +private: + SwDoc &m_rDoc; + +protected: + virtual sal_uInt64 UpdateMinPeriod( + sal_uInt64 nMinPeriod, sal_uInt64 nTimeNow ) const override; + +public: + SwDocIdle( SwDoc &doc ); + virtual ~SwDocIdle() override; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |