38 #include <wx/filename.h> 39 #include <wx/gdicmn.h> 42 class wxSingleInstanceChecker;
87 ENV_VAR_ITEM(
const wxString& aValue = wxEmptyString,
bool aIsDefinedExternally =
false ) :
154 virtual bool OnPgmInit() = 0;
156 virtual void OnPgmExit() = 0;
165 virtual void MacOpenFile(
const wxString& aFileName ) = 0;
182 virtual const wxString&
GetEditorName(
bool aCanShowFileChooser =
true );
192 const wxString& aDefaultEditor = wxEmptyString );
231 virtual bool SetLanguage( wxString& aErrMsg,
bool first_time =
false );
300 virtual wxApp&
App();
391 #endif // PGM_BASE_H_ virtual bool IsKicadEnvVariableDefined() const
virtual COMMON_SETTINGS * GetCommonSettings() const
virtual SETTINGS_MANAGER & GetSettingsManager() const
void loadCommonSettings()
Loads internal settings from COMMON_SETTINGS.
virtual void SetEditorName(const wxString &aFileName)
bool m_isDefinedExternally
Flag to indicate if the environment variable was defined externally to the process.
ENV_VAR_MAP m_local_env_vars
Local environment variable expansion settings such as KICAD6_FOOTPRINT_DIR, and KICAD6_3DMODEL_DIR.
void SaveCommonSettings()
Save the program (process) settings subset which are stored .kicad_common.
Container for data for KiCad programs.
virtual void MacOpenFile(const wxString &aFileName)=0
Specific to MacOSX (not used under Linux or Windows).
wxString m_value
The environment variable string value.
wxLocale * m_locale
The current locale.
A simple helper class to store environment variable values and the status of whether or not they were...
const wxString & GetValue() const
int m_KI_Lang_Identifier
KiCad identifier used in menu selection (See id.h)
virtual wxApp & App()
Returns a bare naked wxApp which may come from wxPython, SINGLE_TOP, or kicad.exe.
bool m_show_env_var_dialog
Flag to indicate if the environment variable overwrite warning dialog should be shown.
bool setExecutablePath()
Find the path to the executable and stores it in PGM_BASE::m_bin_dir.
virtual const ENV_VAR_MAP & GetLocalEnvVariables() const
A small class to handle the list of existing translations.
wxSingleInstanceChecker * m_pgm_checker
prevents multiple instances of a program from being run at the same time.
bool m_DoNotTranslate
Set to true if the m_Lang_Label must not be translated.
virtual void WritePdfBrowserInfos()
Save the PDF browser choice to the common configuration.
virtual void ForceSystemPdfBrowser(bool aFlg)
Force the use of system PDF browser, even if a preferred PDF browser is set.
virtual const wxString AskUserForPreferredEditor(const wxString &aDefaultEditor=wxEmptyString)
Shows a dialog that instructs the user to select a new preferred editor.
bool m_use_system_pdf_browser
true to use the selected PDF browser, if exists, or false to use the default
int m_language_id
The current language setting.
std::unique_ptr< SETTINGS_MANAGER > m_settings_manager
virtual bool UseSystemPdfBrowser() const
wxString m_kicad_env
The KICAD system environment variable.
static const wxChar workingDirKey[]
bool GetDefinedExternally() const
virtual bool SetLocalEnvVariable(const wxString &aName, const wxString &aValue)
Sets the environment variable aName to aValue.
virtual const wxString & GetKicadEnvVariable() const
virtual void SetLanguageIdentifier(int menu_id)
Set in .m_language_id member the wxWidgets language identifier ID fromthe KiCad menu id (internal men...
std::map< wxString, ENV_VAR_ITEM > ENV_VAR_MAP
void SetDefinedExternally(bool aIsDefinedExternally)
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
virtual int GetSelectedLanguageIdentifier() const
virtual void SetPdfBrowserName(const wxString &aFileName)
PGM_BASE & Pgm()
The global Program "get" accessor.
std::map< wxString, ENV_VAR_ITEM >::const_iterator ENV_VAR_MAP_CITER
void setLanguageId(int aId)
Trap all changes in here, simplifies debugging.
int m_WX_Lang_Identifier
wxWidgets locale identifier (See wxWidgets doc)
virtual bool SetLanguage(wxString &aErrMsg, bool first_time=false)
Set the dictionary file name for internationalization.
wxString m_Lang_Label
Labels used in menus.
virtual void SetLanguagePath()
wxString m_bin_dir
full path to this program
virtual const wxString & GetPdfBrowserName() const
virtual void SetLocalEnvVariables(const ENV_VAR_MAP &aEnvVarMap)
Set the internal local environment variable map to aEnvVarMap, updates the entries in the ....
virtual void ReadPdfBrowserInfos()
Read the PDF browser choice from the common configuration.
bool m_Printing
wxWidgets on MSW tends to crash if you spool up more than one print job at a time.
virtual const wxString & GetExecutablePath() const
void SetValue(const wxString &aValue)
bool InitPgm()
Initialize this program.
virtual wxLocale * GetLocale()
wxString m_pdf_browser
The file name of the the program selected for browsing pdf files.
std::map< wxString, ENV_VAR_ITEM >::iterator ENV_VAR_MAP_ITER
virtual const wxString & GetEditorName(bool aCanShowFileChooser=true)
Return the preferred editor name.
ENV_VAR_ITEM(const wxString &aValue=wxEmptyString, bool aIsDefinedExternally=false)
LANGUAGE_DESCR LanguagesList[]
An array containing all the languages that KiCad supports.
bool SetDefaultLanguage(wxString &aErrMsg)
Set the default language without reference to any preferences.