KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_io_mgr.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) 2016 CERN
5 * Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Wayne Stambaugh <[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 3
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 along
20 * with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef _SCH_IO_MGR_H_
24#define _SCH_IO_MGR_H_
25
26#include <import_export.h>
27#include <map>
28#include <enum_vector.h>
29#include <reporter.h>
30#include <i18n_utility.h>
31#include <io/io_base.h>
32#include <io/io_mgr.h>
33#include <wx/arrstr.h>
34
35
36class SCH_SHEET;
37class SCH_SCREEN;
38class SCH_IO;
39class SCHEMATIC;
41class KIWAY;
42class LIB_SYMBOL;
43class SYMBOL_LIB;
45
46
50class SCH_IO_MGR : public IO_MGR
51{
52public:
53
58 // clang-format off
59 DEFINE_ENUM_VECTOR( SCH_FILE_T,
60 {
61 SCH_KICAD,
62 SCH_LEGACY,
63 SCH_ALTIUM,
64 SCH_CADSTAR_ARCHIVE,
65 SCH_DATABASE,
66 SCH_EAGLE,
67 SCH_EASYEDA,
68 SCH_EASYEDAPRO,
69 SCH_LTSPICE,
70 SCH_HTTP,
71
72 // Add your schematic type here.
73 SCH_FILE_UNKNOWN
74 } )
75 // clang-format on
76
87 static SCH_IO* FindPlugin( SCH_FILE_T aFileType );
88
92 static const wxString ShowType( SCH_FILE_T aFileType );
93
97 static SCH_FILE_T EnumFromStr( const wxString& aFileType );
98
102 static SCH_FILE_T GuessPluginTypeFromLibPath( const wxString& aLibPath, int aCtl = 0 );
103
107 static SCH_FILE_T GuessPluginTypeFromSchPath( const wxString& aSchematicPath, int aCtl = 0 );
108
112 static bool ConvertLibrary( std::map<std::string, UTF8>* aOldFileProps, const wxString& aOldFilePath,
113 const wxString& aNewFilepath );
114};
115
116#endif // _SCH_IO_MGR_H_
Definition: io_mgr.h:37
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:284
Define a library symbol object.
Definition: lib_symbol.h:78
A progress reporter interface for use in multi-threaded environments.
Holds all the data relating to one schematic.
Definition: schematic.h:77
A factory which returns an instance of a SCH_IO.
Definition: sch_io_mgr.h:51
static bool ConvertLibrary(std::map< std::string, UTF8 > *aOldFileProps, const wxString &aOldFilePath, const wxString &aNewFilepath)
Convert a schematic symbol library to the latest KiCad format.
Definition: sch_io_mgr.cpp:191
DEFINE_ENUM_VECTOR(SCH_FILE_T, { SCH_KICAD, SCH_LEGACY, SCH_ALTIUM, SCH_CADSTAR_ARCHIVE, SCH_DATABASE, SCH_EAGLE, SCH_EASYEDA, SCH_EASYEDAPRO, SCH_LTSPICE, SCH_HTTP, SCH_FILE_UNKNOWN }) APIEXPORT static SCH_IO *FindPlugin(SCH_FILE_T aFileType)
A set of file types that the SCH_IO_MGR knows about, and for which there has been a plugin written,...
static SCH_FILE_T EnumFromStr(const wxString &aFileType)
Return the #SCH_FILE_T from the corresponding plugin type name: "kicad", "legacy",...
Definition: sch_io_mgr.cpp:107
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
Definition: sch_io_mgr.cpp:83
static SCH_FILE_T GuessPluginTypeFromSchPath(const wxString &aSchematicPath, int aCtl=0)
Return a plugin type given a schematic using the file extension of aSchematicPath.
Definition: sch_io_mgr.cpp:165
static SCH_FILE_T GuessPluginTypeFromLibPath(const wxString &aLibPath, int aCtl=0)
Return a plugin type given a symbol library using the file extension of aLibPath.
Definition: sch_io_mgr.cpp:140
Base class that schematic file and library loading and saving plugins should derive from.
Definition: sch_io.h:57
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
Object used to load, save, search, and otherwise manipulate symbol library files.
Some functions to handle hotkeys in KiCad.
#define APIEXPORT
Macros which export functions from a DLL/DSO.
Definition: import_export.h:42