HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
file_actions.h
Go to the documentation of this file.
1 // MIT License
2 //
3 // Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved.
4 // Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved.
5 // Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved.
6 // Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in all
16 // copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 // SOFTWARE.
25 
26 #pragma once
27 #include "gui/action/action.h"
28 #include <QString>
29 
30 
31 namespace hal {
32  class MainWindow;
33  class GateLibraryManager;
34  class GuiPluginManager;
35  class SettingsItemKeybind;
36 
40  class FileActions : public QWidget
41  {
42  Q_OBJECT
53 
54  MainWindow* mMainWindowReference;
55  GateLibraryManager* mGatelibReference;
56  GuiPluginManager* mGuiPluginReference;
57 
58  Action* mActionCreate;
59  Action* mActionOpen;
60  Action* mActionClose;
61  Action* mActionSave;
62  Action* mActionSaveAs;
63 
64  QString mNewFileIconStyle;
65  QString mNewFileIconPath;
66  QString mOpenProjIconPath;
67  QString mOpenProjIconStyle;
68  QString mCloseIconPath;
69  QString mCloseIconStyle;
70  QString mSaveIconPath;
71  QString mSaveAsIconPath;
72 
73  QString mEnabledIconStyle;
74  QString mDisabledIconStyle;
75  SettingsItemKeybind* mSettingCreateFile;
76  SettingsItemKeybind* mSettingOpenFile;
77  SettingsItemKeybind* mSettingSaveFile;
78 
79  public Q_SLOTS:
80  void handleFileStatusChanged(bool gateLibraryAffected, bool isDirty);
81  void handleFileOpenChanged(bool gateLibraryAffected, bool isOpen);
82 
83  public:
84  FileActions(QWidget* parent = nullptr);
85 
91  QString newFileIconPath() const { return mNewFileIconPath; }
92 
98  QString newFileIconStyle() const { return mNewFileIconStyle; }
99 
105  QString openProjIconPath() const { return mOpenProjIconPath; }
106 
112  QString openProjIconStyle() const { return mOpenProjIconStyle; }
113 
119  QString saveIconPath() const {return mSaveIconPath; }
120 
126  QString saveAsIconPath() const { return mSaveAsIconPath; }
127 
133  QString closeIconPath() const { return mCloseIconPath; }
134 
140  QString closeIconStyle() const { return mCloseIconStyle; }
141 
147  QString enabledIconStyle() const { return mEnabledIconStyle; }
148 
154  QString disabledIconStyle() const { return mDisabledIconStyle; }
155 
161  void setNewFileIconPath(const QString& path) { mNewFileIconPath = path; }
162 
168  void setNewFileIconStyle(const QString &style) { mNewFileIconStyle = style; }
169 
175  void setOpenProjIconPath(const QString& path) { mOpenProjIconPath = path; }
176 
182  void setOpenProjIconStyle(const QString& style) { mOpenProjIconStyle = style; };
183 
189  void setSaveIconPath(const QString& path) { mSaveIconPath = path; }
190 
196  void setSaveAsIconPath(const QString& path) { mSaveAsIconPath = path; }
197 
203  void setCloseIconPath(const QString& path) { mCloseIconPath = path; }
204 
211  void setCloseIconStyle(const QString& style) { mCloseIconStyle = style; }
212 
218  void setEnabledIconStyle(const QString& style) { mEnabledIconStyle = style; }
219 
225  void setDisabledIconStyle(const QString& style) { mDisabledIconStyle = style; }
226 
227  Action* create() const { return mActionCreate; }
228  Action* open() const { return mActionOpen; }
229  Action* close() const { return mActionClose; }
230  Action* save() const { return mActionSave; }
231  Action* saveAs() const { return mActionSaveAs; }
232 
233  void setup(GateLibraryManager* glcw = nullptr, GuiPluginManager* plmgr = nullptr);
234 
235  void repolish();
236  };
237 }
Provides an interface for triggerable functionality that can be inserted into widgets and also connec...
Definition: action.h:42
QString closeIconStyle() const
Definition: file_actions.h:140
void setCloseIconPath(const QString &path)
Definition: file_actions.h:203
FileActions(QWidget *parent=nullptr)
void setDisabledIconStyle(const QString &style)
Definition: file_actions.h:225
QString saveAsIconPath() const
Definition: file_actions.h:126
Action * close() const
Definition: file_actions.h:229
void setOpenProjIconStyle(const QString &style)
Definition: file_actions.h:182
void setup(GateLibraryManager *glcw=nullptr, GuiPluginManager *plmgr=nullptr)
Action * create() const
Definition: file_actions.h:227
Action * save() const
Definition: file_actions.h:230
QString saveIconPath() const
Definition: file_actions.h:119
QString newFileIconPath() const
Definition: file_actions.h:91
QString openProjIconPath() const
Definition: file_actions.h:105
Action * saveAs() const
Definition: file_actions.h:231
QString openProjIconStyle() const
Definition: file_actions.h:112
void setEnabledIconStyle(const QString &style)
Definition: file_actions.h:218
void setSaveAsIconPath(const QString &path)
Definition: file_actions.h:196
void setSaveIconPath(const QString &path)
Definition: file_actions.h:189
QString closeIconPath() const
Definition: file_actions.h:133
void setNewFileIconStyle(const QString &style)
Definition: file_actions.h:168
void setCloseIconStyle(const QString &style)
Definition: file_actions.h:211
QString disabledIconStyle() const
Definition: file_actions.h:154
void handleFileStatusChanged(bool gateLibraryAffected, bool isDirty)
QString newFileIconStyle() const
Definition: file_actions.h:98
QString enabledIconStyle() const
Definition: file_actions.h:147
void setOpenProjIconPath(const QString &path)
Definition: file_actions.h:175
void setNewFileIconPath(const QString &path)
Definition: file_actions.h:161
Action * open() const
Definition: file_actions.h:228
void handleFileOpenChanged(bool gateLibraryAffected, bool isOpen)
The top level widget.
Definition: main_window.h:65
A SettingsItem to modify keybinds.
Definition: defines.h:45
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SLOTSQ_SLOTS
QObject * parent() const const
QStyle * style() const const