KiCad PCB EDA Suite
Loading...
Searching...
No Matches
cli_progress_reporter.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef CLI_PROGRESS_REPORTER_H
25#define CLI_PROGRESS_REPORTER_H
26
27#include <wx/string.h>
28#include <progress_reporter.h>
29#include <kicommon.h>
30
35{
36public:
38
40
41 static PROGRESS_REPORTER& GetInstance();
42
46 virtual void SetNumPhases( int aNumPhases ) override {}
47 virtual void AddPhases( int aNumPhases ) override {};
48
52 virtual void BeginPhase( int aPhase ) override {}
53
57 virtual void AdvancePhase() override {}
58
62 virtual void AdvancePhase( const wxString& aMessage ) override;
63
67 virtual void Report( const wxString& aMessage ) override;
68
72 virtual void SetCurrentProgress( double aProgress ) override {}
73
78 virtual void SetMaxProgress( int aMaxProgress ) override {}
79
83 virtual void AdvanceProgress() override {}
84
92 virtual bool KeepRefreshing( bool aWait = false ) override { return false; }
93
101 virtual void SetTitle( const wxString& aTitle ) override {}
102
103 virtual bool IsCancelled() const override { return false; }
104
105
106private:
107 void printLine( const wxString& aMessage );
108};
109
110#endif
Reporter forwarding messages to stdout or stderr as appropriate.
virtual void SetTitle(const wxString &aTitle) override
Change the title displayed on the window caption.
virtual void AdvancePhase() override
Use the next available virtual zone of the dialog progress bar.
virtual void BeginPhase(int aPhase) override
Initialize the aPhase virtual zone of the dialog progress bar.
virtual void AdvanceProgress() override
Increment the progress bar length (inside the current virtual zone).
virtual void SetNumPhases(int aNumPhases) override
Set the number of phases.
virtual bool KeepRefreshing(bool aWait=false) override
Update the UI (if any).
virtual void AddPhases(int aNumPhases) override
virtual void SetMaxProgress(int aMaxProgress) override
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone).
virtual void SetCurrentProgress(double aProgress) override
Set the progress value to aProgress (0..1).
virtual bool IsCancelled() const override
A progress reporter interface for use in multi-threaded environments.
virtual void Report(const wxString &aMessage)=0
Display aMessage in the progress bar dialog.
virtual void AdvancePhase()=0
Use the next available virtual zone of the dialog progress bar.
#define KICOMMON_API
Definition: kicommon.h:28