KiCad PCB EDA Suite
gerbview_control.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) 2017 Jon Evans <jon@craftyjon.com>
5  * Copyright (C) 2017-2021 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 
21 #ifndef GERBVIEW_CONTROL_H
22 #define GERBVIEW_CONTROL_H
23 
24 #include <tool/tool_interactive.h>
25 
26 class EDA_DRAW_PANEL_GAL;
27 class GERBVIEW_FRAME;
28 
34 {
35 public:
37  ~GERBVIEW_CONTROL() override { }
38 
40  void Reset( RESET_REASON aReason ) override;
41 
42  // Display modes
43  int DisplayControl( const TOOL_EVENT& aEvent );
44 
45  // Layer control
46  int LayerNext( const TOOL_EVENT& aEvent );
47  int LayerPrev( const TOOL_EVENT& aEvent );
48  int ClearLayer( const TOOL_EVENT& aEvent );
49  int ClearAllLayers( const TOOL_EVENT& aEvent );
50  int ReloadAllLayers( const TOOL_EVENT& aEvent );
51 
52  // Files
53  int OpenGerber( const TOOL_EVENT& aEvent );
54  int OpenDrillFile( const TOOL_EVENT& aEvent );
55  int OpenJobFile( const TOOL_EVENT& aEvent );
56  int OpenZipFile( const TOOL_EVENT& aEvent );
57 
58  int ToggleLayerManager( const TOOL_EVENT& aEvent );
59 
60  // Highlight control
61  int HighlightControl( const TOOL_EVENT& aEvent );
62 
63  // Miscellaneous
64  int ExportToPcbnew( const TOOL_EVENT& aEvent );
65  int UpdateMessagePanel( const TOOL_EVENT& aEvent );
66  int Print( const TOOL_EVENT& aEvent );
67 
69  void setTransitions() override;
70 
71 protected:
73  {
74  return m_frame->GetCanvas();
75  }
76 
77 private:
79 };
80 
81 #endif
int OpenJobFile(const TOOL_EVENT &aEvent)
int OpenGerber(const TOOL_EVENT &aEvent)
~GERBVIEW_CONTROL() override
GERBVIEW_FRAME * m_frame
int OpenZipFile(const TOOL_EVENT &aEvent)
int Print(const TOOL_EVENT &aEvent)
Set up handlers for various events.
virtual EDA_DRAW_PANEL_GAL * GetCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
void Reset(RESET_REASON aReason) override
Bring the tool to a known, initial state.
int LayerPrev(const TOOL_EVENT &aEvent)
int UpdateMessagePanel(const TOOL_EVENT &aEvent)
int HighlightControl(const TOOL_EVENT &aEvent)
int ClearLayer(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int ReloadAllLayers(const TOOL_EVENT &aEvent)
Generic, UI-independent tool event.
Definition: tool_event.h:152
int LayerNext(const TOOL_EVENT &aEvent)
int OpenDrillFile(const TOOL_EVENT &aEvent)
int ExportToPcbnew(const TOOL_EVENT &aEvent)
EDA_DRAW_PANEL_GAL * canvas()
RESET_REASON
Determine the reason of reset for a tool.
Definition: tool_base.h:77
int DisplayControl(const TOOL_EVENT &aEvent)
int ToggleLayerManager(const TOOL_EVENT &aEvent)
int ClearAllLayers(const TOOL_EVENT &aEvent)
Handle actions that are shared between different frames in Pcbnew.