xca/lib/XcaProgress.h
Christian Hohnstaedt 82da759a4e XcaProgress: separate Cmdline progress from GUI progress
The generic XcaProgress object is used, which dynamically
creates a Cmdline progress object.
The Mainwindow replaces it by a GUI object, which integrates
into the status bar.
2021-06-01 17:48:37 +02:00

48 lines
816 B
C++

/* vi: set sw=4 ts=4:
*
* Copyright (C) 2018 - 2020 Christian Hohnstaedt.
*
* All rights reserved.
*/
#ifndef __XCAPROGRESS_H
#define __XCAPROGRESS_H
#include <QString>
class XcaProgress_i
{
public:
XcaProgress_i() = default;
virtual void start(const QString &what, int max) = 0;
virtual void stop() = 0;
virtual void increment() = 0;
virtual ~XcaProgress_i() = default;
};
class XcaProgressCmd : public XcaProgress_i
{
private:
int i;
public:
void start(const QString &what, int max);
void stop();
void increment();
};
class XcaProgress
{
private:
static XcaProgress_i *progress;
public:
XcaProgress(const QString &what = QString(), int max = 100);
~XcaProgress();
void increment();
static void inc(int, int, void *p);
static void setGui(XcaProgress_i *p);
};
#endif