2021-01-23 15:51:09 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2021-01-23 02:23:37 +00:00
|
|
|
|
|
|
|
#ifndef PATHS_H
|
|
|
|
#define PATHS_H
|
|
|
|
|
2021-01-23 15:51:09 +00:00
|
|
|
/**
|
|
|
|
* Helper class to centralize the paths used throughout kicad
|
|
|
|
*/
|
2021-01-23 02:23:37 +00:00
|
|
|
class PATHS
|
|
|
|
{
|
|
|
|
public:
|
2021-01-28 02:06:13 +00:00
|
|
|
|
2021-01-23 15:51:09 +00:00
|
|
|
/**
|
|
|
|
* Gets the user path for python scripts
|
|
|
|
*/
|
2021-01-23 02:23:37 +00:00
|
|
|
static wxString GetUserScriptingPath();
|
2021-01-23 15:51:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the user path for custom templates
|
|
|
|
*/
|
2021-01-23 02:23:37 +00:00
|
|
|
static wxString GetUserTemplatesPath();
|
2021-01-23 15:51:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the user path for plugins
|
|
|
|
*/
|
2021-01-23 15:46:48 +00:00
|
|
|
static wxString GetUserPluginsPath();
|
2021-01-23 15:51:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the user path for 3d viewer plugin
|
|
|
|
*/
|
2021-01-23 15:46:48 +00:00
|
|
|
static wxString GetUserPlugins3DPath();
|
2021-01-23 15:51:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the default path we point users to create projects
|
|
|
|
*/
|
2021-01-23 04:17:32 +00:00
|
|
|
static wxString GetDefaultUserProjectsPath();
|
2021-01-23 15:51:09 +00:00
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
/**
|
|
|
|
* Gets the default path we point users to create projects
|
|
|
|
*/
|
|
|
|
static wxString GetDefaultUserSymbolsPath();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the default path we point users to create projects
|
|
|
|
*/
|
|
|
|
static wxString GetDefaultUserFootprintsPath();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the default path we point users to create projects
|
|
|
|
*/
|
|
|
|
static wxString GetDefaultUser3DModelsPath();
|
|
|
|
|
2021-01-23 15:51:09 +00:00
|
|
|
/**
|
|
|
|
* Gets the stock (install) scripting path
|
|
|
|
*/
|
2021-01-23 04:27:39 +00:00
|
|
|
static wxString GetStockScriptingPath();
|
2021-01-23 15:51:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the stock (install) plugins path
|
|
|
|
*/
|
2021-01-23 15:46:48 +00:00
|
|
|
static wxString GetStockPluginsPath();
|
2021-01-23 15:51:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the stock (install) 3d viewer pluginspath
|
|
|
|
*/
|
2021-01-23 15:46:48 +00:00
|
|
|
static wxString GetStockPlugins3DPath();
|
2021-01-23 15:51:09 +00:00
|
|
|
|
2021-01-23 16:59:19 +00:00
|
|
|
/**
|
|
|
|
* Gets the stock (install) 3d viewer pluginspath
|
|
|
|
*/
|
|
|
|
static wxString GetUserCachePath();
|
|
|
|
|
2021-01-28 02:06:13 +00:00
|
|
|
/**
|
|
|
|
* Attempts to create a given path if it does not exist
|
|
|
|
*/
|
|
|
|
static bool EnsurePathExists( const wxString& aPath );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ensures/creates user default paths
|
|
|
|
*/
|
|
|
|
static void EnsureUserPathsExist();
|
|
|
|
|
2021-01-23 15:51:09 +00:00
|
|
|
private:
|
|
|
|
// we are a static helper
|
|
|
|
PATHS() {}
|
2021-01-28 02:06:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the user path for the current kicad version which acts as the root for other user paths
|
|
|
|
*
|
|
|
|
* @param aPath Variable to receive the path
|
|
|
|
*/
|
|
|
|
static void getUserDocumentPath( wxFileName& aPath );
|
2021-01-23 02:23:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|