kicad/pcbnew/plugin.cpp

111 lines
3.9 KiB
C++
Raw Normal View History

/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2011-2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
2013-09-21 07:30:23 +00:00
#include <io_mgr.h>
#define FMT_UNIMPLEMENTED _( "Plugin '%s' does not implement the '%s' function." )
/**
* Function not_implemented
* throws an IO_ERROR and complains of an API function not being implemented.
*
* @param aPlugin is a PLUGIN instance
* @param aCaller is the name of the unimplemented API function.
*/
static void not_implemented( PLUGIN* aPlugin, const char* aCaller )
{
THROW_IO_ERROR( wxString::Format( FMT_UNIMPLEMENTED,
aPlugin->PluginName().GetData(),
wxString::FromUTF8( aCaller ).GetData() )
);
}
2013-09-21 07:30:23 +00:00
BOARD* PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe, const PROPERTIES* aProperties )
2013-09-21 07:30:23 +00:00
{
not_implemented( this, __FUNCTION__ );
return NULL;
2013-09-21 07:30:23 +00:00
}
void PLUGIN::Save( const wxString& aFileName, BOARD* aBoard, const PROPERTIES* aProperties )
2013-09-21 07:30:23 +00:00
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ );
2013-09-21 07:30:23 +00:00
}
wxArrayString PLUGIN::FootprintEnumerate( const wxString& aLibraryPath, const PROPERTIES* aProperties )
2013-09-21 07:30:23 +00:00
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ );
return wxArrayString();
2013-09-21 07:30:23 +00:00
}
MODULE* PLUGIN::FootprintLoad( const wxString& aLibraryPath, const wxString& aFootprintName,
const PROPERTIES* aProperties )
2013-09-21 07:30:23 +00:00
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ );
return NULL;
2013-09-21 07:30:23 +00:00
}
void PLUGIN::FootprintSave( const wxString& aLibraryPath, const MODULE* aFootprint, const PROPERTIES* aProperties )
2013-09-21 07:30:23 +00:00
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ );
2013-09-21 07:30:23 +00:00
}
void PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxString& aFootprintName, const PROPERTIES* aProperties )
2013-09-21 07:30:23 +00:00
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ );
2013-09-21 07:30:23 +00:00
}
void PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, const PROPERTIES* aProperties )
2013-09-21 07:30:23 +00:00
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ );
2013-09-21 07:30:23 +00:00
}
bool PLUGIN::FootprintLibDelete( const wxString& aLibraryPath, const PROPERTIES* aProperties )
2013-09-21 07:30:23 +00:00
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ );
return false;
2013-09-21 07:30:23 +00:00
}
bool PLUGIN::IsFootprintLibWritable( const wxString& aLibraryPath )
{
// not pure virtual so that plugins only have to implement subset of the PLUGIN interface.
not_implemented( this, __FUNCTION__ );
return false;
2013-09-21 07:30:23 +00:00
}