2015-03-29 22:59:22 +03:00
|
|
|
/* -*- 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/.
|
|
|
|
*/
|
|
|
|
|
2015-04-02 13:22:04 +03:00
|
|
|
#include <comphelper/lok.hxx>
|
2015-03-29 22:59:22 +03:00
|
|
|
|
2015-04-02 13:22:04 +03:00
|
|
|
namespace comphelper
|
2015-03-29 22:59:22 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
namespace LibreOfficeKit
|
|
|
|
{
|
|
|
|
|
2015-06-18 14:12:04 +02:00
|
|
|
static bool g_bActive(false);
|
2015-03-29 22:59:22 +03:00
|
|
|
|
2016-09-29 12:49:23 +02:00
|
|
|
static bool g_bPartInInvalidation(false);
|
2016-06-16 07:28:58 -04:00
|
|
|
|
2016-10-04 10:56:55 +02:00
|
|
|
static bool g_bTiledPainting(false);
|
|
|
|
|
2015-06-18 14:12:04 +02:00
|
|
|
void setActive(bool bActive)
|
2015-04-02 13:22:04 +03:00
|
|
|
{
|
2015-06-18 14:12:04 +02:00
|
|
|
g_bActive = bActive;
|
2015-03-29 22:59:22 +03:00
|
|
|
}
|
2015-04-02 13:22:04 +03:00
|
|
|
|
|
|
|
bool isActive()
|
|
|
|
{
|
2015-06-18 14:12:04 +02:00
|
|
|
return g_bActive;
|
2015-03-29 22:59:22 +03:00
|
|
|
}
|
|
|
|
|
2016-09-29 12:49:23 +02:00
|
|
|
void setPartInInvalidation(bool bPartInInvalidation)
|
2016-06-16 07:28:58 -04:00
|
|
|
{
|
2016-09-29 12:49:23 +02:00
|
|
|
g_bPartInInvalidation = bPartInInvalidation;
|
2016-06-16 07:28:58 -04:00
|
|
|
}
|
|
|
|
|
2016-09-29 12:49:23 +02:00
|
|
|
bool isPartInInvalidation()
|
2016-06-16 07:28:58 -04:00
|
|
|
{
|
2016-09-29 12:49:23 +02:00
|
|
|
return g_bPartInInvalidation;
|
2016-06-16 07:28:58 -04:00
|
|
|
}
|
|
|
|
|
2016-10-04 10:56:55 +02:00
|
|
|
void setTiledPainting(bool bTiledPainting)
|
|
|
|
{
|
|
|
|
g_bTiledPainting = bTiledPainting;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isTiledPainting()
|
|
|
|
{
|
|
|
|
return g_bTiledPainting;
|
|
|
|
}
|
|
|
|
|
2016-06-16 07:28:58 -04:00
|
|
|
static bool g_bLocalRendering(false);
|
|
|
|
|
|
|
|
void setLocalRendering(bool bLocalRendering)
|
|
|
|
{
|
|
|
|
g_bLocalRendering = bLocalRendering;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isLocalRendering()
|
|
|
|
{
|
|
|
|
return g_bLocalRendering;
|
|
|
|
}
|
|
|
|
|
2015-05-06 16:00:35 +03:00
|
|
|
static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent)(nullptr);
|
|
|
|
static void *pStatusIndicatorCallbackData(nullptr);
|
|
|
|
|
|
|
|
void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data)
|
|
|
|
{
|
|
|
|
pStatusIndicatorCallback = callback;
|
|
|
|
pStatusIndicatorCallbackData = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
void statusIndicatorStart()
|
|
|
|
{
|
|
|
|
if (pStatusIndicatorCallback)
|
|
|
|
pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Start, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void statusIndicatorSetValue(int percent)
|
|
|
|
{
|
|
|
|
if (pStatusIndicatorCallback)
|
|
|
|
pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::SetValue, percent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void statusIndicatorFinish()
|
|
|
|
{
|
|
|
|
if (pStatusIndicatorCallback)
|
|
|
|
pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Finish, 0);
|
|
|
|
}
|
|
|
|
|
2015-04-02 13:22:04 +03:00
|
|
|
} // namespace LibreOfficeKit
|
2015-03-29 22:59:22 +03:00
|
|
|
|
2015-04-02 13:22:04 +03:00
|
|
|
} // namespace comphelper
|
2015-03-29 22:59:22 +03:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|