KiCad PCB EDA Suite
actions.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2013-2016 CERN
5  * Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #ifndef __ACTIONS_H
27 #define __ACTIONS_H
28 
29 #include <tool/tool_action.h>
30 #include <core/optional.h>
31 
32 class TOOL_EVENT;
33 class TOOL_MANAGER;
34 
35 #define LEGACY_HK_NAME( x ) x
36 
43 class ACTIONS
44 {
45 public:
46 
47  virtual ~ACTIONS() {};
48 
49  // Generic document actions
50  static TOOL_ACTION doNew; // sadly 'new' is a reserved word
53  static TOOL_ACTION open;
54  static TOOL_ACTION save;
61  static TOOL_ACTION plot;
62  static TOOL_ACTION quit;
63 
64  // Generic edit actions
67  static TOOL_ACTION undo;
68  static TOOL_ACTION redo;
69  static TOOL_ACTION cut;
70  static TOOL_ACTION copy;
75  static TOOL_ACTION doDelete; // sadly 'delete' is a reserved word
77 
78  // Find and Replace
79  static TOOL_ACTION find;
86 
87  // RC Lists
91 
92  // View controls
100  static TOOL_ACTION zoomFitObjects; // Zooms to bbox of items on screen (except page border)
108 
109  static TOOL_ACTION refreshPreview; // Similar to a synthetic mouseMoved event, but also
110  // used after a rotate, mirror, etc.
111 
114 
120 
125 
128 
129  // Panning with keyboard
134 
135  // Grid control
145 
146  // Units
154 
155  // Common Tools
159 
160  // Misc
170 
171  // Internal
175 
176  // Suite
185 
193  virtual OPT<TOOL_EVENT> TranslateLegacyId( int aId ) = 0;
194 
198  CURSOR_FAST_MOVE = 0x8000 };
199 
201  enum class REMOVE_FLAGS { NORMAL = 0x00, ALT = 0x01, CUT = 0x02 };
202 };
203 
204 
208 class EVENTS
209 {
210 public:
211  const static TOOL_EVENT SelectedEvent;
213  const static TOOL_EVENT ClearedEvent;
214 
217 
220 
224 };
225 
226 #endif // __ACTIONS_H
227 
228 
static TOOL_ACTION listHotKeys
Definition: actions.h:182
static TOOL_ACTION pinLibrary
Definition: actions.h:112
static TOOL_ACTION show3DViewer
Definition: actions.h:161
static const TOOL_EVENT SelectedEvent
Definition: actions.h:211
static TOOL_ACTION zoomPreset
Definition: actions.h:101
static TOOL_ACTION findAndReplace
Definition: actions.h:80
static TOOL_ACTION zoomInCenter
Definition: actions.h:96
static TOOL_ACTION activatePointEditor
Definition: actions.h:173
virtual ~ACTIONS()
Definition: actions.h:47
static TOOL_ACTION pageSettings
Definition: actions.h:59
REMOVE_FLAGS
Definition: actions.h:201
static const TOOL_EVENT UnselectedEvent
Definition: actions.h:212
static TOOL_ACTION doDelete
Definition: actions.h:75
virtual OPT< TOOL_EVENT > TranslateLegacyId(int aId)=0
Translate legacy tool ids to the corresponding TOOL_ACTION name.
static TOOL_ACTION zoomTool
Definition: actions.h:102
static TOOL_ACTION gridResetOrigin
Definition: actions.h:141
static TOOL_ACTION changeEditMethod
Definition: actions.h:174
static TOOL_ACTION replaceAll
Definition: actions.h:84
static TOOL_ACTION cancelInteractive
Definition: actions.h:65
static TOOL_ACTION nextMarker
Definition: actions.h:89
static TOOL_ACTION cursorRight
Definition: actions.h:119
static TOOL_ACTION zoomFitScreen
Definition: actions.h:99
static TOOL_ACTION millimetersUnits
Definition: actions.h:149
static TOOL_ACTION reportBug
Definition: actions.h:184
static TOOL_ACTION showSymbolLibTable
Definition: actions.h:178
static TOOL_ACTION standardGraphics
Definition: actions.h:169
static TOOL_ACTION cursorRightFast
Definition: actions.h:124
static TOOL_ACTION gridFast1
Definition: actions.h:136
static TOOL_ACTION unpinLibrary
Definition: actions.h:113
static TOOL_ACTION updatePcbFromSchematic
Definition: actions.h:166
static TOOL_ACTION zoomFitObjects
Definition: actions.h:100
static TOOL_ACTION print
Definition: actions.h:60
static TOOL_ACTION excludeMarker
Definition: actions.h:90
static TOOL_ACTION panLeft
Definition: actions.h:132
static TOOL_ACTION find
Definition: actions.h:79
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition: actions.h:216
static TOOL_ACTION zoomOutCenter
Definition: actions.h:97
static TOOL_ACTION saveCopyAs
Definition: actions.h:56
static TOOL_ACTION pickerTool
Definition: actions.h:158
static TOOL_ACTION updateFind
Definition: actions.h:85
Master controller class:
Definition: tool_manager.h:52
static TOOL_ACTION measureTool
Definition: actions.h:157
static TOOL_ACTION copy
Definition: actions.h:70
static TOOL_ACTION centerContents
Definition: actions.h:103
static TOOL_ACTION updateSchematicFromPcb
Definition: actions.h:167
static TOOL_ACTION gridFast2
Definition: actions.h:137
static TOOL_ACTION toggleCursor
Definition: actions.h:104
static TOOL_ACTION gridPreset
Definition: actions.h:142
static TOOL_ACTION showFootprintLibTable
Definition: actions.h:179
static TOOL_ACTION gridPrev
Definition: actions.h:139
static TOOL_ACTION panDown
Definition: actions.h:131
Gather all the events that are shared by tools.
Definition: actions.h:208
static TOOL_ACTION toggleGrid
Definition: actions.h:143
static TOOL_ACTION open
Definition: actions.h:53
static TOOL_ACTION showFootprintBrowser
Definition: actions.h:164
static TOOL_ACTION inchesUnits
Definition: actions.h:147
static TOOL_ACTION save
Definition: actions.h:54
static TOOL_ACTION doNew
Definition: actions.h:47
Generic, UI-independent tool event.
Definition: tool_event.h:170
static TOOL_ACTION cursorUpFast
Definition: actions.h:121
static TOOL_ACTION cursorDownFast
Definition: actions.h:122
static TOOL_ACTION cursorLeft
Definition: actions.h:118
static TOOL_ACTION panRight
Definition: actions.h:133
static TOOL_ACTION togglePolarCoords
Definition: actions.h:152
static TOOL_ACTION cut
Definition: actions.h:69
static const TOOL_EVENT UninhibitSelectionEditing
Definition: actions.h:223
static TOOL_ACTION addLibrary
Definition: actions.h:52
static TOOL_ACTION quit
Definition: actions.h:62
static const TOOL_EVENT ClearedEvent
Selected item had a property changed (except movement)
Definition: actions.h:213
static TOOL_ACTION replaceAndFindNext
Definition: actions.h:83
static TOOL_ACTION plot
Definition: actions.h:61
static const TOOL_EVENT SelectedItemsMoved
Used to inform tools that the selection should temporarily be non-editable.
Definition: actions.h:219
static TOOL_ACTION cursorLeftFast
Definition: actions.h:123
static TOOL_ACTION updateMenu
Definition: actions.h:172
static TOOL_ACTION newLibrary
Definition: actions.h:51
static TOOL_ACTION milsUnits
Definition: actions.h:148
static TOOL_ACTION prevMarker
Definition: actions.h:88
static TOOL_ACTION pasteSpecial
Definition: actions.h:72
static TOOL_ACTION findNextMarker
Definition: actions.h:82
static TOOL_ACTION redo
Definition: actions.h:68
static TOOL_ACTION updateUnits
Definition: actions.h:150
static TOOL_ACTION showSymbolEditor
Definition: actions.h:163
static TOOL_ACTION zoomCenter
Definition: actions.h:98
static TOOL_ACTION saveAs
Definition: actions.h:55
static TOOL_ACTION cursorUp
Cursor control with keyboard.
Definition: actions.h:116
static TOOL_ACTION zoomRedraw
Definition: actions.h:93
static TOOL_ACTION cursorDblClick
Definition: actions.h:127
Represent a single user action.
Definition: tool_action.h:49
static TOOL_ACTION acceleratedGraphics
Definition: actions.h:168
CURSOR_EVENT_TYPE
Definition: actions.h:196
static TOOL_ACTION resetLocalCoords
Definition: actions.h:153
static TOOL_ACTION help
Definition: actions.h:181
static const TOOL_EVENT InhibitSelectionEditing
Definition: actions.h:222
static TOOL_ACTION gridNext
Definition: actions.h:138
boost::optional< T > OPT
Definition: optional.h:7
static TOOL_ACTION gridProperties
Definition: actions.h:144
Gather all the actions that are shared by tools.
Definition: actions.h:43
static TOOL_ACTION panUp
Definition: actions.h:130
static TOOL_ACTION zoomIn
Definition: actions.h:94
static TOOL_ACTION deleteTool
Definition: actions.h:76
static TOOL_ACTION zoomOut
Definition: actions.h:95
static TOOL_ACTION highContrastModeCycle
Definition: actions.h:107
static TOOL_ACTION undo
Definition: actions.h:67
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:105
static TOOL_ACTION saveAll
Definition: actions.h:57
static TOOL_ACTION gridSetOrigin
Definition: actions.h:140
static TOOL_ACTION showSymbolBrowser
Definition: actions.h:162
static TOOL_ACTION showContextMenu
Definition: actions.h:66
static TOOL_ACTION cursorDown
Definition: actions.h:117
static TOOL_ACTION getInvolved
Definition: actions.h:183
static TOOL_ACTION configurePaths
Definition: actions.h:177
static TOOL_ACTION highContrastMode
Definition: actions.h:106
static TOOL_ACTION toggleUnits
Definition: actions.h:151
static TOOL_ACTION selectAll
Definition: actions.h:73
static TOOL_ACTION findNext
Definition: actions.h:81
static TOOL_ACTION gettingStarted
Definition: actions.h:180
static TOOL_ACTION showFootprintEditor
Definition: actions.h:165
static TOOL_ACTION paste
Definition: actions.h:71
static TOOL_ACTION duplicate
Definition: actions.h:74
static TOOL_ACTION revert
Definition: actions.h:58
static TOOL_ACTION selectionTool
Definition: actions.h:156
static TOOL_ACTION refreshPreview
Definition: actions.h:109
static TOOL_ACTION cursorClick
Definition: actions.h:126