KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 (C) 2017 CERN
5 * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * Author: Tomasz Wlostowski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef PROGRESS_REPORTER_H
28#define PROGRESS_REPORTER_H
29
30#include <kicommon.h>
31
39{
40public:
41
43 { }
44
46
48 { }
49
53 virtual void SetNumPhases( int aNumPhases ) = 0;
54 virtual void AddPhases( int aNumPhases ) = 0;
55
59 virtual void BeginPhase( int aPhase ) = 0;
60
64 virtual void AdvancePhase() = 0;
65
69 virtual void AdvancePhase( const wxString& aMessage ) = 0;
70
74 virtual void Report( const wxString& aMessage ) = 0;
75
79 virtual void SetCurrentProgress( double aProgress ) = 0;
80
85 virtual void SetMaxProgress( int aMaxProgress ) = 0;
86
90 virtual void AdvanceProgress() = 0;
91
99 virtual bool KeepRefreshing( bool aWait = false ) = 0;
100
108 virtual void SetTitle( const wxString& aTitle ) = 0;
109
110 virtual bool IsCancelled() const = 0;
111};
112
113
114#endif
A progress reporter interface for use in multi-threaded environments.
virtual bool IsCancelled() const =0
virtual void AddPhases(int aNumPhases)=0
virtual bool KeepRefreshing(bool aWait=false)=0
Update the UI (if any).
virtual void SetNumPhases(int aNumPhases)=0
Set the number of phases.
PROGRESS_REPORTER(const PROGRESS_REPORTER &)=delete
virtual void Report(const wxString &aMessage)=0
Display aMessage in the progress bar dialog.
virtual ~PROGRESS_REPORTER()
virtual void BeginPhase(int aPhase)=0
Initialize the aPhase virtual zone of the dialog progress bar.
virtual void AdvancePhase()=0
Use the next available virtual zone of the dialog progress bar.
virtual void SetTitle(const wxString &aTitle)=0
Change the title displayed on the window caption.
virtual void AdvanceProgress()=0
Increment the progress bar length (inside the current virtual zone).
virtual void AdvancePhase(const wxString &aMessage)=0
Use the next available virtual zone of the dialog progress bar and updates the message.
virtual void SetCurrentProgress(double aProgress)=0
Set the progress value to aProgress (0..1).
virtual void SetMaxProgress(int aMaxProgress)=0
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone).
#define KICOMMON_API
Definition: kicommon.h:28