From f68c57869c36ed51c5d20634cc04e979fa6604c6 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sun, 2 Oct 2016 23:27:42 +0200 Subject: [PATCH] refs #743, progress (bar) interface a class supporting a kind of progress indicator can implement the interface and be updated in utility functions --- src/blackcore/progress.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/blackcore/progress.h diff --git a/src/blackcore/progress.h b/src/blackcore/progress.h new file mode 100644 index 000000000..e0883c831 --- /dev/null +++ b/src/blackcore/progress.h @@ -0,0 +1,36 @@ +/* Copyright (C) 2016 + * swift project Community / Contributors + * + * This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +#ifndef BLACKCORE_PROGRESS_H +#define BLACKCORE_PROGRESS_H + +#include "application.h" + +namespace BlackCore +{ + /*! + * Implementing class features a progress bar or something similar. + * Hence such an object can be passed and the progress monitored. + */ + class IProgressIndicator + { + public: + //! Update the progress indicator 0..100 + virtual void updateProgressIndicator(int percentage) = 0; + + //! Same as updateProgressIndicator but processing events + void updateProgressIndicatorAndProcessEvents(int percentage) + { + this->updateProgressIndicator(percentage); + BlackCore::CApplication::processEventsFor(10); + } + }; +} // ns + +#endif // guard