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;
44class STRING_UTF8_MAP;
46
47
51class SCH_IO_MGR : public IO_MGR
52{
53public:
54
59 // clang-format off
60 DEFINE_ENUM_VECTOR( SCH_FILE_T,
61 {
62 SCH_KICAD,
63 SCH_LEGACY,
64 SCH_ALTIUM,
65 SCH_CADSTAR_ARCHIVE,
66 SCH_DATABASE,
67 SCH_EAGLE,
68 SCH_EASYEDA,
69 SCH_EASYEDAPRO,
70 SCH_LTSPICE,
71 SCH_HTTP,
72
73 // Add your schematic type here.
74 SCH_FILE_UNKNOWN
75 } )
76 // clang-format on
77
88 static SCH_IO* FindPlugin( SCH_FILE_T aFileType );
89
93 static const wxString ShowType( SCH_FILE_T aFileType );
94
98 static SCH_FILE_T EnumFromStr( const wxString& aFileType );
99
103 static SCH_FILE_T GuessPluginTypeFromLibPath( const wxString& aLibPath, int aCtl = 0 );
104
108 static SCH_FILE_T GuessPluginTypeFromSchPath( const wxString& aSchematicPath, int aCtl = 0 );
109
113 static bool ConvertLibrary( STRING_UTF8_MAP* aOldFileProps, const wxString& aOldFilePath,
114 const wxString& aNewFilepath );
115};
116
117#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:279
Define a library symbol object.
Definition: lib_symbol.h:99
A progress reporter interface for use in multi-threaded environments.
Holds all the data relating to one schematic.
Definition: schematic.h:75
A factory which returns an instance of a SCH_IO.
Definition: sch_io_mgr.h:52
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 bool ConvertLibrary(STRING_UTF8_MAP *aOldFileProps, const wxString &aOldFilePath, const wxString &aNewFilepath)
Convert a schematic symbol library to the latest KiCad format.
Definition: sch_io_mgr.cpp:191
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
A name/value tuple with unique names and optional values.
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