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/.
10 #include <comphelper/lok.hxx>
15 namespace LibreOfficeKit
18 static bool g_bActive(false);
20 void setActive(bool bActive
)
30 static void (*pStatusIndicatorCallback
)(void *data
, statusIndicatorCallbackType type
, int percent
)(nullptr);
31 static void *pStatusIndicatorCallbackData(nullptr);
33 void setStatusIndicatorCallback(void (*callback
)(void *data
, statusIndicatorCallbackType type
, int percent
), void *data
)
35 pStatusIndicatorCallback
= callback
;
36 pStatusIndicatorCallbackData
= data
;
39 void statusIndicatorStart()
41 if (pStatusIndicatorCallback
)
42 pStatusIndicatorCallback(pStatusIndicatorCallbackData
, statusIndicatorCallbackType::Start
, 0);
45 void statusIndicatorSetValue(int percent
)
47 if (pStatusIndicatorCallback
)
48 pStatusIndicatorCallback(pStatusIndicatorCallbackData
, statusIndicatorCallbackType::SetValue
, percent
);
51 void statusIndicatorFinish()
53 if (pStatusIndicatorCallback
)
54 pStatusIndicatorCallback(pStatusIndicatorCallbackData
, statusIndicatorCallbackType::Finish
, 0);
57 } // namespace LibreOfficeKit
59 } // namespace comphelper
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */