Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / onlineupdate / source / update / updater / progressui-unused / progressui_gonk.cxx
blob2878aa2f0bb749e35a3ebaf9a7b56d0b600770e2
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=8 et :
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
6 * You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include <assert.h>
9 #include <stdio.h>
11 #include <string>
13 #include "android/log.h"
15 #include "progressui.h"
17 #define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoUpdater" , ## args)
19 int InitProgressUI(int *argc, char ***argv)
21 return 0;
24 int ShowProgressUI()
26 LOG("Starting to apply update ...\n");
27 return 0;
30 void QuitProgressUI()
32 LOG("Finished applying update\n");
35 void UpdateProgressUI(float progress)
37 assert(0.0f <= progress && progress <= 100.0f);
39 static const size_t kProgressBarLength = 50;
40 static size_t sLastNumBars;
41 size_t numBars = size_t(float(kProgressBarLength) * progress / 100.0f);
42 if (numBars == sLastNumBars)
44 return;
46 sLastNumBars = numBars;
48 size_t numSpaces = kProgressBarLength - numBars;
49 std::string bars(numBars, '=');
50 std::string spaces(numSpaces, ' ');
51 LOG("Progress [ %s%s ]\n", bars.c_str(), spaces.c_str());