LCOV - code coverage report
Current view: top level - comphelper/source/misc - lok.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 21 21 100.0 %
Date: 2015-06-13 12:38:46 Functions: 6 6 100.0 %
Legend: Lines: hit not hit

          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             : 
      10             : #include <comphelper/lok.hxx>
      11             : 
      12             : namespace comphelper
      13             : {
      14             : 
      15             : namespace LibreOfficeKit
      16             : {
      17             : 
      18             : static bool bActive(false);
      19             : 
      20           1 : void setActive()
      21             : {
      22           1 :     bActive = true;
      23           1 : }
      24             : 
      25       58966 : bool isActive()
      26             : {
      27       58966 :     return bActive;
      28             : }
      29             : 
      30             : static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent)(nullptr);
      31             : static void *pStatusIndicatorCallbackData(nullptr);
      32             : 
      33           2 : void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data)
      34             : {
      35           2 :     pStatusIndicatorCallback = callback;
      36           2 :     pStatusIndicatorCallbackData = data;
      37           2 : }
      38             : 
      39           3 : void statusIndicatorStart()
      40             : {
      41           3 :     if (pStatusIndicatorCallback)
      42           3 :         pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Start, 0);
      43           3 : }
      44             : 
      45          74 : void statusIndicatorSetValue(int percent)
      46             : {
      47          74 :     if (pStatusIndicatorCallback)
      48          74 :         pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::SetValue, percent);
      49          74 : }
      50             : 
      51           3 : void statusIndicatorFinish()
      52             : {
      53           3 :     if (pStatusIndicatorCallback)
      54           3 :         pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Finish, 0);
      55           3 : }
      56             : 
      57             : } // namespace LibreOfficeKit
      58             : 
      59             : } // namespace comphelper
      60             : 
      61             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11