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-2019 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 
41 class ACTIONS
42 {
43 public:
44 
45  virtual ~ACTIONS() {};
46 
47  // Generic actions
50  static TOOL_ACTION undo;
51  static TOOL_ACTION redo;
52  static TOOL_ACTION cut;
53  static TOOL_ACTION copy;
55 
56  // View controls
69 
75 
80 
83 
84  // Panning with keyboard
89 
90  // Grid control
100 
101  // Units
105 
113  virtual OPT<TOOL_EVENT> TranslateLegacyId( int aId ) = 0;
114 
118 
120  enum class REMOVE_FLAGS { NORMAL = 0x00, ALT = 0x01, CUT = 0x02 };
121 };
122 
123 
129 class EVENTS
130 {
131 public:
132  const static TOOL_EVENT SelectedEvent;
134  const static TOOL_EVENT ClearedEvent;
135 
137 };
138 
139 #endif // __ACTIONS_H
140 
141 
static const TOOL_EVENT SelectedEvent
Event sent after an item is selected.
Definition: actions.h:132
static TOOL_ACTION zoomPreset
Definition: actions.h:64
static TOOL_ACTION zoomInCenter
Definition: actions.h:60
virtual ~ACTIONS()
Definition: actions.h:45
REMOVE_FLAGS
Remove event modifier flags
Definition: actions.h:120
static const TOOL_EVENT UnselectedEvent
Event sent after an item is unselected.
Definition: actions.h:133
virtual OPT< TOOL_EVENT > TranslateLegacyId(int aId)=0
Function TranslateLegacyId() Translates legacy tool ids to the corresponding TOOL_ACTION name.
static TOOL_ACTION zoomTool
Definition: actions.h:65
static TOOL_ACTION gridResetOrigin
Definition: actions.h:96
static TOOL_ACTION cancelInteractive
Definition: actions.h:45
static TOOL_ACTION cursorRight
Definition: actions.h:74
static TOOL_ACTION zoomFitScreen
Definition: actions.h:63
static TOOL_ACTION cursorRightFast
Definition: actions.h:79
static TOOL_ACTION gridFast1
Definition: actions.h:91
static TOOL_ACTION panLeft
Definition: actions.h:87
static TOOL_ACTION imperialUnits
Definition: actions.h:102
static const TOOL_EVENT SelectedItemsModified
Definition: actions.h:136
static TOOL_ACTION zoomOutCenter
Definition: actions.h:61
Class TOOL_MANAGER.
Definition: tool_manager.h:49
static TOOL_ACTION copy
Definition: actions.h:53
static TOOL_ACTION centerContents
Definition: actions.h:66
static TOOL_ACTION gridFast2
Definition: actions.h:92
static TOOL_ACTION toggleCursor
Definition: actions.h:67
static TOOL_ACTION gridPreset
Definition: actions.h:97
static TOOL_ACTION gridPrev
Definition: actions.h:94
static TOOL_ACTION panDown
Definition: actions.h:86
Class EVENTS.
Definition: actions.h:129
static TOOL_ACTION toggleGrid
Definition: actions.h:98
Class TOOL_EVENT.
Definition: tool_event.h:167
static TOOL_ACTION cursorUpFast
Definition: actions.h:76
static TOOL_ACTION cursorDownFast
Definition: actions.h:77
static TOOL_ACTION cursorLeft
Definition: actions.h:73
static TOOL_ACTION panRight
Definition: actions.h:88
static TOOL_ACTION cut
Definition: actions.h:52
static const TOOL_EVENT ClearedEvent
Event sent after selection is cleared.
Definition: actions.h:134
static TOOL_ACTION cursorLeftFast
Definition: actions.h:78
static TOOL_ACTION updateMenu
Definition: actions.h:49
static TOOL_ACTION metricUnits
Definition: actions.h:103
static TOOL_ACTION redo
Definition: actions.h:51
static TOOL_ACTION zoomCenter
Definition: actions.h:62
static TOOL_ACTION cursorUp
Cursor control with keyboard.
Definition: actions.h:71
static TOOL_ACTION zoomRedraw
Definition: actions.h:57
static TOOL_ACTION cursorDblClick
Definition: actions.h:82
Class TOOL_ACTION.
Definition: tool_action.h:46
CURSOR_EVENT_TYPE
Cursor control event types
Definition: actions.h:116
static TOOL_ACTION gridNext
Definition: actions.h:93
boost::optional< T > OPT
Definition: optional.h:7
static TOOL_ACTION gridProperties
Definition: actions.h:99
Class ACTIONS.
Definition: actions.h:41
static TOOL_ACTION panUp
Definition: actions.h:85
static TOOL_ACTION zoomIn
Definition: actions.h:58
static TOOL_ACTION zoomOut
Definition: actions.h:59
static TOOL_ACTION undo
Definition: actions.h:50
static TOOL_ACTION toggleCursorStyle
Definition: actions.h:68
static TOOL_ACTION gridSetOrigin
Definition: actions.h:95
static TOOL_ACTION cursorDown
Definition: actions.h:72
static TOOL_ACTION toggleUnits
Definition: actions.h:104
static TOOL_ACTION paste
Definition: actions.h:54
static TOOL_ACTION cursorClick
Definition: actions.h:81