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.

98 lines
3.3 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2014 CERN
  5. * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * @author Maciej Suminski <maciej.suminski@cern.ch>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2
  12. * of the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, you may find one here:
  21. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  22. * or you may search the http://www.gnu.org website for the version 2 license,
  23. * or you may write to the Free Software Foundation, Inc.,
  24. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  25. */
  26. #ifndef FOOTPRINT_EDITOR_CONTROL_H
  27. #define FOOTPRINT_EDITOR_CONTROL_H
  28. #include <tools/pcb_tool_base.h>
  29. class FOOTPRINT_EDIT_FRAME;
  30. class DIALOG_FOOTPRINT_CHECKER;
  31. /**
  32. * Module editor specific tools.
  33. */
  34. class FOOTPRINT_EDITOR_CONTROL : public PCB_TOOL_BASE
  35. {
  36. public:
  37. FOOTPRINT_EDITOR_CONTROL();
  38. ~FOOTPRINT_EDITOR_CONTROL() override;
  39. /// @copydoc TOOL_INTERACTIVE::Reset()
  40. void Reset( RESET_REASON aReason ) override;
  41. /// @copydoc TOOL_INTERACTIVE::Init()
  42. bool Init() override;
  43. int NewFootprint( const TOOL_EVENT& aEvent );
  44. int CreateFootprint( const TOOL_EVENT& aEvent );
  45. int Save( const TOOL_EVENT& aEvent );
  46. int SaveAs( const TOOL_EVENT& aEvent );
  47. int Revert( const TOOL_EVENT& aEvent );
  48. int EditFootprint( const TOOL_EVENT& aEvent );
  49. int CutCopyFootprint( const TOOL_EVENT& aEvent );
  50. int PasteFootprint( const TOOL_EVENT& aEvent );
  51. int DuplicateFootprint( const TOOL_EVENT& aEvent );
  52. int RenameFootprint( const TOOL_EVENT& aEvent );
  53. int DeleteFootprint( const TOOL_EVENT& aEvent );
  54. int ImportFootprint( const TOOL_EVENT& aEvent );
  55. int ExportFootprint( const TOOL_EVENT& aEvent );
  56. int PinLibrary( const TOOL_EVENT& aEvent );
  57. int UnpinLibrary( const TOOL_EVENT& aEvent );
  58. int ToggleFootprintTree( const TOOL_EVENT& aEvent );
  59. int ToggleLayersManager( const TOOL_EVENT& aEvent );
  60. int Properties( const TOOL_EVENT& aEvent );
  61. int EditTextAndGraphics( const TOOL_EVENT& aEvent );
  62. int CheckFootprint( const TOOL_EVENT& aEvent );
  63. void CrossProbe( const PCB_MARKER* aMarker );
  64. void DestroyCheckerDialog();
  65. int CleanupGraphics( const TOOL_EVENT& aEvent );
  66. int RepairFootprint( const TOOL_EVENT& aEvent );
  67. /**
  68. * Edit the properties used for new pad creation.
  69. */
  70. int DefaultPadProperties( const TOOL_EVENT& aEvent );
  71. private:
  72. ///< Set up handlers for various events.
  73. void setTransitions() override;
  74. FOOTPRINT_EDIT_FRAME* m_frame;
  75. DIALOG_FOOTPRINT_CHECKER* m_checkerDialog;
  76. // A private clipboard for cut/copy/past of an entire footprint
  77. std::unique_ptr<FOOTPRINT> m_copiedFootprint;
  78. };
  79. #endif // FOOTPRINT_EDITOR_CONTROL_H