KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_io_easyeda_plugin.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) 2023 Alex Shvartzkop <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef PCB_IO_EASYEDA_PLUGIN_H_
22#define PCB_IO_EASYEDA_PLUGIN_H_
23
24#include <pcb_io/pcb_io.h>
25#include <pcb_io/pcb_io_mgr.h>
26
27class FOOTPRINT;
28
29class PCB_IO_EASYEDA : public PCB_IO
30{
31public:
33 {
34 return IO_BASE::IO_FILE_DESC( _HKI( "EasyEDA (JLCEDA) Std files" ), { "json", "zip" } );
35 }
36
37 const IO_BASE::IO_FILE_DESC GetLibraryFileDesc() const override { return GetBoardFileDesc(); }
38
39 const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override { return GetBoardFileDesc(); }
40
41 bool CanReadBoard( const wxString& aFileName ) const override;
42
43 bool CanReadFootprint( const wxString& aFileName ) const override;
44
45 bool CanReadLibrary( const wxString& aFileName ) const override;
46
47 BOARD* LoadBoard( const wxString& aFileName, BOARD* aAppendToMe,
48 const std::map<std::string, UTF8>* aProperties = nullptr, PROJECT* aProject = nullptr ) override;
49
50 long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override;
51
52 void FootprintEnumerate( wxArrayString& aFootprintNames, const wxString& aLibraryPath,
53 bool aBestEfforts,
54 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
55
56 std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
57
58 FOOTPRINT* FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
59 bool aKeepUUID = false,
60 const std::map<std::string, UTF8>* aProperties = nullptr ) override;
61
62 bool IsLibraryWritable( const wxString& aLibraryPath ) override { return false; }
63
66
67private:
68
69 std::map<wxString, std::unique_ptr<FOOTPRINT>> m_loadedFootprints;
70};
71
72
73#endif // PCB_IO_EASYEDA_PLUGIN_H_
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
bool CanReadBoard(const wxString &aFileName) const override
Checks if this PCB_IO can read the specified board file.
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
FOOTPRINT * FootprintLoad(const wxString &aLibraryPath, const wxString &aFootprintName, bool aKeepUUID=false, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a footprint having aFootprintName from the aLibraryPath containing a library format that this PC...
const IO_BASE::IO_FILE_DESC GetLibraryFileDesc() const override
Get the descriptor for the individual library elements that this IO plugin operates on.
const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override
Get the descriptor for the library container that this IO plugin operates on.
void FootprintEnumerate(wxArrayString &aFootprintNames, const wxString &aLibraryPath, bool aBestEfforts, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Return a list of footprint names contained within the library at aLibraryPath.
std::map< wxString, std::unique_ptr< FOOTPRINT > > m_loadedFootprints
const IO_BASE::IO_FILE_DESC GetBoardFileDesc() const override
Returns board file description for the PCB_IO.
std::vector< FOOTPRINT * > GetImportedCachedLibraryFootprints() override
Return a container with the cached library footprints generated in the last call to Load.
long long GetLibraryTimestamp(const wxString &aLibraryPath) const override
Generate a timestamp representing all the files in the library (including the library directory).
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
bool CanReadFootprint(const wxString &aFileName) const override
Checks if this PCB_IO can read a footprint from specified file or directory.
PCB_IO(const wxString &aName)
Definition pcb_io.h:342
Container for project specific data.
Definition project.h:62
#define _HKI(x)
Definition page_info.cpp:40
Container that describes file type info.
Definition io_base.h:43