KiCad PCB EDA Suite
cadstar_pcb_archive_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) 2020 Roberto Fernandez Bautista <[email protected]>
5 * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
27#ifndef CADSTAR_ARCHIVE_PLUGIN_H_
28#define CADSTAR_ARCHIVE_PLUGIN_H_
29
30
31#include <io_mgr.h>
32#include <layer_ids.h> // PCB_LAYER_ID
34
35
37{
38public:
39 const wxString PluginName() const override;
40
41 BOARD* Load( const wxString& aFileName, BOARD* aAppendToMe,
42 const STRING_UTF8_MAP* aProperties = nullptr, PROJECT* aProject = nullptr,
43 PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
44
45 const wxString GetFileExtension() const override;
46
47 long long GetLibraryTimestamp( const wxString& aLibraryPath ) const override
48 {
49 // No support for libraries....
50 return 0;
51 }
52
53 std::vector<FOOTPRINT*> GetImportedCachedLibraryFootprints() override;
54
61 static std::map<wxString, PCB_LAYER_ID> DefaultLayerMappingCallback(
62 const std::vector<INPUT_LAYER_DESC>& aInputLayerDescriptionVector );
63
69 void RegisterLayerMappingCallback( LAYER_MAPPING_HANDLER aLayerMappingHandler ) override;
70
73
74private:
76
79 std::vector<FOOTPRINT*> m_loaded_footprints;
81};
82
83#endif // CADSTAR_ARCHIVE_PLUGIN_H_
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:269
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).
const wxString GetFileExtension() const override
Returns the file extension for the PLUGIN.
const wxString PluginName() const override
Return a brief hard coded name for this PLUGIN.
static std::map< wxString, PCB_LAYER_ID > DefaultLayerMappingCallback(const std::vector< INPUT_LAYER_DESC > &aInputLayerDescriptionVector)
Return the automapped layers.
void RegisterLayerMappingCallback(LAYER_MAPPING_HANDLER aLayerMappingHandler) override
Register a different handler to be called when mapping of Cadstar to KiCad layers occurs.
std::vector< FOOTPRINT * > m_loaded_footprints
BOARD * Load(const wxString &aFileName, BOARD *aAppendToMe, const STRING_UTF8_MAP *aProperties=nullptr, PROJECT *aProject=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override
Load information from some input file format that this PLUGIN implementation knows about into either ...
Plugin class for import plugins that support remappable layers.
A base class that BOARD loading and saving plugins should derive from.
Definition: io_mgr.h:270
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
Definition: project.h:64
A name/value tuple with unique names and optional values.
std::function< std::map< wxString, PCB_LAYER_ID >(const std::vector< INPUT_LAYER_DESC > &)> LAYER_MAPPING_HANDLER
Pointer to a function that takes a map of source and KiCad layers and returns a re-mapped version.