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.

79 lines
2.5 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, you may find one here:
  18. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  19. * or you may search the http://www.gnu.org website for the version 2 license,
  20. * or you may write to the Free Software Foundation, Inc.,
  21. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  22. */
  23. #ifndef GLOBAL_EDIT_TOOL_H
  24. #define GLOBAL_EDIT_TOOL_H
  25. #include <math/vector2d.h>
  26. #include <tools/pcb_tool_base.h>
  27. #include <tools/pcb_selection_tool.h>
  28. #include <status_popup.h>
  29. class BOARD_COMMIT;
  30. class BOARD_ITEM;
  31. class CONNECTIVITY_DATA;
  32. class GLOBAL_EDIT_TOOL : public PCB_TOOL_BASE
  33. {
  34. public:
  35. GLOBAL_EDIT_TOOL();
  36. /// @copydoc TOOL_INTERACTIVE::Reset()
  37. void Reset( RESET_REASON aReason ) override;
  38. /// @copydoc TOOL_INTERACTIVE::Init()
  39. bool Init() override;
  40. /**
  41. * Invoke the dialog used to update or exchange the footprint definitions used for
  42. * footprints.
  43. *
  44. * The mode depends on the #PCB_ACTIONS held by the #TOOL_EVENT.
  45. */
  46. int ExchangeFootprints( const TOOL_EVENT& aEvent );
  47. int SwapLayers( const TOOL_EVENT& aEvent );
  48. int EditTracksAndVias( const TOOL_EVENT& aEvent );
  49. int EditTextAndGraphics( const TOOL_EVENT& aEvent );
  50. int EditTeardrops( const TOOL_EVENT& aEvent );
  51. int GlobalDeletions( const TOOL_EVENT& aEvent );
  52. int CleanupTracksAndVias( const TOOL_EVENT& aEvent );
  53. int CleanupGraphics( const TOOL_EVENT& aEvent );
  54. int RemoveUnusedPads( const TOOL_EVENT& aEvent );
  55. int ZonesManager( const TOOL_EVENT& aEvent );
  56. private:
  57. bool swapBoardItem( BOARD_ITEM* aItem, std::map<PCB_LAYER_ID, PCB_LAYER_ID>& aLayerMap );
  58. ///< Set up handlers for various events.
  59. void setTransitions() override;
  60. private:
  61. PCB_SELECTION_TOOL* m_selectionTool;
  62. std::unique_ptr<BOARD_COMMIT> m_commit;
  63. };
  64. #endif