KiCad PCB EDA Suite
cadstar_sch_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-2021 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_SCH_ARCHIVE_PLUGIN_H_
28#define CADSTAR_SCH_ARCHIVE_PLUGIN_H_
29
30
31#include <sch_io_mgr.h>
32#include <reporter.h>
33
34
35class SCH_SHEET;
36class SCH_SCREEN;
37
39{
40public:
41 const wxString GetName() const override;
42
43 void SetReporter( REPORTER* aReporter ) override { m_reporter = aReporter; }
44
45 void SetProgressReporter( PROGRESS_REPORTER* aReporter ) override
46 {
47 m_progressReporter = aReporter;
48 }
49
50 const wxString GetFileExtension() const override;
51
52 const wxString GetLibraryFileExtension() const override;
53
54 int GetModifyHash() const override;
55
56 SCH_SHEET* Load( const wxString& aFileName, SCHEMATIC* aSchematic,
57 SCH_SHEET* aAppendToMe = nullptr,
58 const PROPERTIES* aProperties = nullptr ) override;
59
60 bool CheckHeader( const wxString& aFileName ) override;
61
63 {
65 m_progressReporter = nullptr;
66 }
67
69 {
70 }
71
72private:
73 REPORTER* m_reporter; // current reporter for warnings/errors
74 PROGRESS_REPORTER* m_progressReporter; // optional; may be nullptr
75};
76
77#endif // CADSTAR_SCH_ARCHIVE_PLUGIN_H_
SCH_SHEET * Load(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const PROPERTIES *aProperties=nullptr) override
Load information from some input file format that this SCH_PLUGIN implementation knows about,...
bool CheckHeader(const wxString &aFileName) override
Return true if the first line in aFileName begins with the expected header.
const wxString GetLibraryFileExtension() const override
Return the library file extension for the SCH_PLUGIN object.
const wxString GetFileExtension() const override
Return the file extension for the SCH_PLUGIN.
void SetProgressReporter(PROGRESS_REPORTER *aReporter) override
Set an optional progress reporter.
void SetReporter(REPORTER *aReporter) override
Set an optional reporter for warnings/errors.
const wxString GetName() const override
Return a brief hard coded name for this SCH_PLUGIN.
int GetModifyHash() const override
Return the modification hash from the library cache.
A progress reporter interface for use in multi-threaded environments.
A name/value tuple with unique names and optional values.
Definition: properties.h:34
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
Holds all the data relating to one schematic.
Definition: schematic.h:60
Base class that schematic file and library loading and saving plugins should derive from.
Definition: sch_io_mgr.h:153
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:55
static REPORTER & GetInstance()
Definition: reporter.cpp:175