Debian Codegraph @

HercConfiguration/DeviceMenuProcessor.h

raw symbols SCIP
1 /*
2 * File: DeviceMenuProcessor.h
3 *
4 * Author: Jacob Dekel
5 * Created on: Oct 14, 2009
6 *
7 * Copyright (c) 2009-2013 Jacob Dekel
8 * $Id$
9 *
10 * This object is an interface for driving devices through menus
11 * (used by both the devices pane and the devices configuration tab)
12 *
13 * This program is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 *
26 */
27 #ifndef DEVICEMENUPROCESSOR_H_
28 #define DEVICEMENUPROCESSOR_H_
29
30 #include "DeviceConfigLine.h"
31 #include "DeviceTypes.h"
32
33 #include <QtWidgets/QWidget>
34 #include <QMenu>
35
36 class DeviceMenuProcessor : public QWidget
37 {
38 Q_OBJECT
39 public:
40 DeviceMenuProcessor(QWidget *parent = 0);
41 virtual ~DeviceMenuProcessor();
42
43 public slots:
44 void devicesClick(QMouseEvent * event);
45 void menuAddTerminal();
46 void menuAddConsole();
47 void menuAddPrinter();
48 void menuAddCardReader();
49 void menuAddCardPunch();
50 void menuAddTape();
51 void menuAddCTC();
52 void menuAddDasd();
53 void menuAddSYSG();
54 void menuLoad();
55 void menuUnload();
56 void newTapeFileOK(QString& tapeFile);
57
58 protected:
59 virtual bool isRealDev(int lineNumber) = 0;
60 virtual bool canAddSYSG() = 0;
61 virtual bool isConfig() = 0;
62 virtual bool realDevice() = 0;
63 virtual DeviceTypes::Type getType(int lineNumber) = 0;
64 virtual void doLoadTape(QString& tapeFileName) = 0;
65 virtual bool hasConfig() = 0;
66 virtual bool traced() = 0;
67
68 int mClickRow;
69 int mLastClick;
70 QMenu mMenu;
71 DeviceConfigLine * mCandidateLine;
72
73 private:
74 void menuAddItem(int);
75 };
76
77 #endif /* DEVICEMENUPROCESSOR_H_ */