KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Maciej Suminski <[email protected]>
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 <tool/tool_event.h>
31
32#define LEGACY_HK_NAME( x ) x
33
36
38 std::function<void( const VECTOR2I&, GENERAL_COLLECTOR&, PCB_SELECTION_TOOL* )>;
39
40
48{
49public:
50
51 virtual ~ACTIONS() {};
52
53 // Generic document actions
54 static TOOL_ACTION doNew; // sadly 'new' is a reserved word
67 static TOOL_ACTION ddAddLibrary; // for drag and drop lib
70
71 // Generic edit actions
85 static TOOL_ACTION doDelete; // sadly 'delete' is a reserved word
92
93 // Incrementing
99
100 // Tables
113
114 // Find and Replace
124
125 // RC Lists
129
130 // View controls
142 static TOOL_ACTION zoomFitObjects; // Zooms to bbox of items on screen (except page border)
157
158 static TOOL_ACTION refreshPreview; // Similar to a synthetic mouseMoved event, but also
159 // used after a rotate, mirror, etc.
160
165
167
173
178
181
182 // Panning with keyboard
187
188 // Grid control
201
202 // Units
210
211 // Selection
214
217
221
224
229
233
236
237 // Grouping
244
245 // Group Tool
248
249 // Common Tools
254
255 // Misc
269
270 // Internal
279
280 // Suite
293
294 // API
296
297 // Embedding Files
301
318
320 enum class REMOVE_FLAGS
321 {
322 NORMAL = 0x00,
323 ALT = 0x01,
324 CUT = 0x02
325 };
326
329 {
330 // Amount to increment
331 int Delta;
332 // Which "thing" to increment
333 // (what this is depends on the action - a pin might be number, then name)
334 int Index;
335 };
336};
337
338
373
374#endif // __ACTIONS_H
std::function< void(const VECTOR2I &, GENERAL_COLLECTOR &, PCB_SELECTION_TOOL *)> CLIENT_SELECTION_FILTER
Definition actions.h:37
Gather all the actions that are shared by tools.
Definition actions.h:48
static TOOL_ACTION addRowAbove
Definition actions.h:104
static TOOL_ACTION showCalculatorTools
Definition actions.h:262
static TOOL_ACTION addColBefore
Definition actions.h:106
static TOOL_ACTION gridProperties
Definition actions.h:199
static TOOL_ACTION decrementPrimary
Definition actions.h:96
static TOOL_ACTION pickNewGroupMember
Definition actions.h:247
static TOOL_ACTION gridFastCycle
Definition actions.h:191
static TOOL_ACTION updatePcbFromSchematic
Definition actions.h:263
static TOOL_ACTION showLibraryFieldsTable
Definition actions.h:267
static TOOL_ACTION toggleGrid
Definition actions.h:197
static TOOL_ACTION paste
Definition actions.h:80
static TOOL_ACTION pickerSubTool
Definition actions.h:253
static TOOL_ACTION excludeMarker
Definition actions.h:128
static TOOL_ACTION about
Definition actions.h:288
static TOOL_ACTION cancelInteractive
Definition actions.h:72
static TOOL_ACTION nextMarker
Definition actions.h:127
static TOOL_ACTION zoomRedraw
Definition actions.h:131
static TOOL_ACTION millimetersUnits
Definition actions.h:205
static TOOL_ACTION unselectAll
Definition actions.h:83
static TOOL_ACTION gridFast1
Definition actions.h:189
static TOOL_ACTION openWithTextEditor
Definition actions.h:68
static TOOL_ACTION gridPrev
Definition actions.h:193
static TOOL_ACTION revert
Definition actions.h:62
static TOOL_ACTION show3DViewer
Definition actions.h:257
static TOOL_ACTION showLibraryTree
Definition actions.h:163
static TOOL_ACTION cursorSmallCrosshairs
Definition actions.h:151
static TOOL_ACTION reportBug
Definition actions.h:292
static TOOL_ACTION decrementSecondary
Definition actions.h:98
static TOOL_ACTION replaceAll
Definition actions.h:122
static TOOL_ACTION updatePreferences
Definition actions.h:277
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
Definition actions.h:226
static TOOL_ACTION cursorLeft
Definition actions.h:171
static TOOL_ACTION zoomOutCenter
Definition actions.h:135
static TOOL_ACTION togglePolarCoords
Definition actions.h:208
static TOOL_ACTION unselectItem
Definition actions.h:227
static TOOL_ACTION saveAs
Definition actions.h:59
static TOOL_ACTION addLibrary
Definition actions.h:56
static TOOL_ACTION copy
Definition actions.h:78
static TOOL_ACTION zoomIn
Definition actions.h:132
static TOOL_ACTION pluginsReload
Definition actions.h:295
static TOOL_ACTION extractFile
Definition actions.h:299
static TOOL_ACTION cursorLeftFast
Definition actions.h:176
static TOOL_ACTION deleteRows
Definition actions.h:108
static TOOL_ACTION zoomRedo
Definition actions.h:147
static TOOL_ACTION selectionCursor
Select a single item under the cursor position.
Definition actions.h:216
static TOOL_ACTION addRowBelow
Definition actions.h:105
static TOOL_ACTION pickerTool
Definition actions.h:252
static TOOL_ACTION cycleArcEditMode
Definition actions.h:273
static TOOL_ACTION gridPreset
Definition actions.h:196
static TOOL_ACTION selectSetLasso
Definition actions.h:220
static TOOL_ACTION selectSetRect
Set lasso selection mode.
Definition actions.h:219
static TOOL_ACTION group
Definition actions.h:238
static TOOL_ACTION gridResetOrigin
Definition actions.h:195
static TOOL_ACTION updateUnits
Definition actions.h:206
static TOOL_ACTION updateFind
Definition actions.h:123
static TOOL_ACTION showSymbolLibTable
Definition actions.h:283
static TOOL_ACTION openDirectory
Definition actions.h:69
static TOOL_ACTION deleteColumns
Definition actions.h:109
static TOOL_ACTION showSymbolEditor
Definition actions.h:259
virtual ~ACTIONS()
Definition actions.h:51
static TOOL_ACTION showSymbolBrowser
Definition actions.h:258
static TOOL_ACTION pasteSpecial
Definition actions.h:81
static TOOL_ACTION groupEnter
Definition actions.h:242
static TOOL_ACTION findPrevious
Definition actions.h:119
static TOOL_ACTION unmergeCells
Definition actions.h:111
static TOOL_ACTION showDatasheet
Definition actions.h:266
static TOOL_ACTION groupProperties
Definition actions.h:246
static TOOL_ACTION zoomFitSelection
Definition actions.h:143
static TOOL_ACTION selectColumns
Definition actions.h:102
static TOOL_ACTION centerSelection
Definition actions.h:149
static TOOL_ACTION mergeCells
Definition actions.h:110
static TOOL_ACTION donate
Definition actions.h:290
static TOOL_ACTION cursorDown
Definition actions.h:170
static TOOL_ACTION zoomOut
Definition actions.h:133
static TOOL_ACTION pointEditorArcKeepCenter
Definition actions.h:274
static TOOL_ACTION addColAfter
Definition actions.h:107
static TOOL_ACTION editTable
Definition actions.h:112
static TOOL_ACTION findAndReplace
Definition actions.h:117
static TOOL_ACTION milsUnits
Definition actions.h:204
static TOOL_ACTION highContrastModeCycle
Definition actions.h:155
static TOOL_ACTION listHotKeys
Definition actions.h:289
static TOOL_ACTION cursorRightFast
Definition actions.h:177
static TOOL_ACTION ungroup
Definition actions.h:239
static TOOL_ACTION openPreferences
Definition actions.h:281
static TOOL_ACTION showRelatedLibraryFieldsTable
Definition actions.h:268
static TOOL_ACTION pinLibrary
Definition actions.h:161
static TOOL_ACTION toggleBoundingBoxes
Definition actions.h:156
static TOOL_ACTION replaceAndFindNext
Definition actions.h:121
static TOOL_ACTION showContextMenu
Definition actions.h:74
static TOOL_ACTION toggleCursor
Definition actions.h:150
static TOOL_ACTION zoomOutHorizontally
Definition actions.h:137
static TOOL_ACTION getInvolved
Definition actions.h:291
static TOOL_ACTION rightJustify
Definition actions.h:89
static TOOL_ACTION showFootprintLibTable
Definition actions.h:284
static TOOL_ACTION centerContents
Definition actions.h:148
static TOOL_ACTION plot
Definition actions.h:65
static TOOL_ACTION pointEditorArcKeepRadius
Definition actions.h:276
static TOOL_ACTION zoomCenter
Definition actions.h:140
static TOOL_ACTION panDown
Definition actions.h:184
static TOOL_ACTION selectLibTreeColumns
Definition actions.h:278
static TOOL_ACTION open
Definition actions.h:57
static TOOL_ACTION saveAll
Definition actions.h:61
static TOOL_ACTION findNext
Definition actions.h:118
static TOOL_ACTION zoomOutVertically
Definition actions.h:139
static TOOL_ACTION cursorDblClick
Definition actions.h:180
static TOOL_ACTION pageSettings
Definition actions.h:63
static TOOL_ACTION showSearch
Definition actions.h:115
CURSOR_EVENT_TYPE
Definition actions.h:304
@ CURSOR_DBL_CLICK
Definition actions.h:315
@ CURSOR_RIGHT
Definition actions.h:312
@ CURSOR_LEFT_FAST
Definition actions.h:311
@ CURSOR_LEFT
Definition actions.h:310
@ CURSOR_DOWN_FAST
Definition actions.h:309
@ CURSOR_CLICK
Definition actions.h:314
@ CURSOR_NONE
Definition actions.h:305
@ CURSOR_UP
Definition actions.h:306
@ CURSOR_RIGHT_FAST
Definition actions.h:313
@ CURSOR_DOWN
Definition actions.h:308
@ CURSOR_UP_FAST
Definition actions.h:307
@ CURSOR_RIGHT_CLICK
Definition actions.h:316
static TOOL_ACTION undo
Definition actions.h:75
static TOOL_ACTION selectionActivate
Activation of the selection tool.
Definition actions.h:213
static TOOL_ACTION incrementSecondary
Definition actions.h:97
static TOOL_ACTION cursorDownFast
Definition actions.h:175
static TOOL_ACTION selectionMenu
Run a selection menu to select from a list of items.
Definition actions.h:235
static TOOL_ACTION removeFile
Cursor control event types.
Definition actions.h:300
static TOOL_ACTION prevMarker
Definition actions.h:126
static TOOL_ACTION reselectItem
Definition actions.h:228
static TOOL_ACTION selectRows
Definition actions.h:101
static TOOL_ACTION duplicate
Definition actions.h:84
static TOOL_ACTION inchesUnits
Definition actions.h:203
static TOOL_ACTION highContrastMode
Definition actions.h:154
static TOOL_ACTION embeddedFiles
Definition actions.h:298
static TOOL_ACTION incrementPrimary
Definition actions.h:95
static TOOL_ACTION cursorUpFast
Definition actions.h:174
static TOOL_ACTION gridOrigin
Definition actions.h:200
static TOOL_ACTION measureTool
Definition actions.h:251
static TOOL_ACTION zoomInHorizontally
Definition actions.h:136
static TOOL_ACTION panLeft
Definition actions.h:185
static TOOL_ACTION updateMenu
Definition actions.h:271
static TOOL_ACTION activatePointEditor
Definition actions.h:272
static TOOL_ACTION libraryTreeSearch
Definition actions.h:166
static TOOL_ACTION doDelete
Definition actions.h:85
static TOOL_ACTION quit
Definition actions.h:66
static TOOL_ACTION selectionTool
Definition actions.h:250
static TOOL_ACTION save
Definition actions.h:58
static TOOL_ACTION cursorClick
Definition actions.h:179
static TOOL_ACTION zoomFitScreen
Definition actions.h:141
REMOVE_FLAGS
Definition actions.h:321
static TOOL_ACTION redo
Definition actions.h:76
static TOOL_ACTION zoomPreset
Definition actions.h:144
static TOOL_ACTION deleteTool
Definition actions.h:86
static TOOL_ACTION hideLibraryTree
Definition actions.h:164
static TOOL_ACTION zoomTool
Definition actions.h:145
static TOOL_ACTION updateSchematicFromPcb
Definition actions.h:264
static TOOL_ACTION unpinLibrary
Definition actions.h:162
static TOOL_ACTION increment
Definition actions.h:94
static TOOL_ACTION selectionClear
Clear the current selection.
Definition actions.h:223
static TOOL_ACTION cursor45Crosshairs
Definition actions.h:153
static TOOL_ACTION leftJustify
Definition actions.h:87
static TOOL_ACTION panUp
Definition actions.h:183
static TOOL_ACTION showDesignBlockLibTable
Definition actions.h:285
static TOOL_ACTION showFootprintEditor
Definition actions.h:261
static TOOL_ACTION print
Definition actions.h:64
static TOOL_ACTION findNextMarker
Definition actions.h:120
static TOOL_ACTION showProperties
Definition actions.h:265
static TOOL_ACTION doNew
Definition actions.h:54
static TOOL_ACTION zoomFitObjects
Definition actions.h:142
static TOOL_ACTION toggleUnits
Definition actions.h:207
static TOOL_ACTION zoomInCenter
Definition actions.h:134
static TOOL_ACTION newLibrary
Definition actions.h:55
static TOOL_ACTION panRight
Definition actions.h:186
static TOOL_ACTION saveCopy
Definition actions.h:60
static TOOL_ACTION cut
Definition actions.h:77
static TOOL_ACTION selectTable
Definition actions.h:103
static TOOL_ACTION gridSetOrigin
Definition actions.h:194
static TOOL_ACTION addToGroup
Definition actions.h:240
static TOOL_ACTION gridFast2
Definition actions.h:190
static TOOL_ACTION expandAll
Definition actions.h:90
static TOOL_ACTION removeFromGroup
Definition actions.h:241
static TOOL_ACTION zoomInVertically
Definition actions.h:138
static TOOL_ACTION ddAddLibrary
Definition actions.h:67
static TOOL_ACTION configurePaths
Definition actions.h:282
static TOOL_ACTION showProjectManager
Definition actions.h:256
static TOOL_ACTION gettingStarted
Definition actions.h:286
static TOOL_ACTION copyAsText
Definition actions.h:79
static TOOL_ACTION cursorUp
Cursor control with keyboard.
Definition actions.h:169
static TOOL_ACTION refreshPreview
Definition actions.h:158
static TOOL_ACTION zoomUndo
Definition actions.h:146
static TOOL_ACTION groupLeave
Definition actions.h:243
static TOOL_ACTION showFootprintBrowser
Definition actions.h:260
static TOOL_ACTION toggleGridOverrides
Definition actions.h:198
static TOOL_ACTION finishInteractive
Definition actions.h:73
static TOOL_ACTION gridNext
Definition actions.h:192
static TOOL_ACTION cursorRight
Definition actions.h:172
static TOOL_ACTION selectAll
Definition actions.h:82
static TOOL_ACTION pointEditorArcKeepEndpoint
Definition actions.h:275
static TOOL_ACTION cursorFullCrosshairs
Definition actions.h:152
static TOOL_ACTION unselectItems
Definition actions.h:232
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
Definition actions.h:231
static TOOL_ACTION help
Definition actions.h:287
static TOOL_ACTION find
Definition actions.h:116
static TOOL_ACTION collapseAll
Definition actions.h:91
static TOOL_ACTION resetLocalCoords
Definition actions.h:209
static TOOL_ACTION centerJustify
Definition actions.h:88
Gather all the events that are shared by tools.
Definition actions.h:343
static const TOOL_EVENT DisambiguatePoint
Used for hotkey feedback.
Definition actions.h:363
static const TOOL_EVENT ClearedEvent
Definition actions.h:348
static const TOOL_EVENT InhibitSelectionEditing
Definition actions.h:359
static const TOOL_EVENT GridChangedByKeyEvent
Definition actions.h:366
static const TOOL_EVENT UndoRedoPreEvent
Definition actions.h:369
static const TOOL_EVENT SelectedEvent
Definition actions.h:346
static const TOOL_EVENT SelectedItemsModified
Selected items were moved, this can be very high frequency on the canvas, use with care.
Definition actions.h:353
static const TOOL_EVENT UninhibitSelectionEditing
Used to inform tool that it should display the disambiguation menu.
Definition actions.h:360
static const TOOL_EVENT UndoRedoPostEvent
Definition actions.h:370
static const TOOL_EVENT PointSelectedEvent
Definition actions.h:345
static const TOOL_EVENT SelectedItemsMoved
Used to inform tools that the selection should temporarily be non-editable.
Definition actions.h:356
static const TOOL_EVENT ContrastModeChangedByKeyEvent
Definition actions.h:367
static const TOOL_EVENT ConnectivityChangedEvent
Selected item had a property changed (except movement)
Definition actions.h:350
static const TOOL_EVENT UnselectedEvent
Definition actions.h:347
Used when the right click button is pressed, or when the select tool is in effect.
Definition collectors.h:207
The selection tool: currently supports:
Represent a single user action.
Generic, UI-independent tool event.
Definition tool_event.h:171
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:695