Kaydet (Commit) 44724236 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Add support for progress bar callbacks to LibreOfficeKit clients

The comphelper::LibreOfficeKit bits. Also will need additions to the
libsofficeapp bits in desktop and then to the StatusIndicator implementation
in framework.

Change-Id: I15c2505bbf6439c07d1956685d0a6d2a22aefc58
üst 7d8b0325
......@@ -27,6 +27,33 @@ bool isActive()
return bActive;
}
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);
}
} // namespace LibreOfficeKit
} // namespace comphelper
......
......@@ -22,6 +22,16 @@ COMPHELPER_DLLPUBLIC void setActive();
COMPHELPER_DLLPUBLIC bool isActive();
enum class statusIndicatorCallbackType { Start, SetValue, Finish };
COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data);
COMPHELPER_DLLPUBLIC void statusIndicatorStart();
COMPHELPER_DLLPUBLIC void statusIndicatorSetValue(int percent);
COMPHELPER_DLLPUBLIC void statusIndicatorFinish();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment