diff options
Diffstat (limited to 'support/dktools/Dk4WxProgressControllerBase.h')
-rw-r--r-- | support/dktools/Dk4WxProgressControllerBase.h | 149 |
1 files changed, 0 insertions, 149 deletions
diff --git a/support/dktools/Dk4WxProgressControllerBase.h b/support/dktools/Dk4WxProgressControllerBase.h deleted file mode 100644 index 39ef984553..0000000000 --- a/support/dktools/Dk4WxProgressControllerBase.h +++ /dev/null @@ -1,149 +0,0 @@ -/* -Copyright 2020, Dirk Krause. All rights reserved. -SPDX-License-Identifier: BSD-3-Clause -*/ - -/** @file Dk4WxProgressControllerBase.h Progress controller base class. -*/ -#ifndef DK4WXPROGRESSCONTROLLERBASE_H_INCLUDED -#define DK4WXPROGRESSCONTROLLERBASE_H_INCLUDED 1 - -#ifndef DK4CONF_H_INCLUDED -#if DK4_BUILDING_DKTOOLS4 -#include "dk4conf.h" -#else -#include <dktools-4/dk4conf.h> -#endif -#endif - -/** Base class for progress controllers interface to worker thread. -*/ -class Dk4WxProgressControllerWorkerBase -{ - - public: - - /* - While the worker thread is running, it can - - check whether the worker thread is allowed to continue, - - set a new gauge value for the progress bar in the progress dialog, - - indicate that the main thread should show a dialog box after - the worker thread has finished, - - indicate end of processing immediately before finishing. - */ - - /** Check whether worker thread is allowed to continue processing. - @return True if worker thread can continue normally, false - if worker thread should abort. - */ - virtual - bool - CanContinue(void) = 0; - - /** Set gauge value for progress dialog. - @param value New value for gauge. - */ - virtual - void - SetGauge(int value) = 0; - - /** Indicate that a dialog box should be shown by the main thread - after the worker thread has finished. - @param title Message box title. - @param msg Message box text. - @param st Message box style. - */ - virtual - void - SetDialogData( - const wxString & title, - const wxString & msg, - int st = wxID_OK - ) = 0; - - /** End processing. - Called from worker thread immediately before finished. - Note: If you want to call SetGaugeValue() or SetDialogData(), - call these functions before EndProcessing(). - @param success Flag: Successful processing. - */ - virtual - void - EndProcessing(bool success = true) = 0; - -}; - - -/** Progress controllers interface to event processing (main) thread. -*/ -class Dk4WxProgressControllerOwnerBase -{ - public: - - /* - Before the worker thread is started either the main - thread or the worker thread should indicate start of processing. - */ - - /** Start processing. Optionally called from worker thread - or main thread. - Must be called if a controller is used multiple times. - */ - virtual - void - StartProcessing(void) = 0; - - /* - While the worker thread is running, the main thread (event thread) can - - check whether the worker thread finished processing, - - retrieve the current gauge value, - - abort processing on behalf of the progress dialogs cancel button. - */ - - /** Check whether the worker thread is finished. - @return True if the worker thread is finished, false while running. - */ - virtual - bool - IsFinished(void) = 0; - - /** Retrieve gauge value. - @return Current value for progress gauge. - */ - virtual - int - GetGauge(void) = 0; - - /** Abort processing. Called from the progress dialogs Cancel button. - */ - virtual - void - AbortProcessing(void) = 0; - - /* - After the worker thread finished processing, the event thread can: - - check whether the worker thread finished successfully, - - check whether a dialog box should show a processing summary. - */ - - /** Check whether the worker thread finished successfully. - @return True to indicate success, false otherwise. - */ - virtual - bool - GetSuccess(void) = 0; - - /** Check whether a dialog should be shown. - @param title Result variable for message box title. - @param msg Result variable for message text. - @param style Result variable for dialog box style. - @return True to show a dialog, false otherwise. - */ - virtual - bool - GetDialogData(wxString & title, wxString & msg, int & style) = 0; - -}; - -#endif - |