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.

81 lines
2.6 KiB

2 years ago
2 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-2021 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_EDIT_TOOL_H
  25. #define SYMBOL_EDITOR_EDIT_TOOL_H
  26. #include <tools/ee_tool_base.h>
  27. class SYMBOL_EDIT_FRAME;
  28. class SYMBOL_EDITOR_EDIT_TOOL : public EE_TOOL_BASE<SYMBOL_EDIT_FRAME>
  29. {
  30. public:
  31. SYMBOL_EDITOR_EDIT_TOOL();
  32. ~SYMBOL_EDITOR_EDIT_TOOL() override { }
  33. /// @copydoc TOOL_INTERACTIVE::Init()
  34. bool Init() override;
  35. int Rotate( const TOOL_EVENT& aEvent );
  36. int Mirror( const TOOL_EVENT& aEvent );
  37. int Duplicate( const TOOL_EVENT& aEvent );
  38. int Properties( const TOOL_EVENT& aEvent );
  39. int PinTable( const TOOL_EVENT& aEvent );
  40. int SetUnitDisplayName( const TOOL_EVENT& aEvent );
  41. int UpdateSymbolFields( const TOOL_EVENT& aEvent );
  42. int Undo( const TOOL_EVENT& aEvent );
  43. int Redo( const TOOL_EVENT& aEvent );
  44. int Cut( const TOOL_EVENT& aEvent );
  45. int Copy( const TOOL_EVENT& aEvent );
  46. int Paste( const TOOL_EVENT& aEvent );
  47. /**
  48. * Delete the selected items, or the item under the cursor.
  49. */
  50. int DoDelete( const TOOL_EVENT& aEvent );
  51. ///< Run the deletion tool.
  52. int InteractiveDelete( const TOOL_EVENT& aEvent );
  53. private:
  54. void editShapeProperties( SCH_SHAPE* aShape );
  55. void editTextProperties( SCH_ITEM* aItem );
  56. void editTextBoxProperties( SCH_ITEM* aItem );
  57. void editFieldProperties( SCH_FIELD* aField );
  58. void editSymbolProperties();
  59. void handlePinDuplication(SCH_PIN* aOldPin, SCH_PIN* aNewPin, int &aSymbolLastPinNumber );
  60. ///< Set up handlers for various events.
  61. void setTransitions() override;
  62. EDA_ITEM* m_pickerItem;
  63. };
  64. #endif // SYMBOL_EDITOR_EDIT_TOOL_H