| 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 |
#pragma once |
| 12 |
|
| 13 |
#include <memory> |
| 14 |
#include <QTextEdit> |
| 15 |
#include "imageviewer.h" |
| 16 |
class CMainWindow; |
| 17 |
|
| 18 |
class MdiChild : public QTextEdit |
| 19 |
{ |
| 20 |
Q_OBJECT |
| 21 |
|
| 22 |
public: |
| 23 |
MdiChild(); |
| 24 |
|
| 25 |
void newFile(); |
| 26 |
bool loadFile(const QString &fileName); |
| 27 |
bool save(); |
| 28 |
bool saveAs(); |
| 29 |
bool saveFile(const QString &fileName); |
| 30 |
QString userFriendlyCurrentFile(); |
| 31 |
QString currentFile() { return curFile; } |
| 32 |
int layoutIdx; |
| 33 |
int renderIdx; |
| 34 |
QString outputFile; |
| 35 |
bool preview; |
| 36 |
bool applyCairo; |
| 37 |
QString attributes; |
| 38 |
std::unique_ptr<ImageViewer> previewFrm; |
| 39 |
CMainWindow* parentFrm; |
| 40 |
bool loadPreview(const QString &fileName); |
| 41 |
bool firstTime(); |
| 42 |
bool settingsSet; |
| 43 |
protected: |
| 44 |
void closeEvent(QCloseEvent *event); |
| 45 |
|
| 46 |
private slots: |
| 47 |
void documentWasModified(); |
| 48 |
|
| 49 |
private: |
| 50 |
bool maybeSave(); |
| 51 |
void setCurrentFile(const QString &fileName); |
| 52 |
QString strippedName(const QString &fullFileName); |
| 53 |
|
| 54 |
QString curFile; |
| 55 |
bool isUntitled; |
| 56 |
}; |