You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.6 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2019 CERN
  5. * Copyright (C) 2019-2020 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, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. #ifndef SYMBOL_EDITOR_CONTROL_H
  25. #define SYMBOL_EDITOR_CONTROL_H
  26. #include <sch_base_frame.h>
  27. #include <tools/ee_tool_base.h>
  28. class SYMBOL_EDIT_FRAME;
  29. /**
  30. * Handle actions for the various symbol editor and viewers.
  31. */
  32. class SYMBOL_EDITOR_CONTROL : public wxEvtHandler, public EE_TOOL_BASE<SCH_BASE_FRAME>
  33. {
  34. public:
  35. SYMBOL_EDITOR_CONTROL() :
  36. EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.SymbolLibraryControl" )
  37. { }
  38. virtual ~SYMBOL_EDITOR_CONTROL() { }
  39. /// @copydoc TOOL_INTERACTIVE::Init()
  40. bool Init() override;
  41. int AddLibrary( const TOOL_EVENT& aEvent );
  42. int AddSymbol( const TOOL_EVENT& aEvent );
  43. int EditSymbol( const TOOL_EVENT& aEvent );
  44. int Save( const TOOL_EVENT& aEvt );
  45. int Revert( const TOOL_EVENT& aEvent );
  46. int CutCopyDelete( const TOOL_EVENT& aEvent );
  47. int DuplicateSymbol( const TOOL_EVENT& aEvent );
  48. int ExportSymbol( const TOOL_EVENT& aEvent );
  49. int ExportView( const TOOL_EVENT& aEvent );
  50. int ExportSymbolAsSVG( const TOOL_EVENT& aEvent );
  51. int AddSymbolToSchematic( const TOOL_EVENT& aEvent );
  52. int UpdateSymbolInSchematic( const TOOL_EVENT& aEvent );
  53. int OnDeMorgan( const TOOL_EVENT& aEvent );
  54. int ShowElectricalTypes( const TOOL_EVENT& aEvent );
  55. int PinLibrary( const TOOL_EVENT& aEvent );
  56. int UnpinLibrary( const TOOL_EVENT& aEvent );
  57. int ShowComponentTree( const TOOL_EVENT& aEvent );
  58. int ToggleSyncedPinsMode( const TOOL_EVENT& aEvent );
  59. private:
  60. ///> Sets up handlers for various events.
  61. void setTransitions() override;
  62. };
  63. #endif // SYMBOL_EDITOR_CONTROL_H