Graphviz 13.0.0~dev.20241222.1117
Loading...
Searching...
No Matches
mainwindow.h
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11/*
12Core structures of mdi windowing code is either inspired or directly copied from
13Nokia Corporation's QT Toolkit examples. These examples are published under the
14terms of the BSD
15*/
16
17#pragma once
18
19#include "ui_settings.h"
20#include <QMainWindow>
21#include <QTextStream>
22#include <vector>
23
24extern QTextStream errout;
25
26class MdiChild;
27class CFrmSettings;
28QT_BEGIN_NAMESPACE
29class QAction;
30class QMenu;
31class QMdiArea;
32class QMdiSubWindow;
33QT_END_NAMESPACE
34
35class CMainWindow : public QMainWindow {
36 Q_OBJECT
37
38public:
39 CMainWindow(const QStringList &files);
40 QMdiArea *mdiArea;
41 void addFile(const QString &fileName);
42private slots:
43 void slotSettings();
44 void slotRun(MdiChild *m = nullptr);
45 void slotNew();
46 void slotOpen();
47 void slotSave();
48 void slotSaveAs();
49 void slotCut();
50 void slotCopy();
51 void slotPaste();
52 void slotAbout();
53 void slotRefreshMenus();
54 void slotNewLog();
55 void slotSaveLog();
56 MdiChild *createMdiChild();
57 void activateChild(QWidget *window);
58
59protected:
60 void closeEvent(QCloseEvent *event);
61
62private:
63 void setChild();
64 void createConsole();
65 void actions();
66 void menus();
67 void updateMenus();
68 void updateWindowMenu();
69 void updateFileMenu();
70 void toolBars();
71 void readSettings();
72 void writeSettings();
73 MdiChild *activeMdiChild();
74 MdiChild *prevChild;
75 QMdiSubWindow *findMdiChild(const QString &fileName);
76 int dfltRenderIdx, dfltLayoutIdx;
77
78 QToolBar *tbFile;
79 QToolBar *tbEdit;
80 QToolBar *tbGraph;
81
82 QAction *newAct;
83 QAction *openAct;
84 QAction *saveAct;
85 QAction *saveAsAct;
86 QAction *exitAct;
87 QAction *cutAct;
88 QAction *copyAct;
89 QAction *pasteAct;
90 QAction *closeAct;
91 QAction *closeAllAct;
92 QAction *tileAct;
93 QAction *cascadeAct;
94 QAction *nextAct;
95 QAction *previousAct;
96 QAction *separatorAct;
97 QAction *aboutAct;
98
99 QAction *settingsAct;
100 QAction *layoutAct;
101
102 CFrmSettings *frmSettings;
103 // menus
104 QMenu *mFile;
105 QMenu *mEdit;
106 QMenu *mGraph;
107 QMenu *mWindow;
108 QMenu *mHelp;
109};
QMdiArea * mdiArea
Definition mainwindow.h:40
void closeEvent(QCloseEvent *event)
void addFile(const QString &fileName)
char * fileName(ingraph_state *sp)
Return name of current file being processed.
Definition ingraphs.c:156
QTextStream errout