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.

114 lines
3.1 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2019 Ian McInerney <Ian.S.McInerney@ieee.org>
  5. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software: you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation, either version 3 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef CVPCB_ASSOCIATION_TOOL_H_
  21. #define CVPCB_ASSOCIATION_TOOL_H_
  22. #include <tool/tool_interactive.h>
  23. #include <cvpcb_mainframe.h>
  24. /**
  25. * Handles action in main CvPcb window.
  26. */
  27. class CVPCB_ASSOCIATION_TOOL : public TOOL_INTERACTIVE
  28. {
  29. public:
  30. CVPCB_ASSOCIATION_TOOL();
  31. ~CVPCB_ASSOCIATION_TOOL() {}
  32. /// @copydoc TOOL_INTERACTIVE::Reset()
  33. void Reset( RESET_REASON aReason ) override;
  34. /**
  35. * Undo the footprint associations most recently done.
  36. *
  37. * @param aEvent is the event generated by the tool framework.
  38. */
  39. int Undo( const TOOL_EVENT& aEvent );
  40. /**
  41. * Redo the footprint associations most recently done.
  42. *
  43. * @param aEvent is the event generated by the tool framework.
  44. */
  45. int Redo( const TOOL_EVENT& aEvent );
  46. /**
  47. * Associate the selected footprint with the currently selected components.
  48. *
  49. * @param aEvent is the event generated by the tool framework.
  50. */
  51. int Associate( const TOOL_EVENT& aEvent );
  52. /**
  53. * Perform automatic footprint association.
  54. *
  55. * @param aEvent is the event generated by the tool framework.
  56. */
  57. int AutoAssociate( const TOOL_EVENT& aEvent );
  58. /**
  59. * Delete all associations.
  60. *
  61. * @param aEvent is the event generated by the tool framework.
  62. */
  63. int DeleteAll( const TOOL_EVENT& aEvent );
  64. /**
  65. * Delete the selected associations.
  66. *
  67. * @param aEvent is the event generated by the tool framework.
  68. */
  69. int DeleteAssoc( const TOOL_EVENT& aEvent );
  70. /**
  71. * Copy the selected associations to the clipboard.
  72. *
  73. * @param aEvent is the event generated by the tool framework.
  74. */
  75. int CopyAssoc( const TOOL_EVENT& aEvent );
  76. /**
  77. * Cut the selected associations to the clipboard.
  78. *
  79. * @param aEvent is the event generated by the tool framework.
  80. */
  81. int CutAssoc( const TOOL_EVENT& aEvent );
  82. /**
  83. * Paste the clipboard onto the current selection.
  84. *
  85. * @param aEvent is the event generated by the tool framework.
  86. */
  87. int PasteAssoc( const TOOL_EVENT& aEvent );
  88. /**
  89. * Set up handlers for various events.
  90. */
  91. void setTransitions() override;
  92. private:
  93. CVPCB_MAINFRAME* m_frame;
  94. };
  95. #endif