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.

113 lines
3.2 KiB

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 Ian McInerney <Ian.S.McInerney@ieee.org>
  5. * Copyright (C) 2019 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_CONTROL_H_
  21. #define CVPCB_CONTROL_H_
  22. #include <tool/tool_interactive.h>
  23. #include <cvpcb_mainframe.h>
  24. /**
  25. * CVPCB_CONTROL
  26. *
  27. * Handles actions in main cvpcb window.
  28. */
  29. class CVPCB_CONTROL : public TOOL_INTERACTIVE
  30. {
  31. public:
  32. CVPCB_CONTROL();
  33. ~CVPCB_CONTROL() {}
  34. /// @copydoc TOOL_INTERACTIVE::Reset()
  35. void Reset( RESET_REASON aReason ) override;
  36. /**
  37. * Main processing loop for the CVPCB window. This function will constantly loop and
  38. * to process various actions taken in the window.
  39. *
  40. * @param aEvent is the event generated by the tool framework
  41. */
  42. int Main( const TOOL_EVENT& aEvent );
  43. /**
  44. * Rotate focus in the CVPCB window
  45. *
  46. * @param aEvent is the event generated by the tool framework
  47. */
  48. int ChangeFocus( const TOOL_EVENT& aEvent );
  49. /**
  50. * Move the selected component to the not associated one in the specified direction.
  51. *
  52. * @param aEvent is the event generated by the tool framework
  53. */
  54. int ToNA( const TOOL_EVENT& aEvent );
  55. /**
  56. * Show the dialog to modify the included footprint association files (.equ)
  57. *
  58. * @param aEvent is the event generated by the tool framework
  59. */
  60. int ShowEquFileTable( const TOOL_EVENT& aEvent );
  61. /**
  62. * Save the associations to the schematic.
  63. *
  64. * @param aEvent is the event generated by the tool framework
  65. */
  66. int SaveAssociations( const TOOL_EVENT& aEvent );
  67. /**
  68. * Create or Update the frame showing the current highlighted footprint
  69. * and (if showed) the 3D display frame.
  70. *
  71. * @param aEvent is the event generated by the tool framework
  72. */
  73. int ShowFootprintViewer( const TOOL_EVENT& aEvent );
  74. /**
  75. * Filter the footprint list by toggling the given filter type.
  76. * The event parameter corresponds to the filter type (using the FP_FILTER_T from the
  77. * FOOTPRINTS_LISTBOX class)
  78. *
  79. * @param aEvent is the event generated by the tool framework
  80. */
  81. int ToggleFootprintFilter( const TOOL_EVENT& aEvent );
  82. /**
  83. * Update the menu to reflect the current tool states.
  84. *
  85. * @param aEvent is the event generated by the tool framework
  86. */
  87. int UpdateMenu( const TOOL_EVENT& aEvent );
  88. /*
  89. * Sets up handlers for various events.
  90. */
  91. void setTransitions() override;
  92. private:
  93. CVPCB_MAINFRAME* m_frame;
  94. };
  95. #endif