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.

151 lines
4.6 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2013 CERN
  5. * @author Maciej Suminski <maciej.suminski@cern.ch>
  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. #include <tool/tool_action.h>
  25. /**
  26. * Class COMMON_ACTIONS
  27. *
  28. * Gathers all the actions that are shared by tools. The instance of COMMON_ACTION is created
  29. * inside of ACTION_MANAGER object that registers the actions.
  30. */
  31. class COMMON_ACTIONS
  32. {
  33. public:
  34. // Selection Tool
  35. /// Activation of the selection tool
  36. static TOOL_ACTION selectionActivate;
  37. /// Select a single item under the cursor position
  38. static TOOL_ACTION selectionSingle;
  39. /// Clears the current selection
  40. static TOOL_ACTION selectionClear;
  41. // Edit Tool
  42. /// Activation of the edit tool
  43. static TOOL_ACTION editActivate;
  44. /// Rotation of selected objects
  45. static TOOL_ACTION rotate;
  46. /// Flipping of selected objects
  47. static TOOL_ACTION flip;
  48. /// Activation of the edit tool
  49. static TOOL_ACTION properties;
  50. /// Deleting a BOARD_ITEM
  51. static TOOL_ACTION remove;
  52. // Drawing Tool
  53. /// Activation of the drawing tool (line)
  54. static TOOL_ACTION drawLine;
  55. /// Activation of the drawing tool (circle)
  56. static TOOL_ACTION drawCircle;
  57. /// Activation of the drawing tool (arc)
  58. static TOOL_ACTION drawArc;
  59. /// Activation of the drawing tool (text)
  60. static TOOL_ACTION drawText;
  61. /// Activation of the drawing tool (dimension)
  62. static TOOL_ACTION drawDimension;
  63. /// Activation of the drawing tool (drawing a ZONE)
  64. static TOOL_ACTION drawZone;
  65. /// Activation of the drawing tool (drawing a keepout area)
  66. static TOOL_ACTION drawKeepout;
  67. /// Activation of the drawing tool (placing a TARGET)
  68. static TOOL_ACTION placeTarget;
  69. /// Activation of the drawing tool (placing a MODULE)
  70. static TOOL_ACTION placeModule;
  71. // Push and Shove Router Tool
  72. /// Activation of the Push and Shove router
  73. static TOOL_ACTION routerActivate;
  74. // Point Editor
  75. /// Update edit points
  76. static TOOL_ACTION pointEditorUpdate;
  77. // View controls
  78. static TOOL_ACTION zoomIn;
  79. static TOOL_ACTION zoomOut;
  80. static TOOL_ACTION zoomCenter;
  81. static TOOL_ACTION zoomFitScreen;
  82. // Display modes
  83. static TOOL_ACTION trackDisplayMode;
  84. static TOOL_ACTION padDisplayMode;
  85. static TOOL_ACTION viaDisplayMode;
  86. static TOOL_ACTION highContrastMode;
  87. static TOOL_ACTION highContrastInc;
  88. static TOOL_ACTION highContrastDec;
  89. // Layer control
  90. static TOOL_ACTION layerTop;
  91. static TOOL_ACTION layerInner1;
  92. static TOOL_ACTION layerInner2;
  93. static TOOL_ACTION layerInner3;
  94. static TOOL_ACTION layerInner4;
  95. static TOOL_ACTION layerInner5;
  96. static TOOL_ACTION layerInner6;
  97. static TOOL_ACTION layerBottom;
  98. static TOOL_ACTION layerNext;
  99. static TOOL_ACTION layerPrev;
  100. static TOOL_ACTION layerAlphaInc;
  101. static TOOL_ACTION layerAlphaDec;
  102. // Grid control
  103. static TOOL_ACTION gridFast1;
  104. static TOOL_ACTION gridFast2;
  105. static TOOL_ACTION gridNext;
  106. static TOOL_ACTION gridPrev;
  107. // Track & via size control
  108. static TOOL_ACTION trackWidthInc;
  109. static TOOL_ACTION trackWidthDec;
  110. static TOOL_ACTION viaSizeInc;
  111. static TOOL_ACTION viaSizeDec;
  112. // Miscellaneous
  113. static TOOL_ACTION resetCoords;
  114. static TOOL_ACTION switchUnits;
  115. static TOOL_ACTION showHelp;
  116. /**
  117. * Function TranslateLegacyId()
  118. * Translates legacy tool ids to the corresponding TOOL_ACTION name.
  119. * @param aId is legacy tool id to be translated.
  120. * @return std::string is name of the corresponding TOOL_ACTION. It may be empty, if there is
  121. * no corresponding TOOL_ACTION.
  122. */
  123. static std::string TranslateLegacyId( int aId );
  124. };