1
/*******************************************************************
3
Part of the Fritzing project - http://fritzing.org
4
Copyright (c) 2007-2012 Fachhochschule Potsdam - http://fh-potsdam.de
6
Fritzing is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
11
Fritzing is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
19
********************************************************************
22
$Author: irascibl@gmail.com $:
23
$Date: 2012-09-30 02:00:34 +0200 (Sun, 30 Sep 2012) $
25
********************************************************************/
28
#ifndef FRITZINGWINDOW_H_
29
#define FRITZINGWINDOW_H_
31
#include <QMainWindow>
34
#include <QMessageBox>
36
#include "../waitpushundostack.h"
37
#include "../utils/misc.h"
38
#include "../utils/bundler.h"
40
class FritzingWindow : public QMainWindow, public Bundler
45
FritzingWindow(const QString &untitledFileName, int &untitledFileCount, QString fileExt, QWidget * parent = 0, Qt::WFlags f = 0);
46
const QString &fileName();
47
void setFileName(const QString &);
49
virtual void notClosableForAWhile();
50
static bool alreadyHasExtension(const QString &fileName, const QString &extension=___emptyString___);
53
void readOnlyChanged(bool isReadOnly);
56
void undoStackCleanChanged(bool isClean);
58
virtual bool saveAs();
61
bool save(const QString & filename, bool readOnly);
62
bool saveAs(const QString & filename, bool readOnly);
63
virtual void setTitle();
64
virtual const QString fritzingTitle();
65
virtual const QString fileExtension() = 0;
66
virtual const QString untitledFileName() = 0;
67
virtual int &untitledFileCount() = 0;
68
virtual const QString defaultSaveFolder() = 0;
69
virtual QString getExtensionString() = 0;
70
virtual QStringList getExtensions() = 0;
72
virtual bool saveAsAux(const QString & fileName) = 0;
73
virtual bool beforeClosing(bool showCancel, bool & discard); // returns true if close, false if cancel
74
QMessageBox::StandardButton beforeClosingMessage(const QString & filename, bool showCancel);
75
virtual void setBeforeClosingText(const QString & filename, QMessageBox & messageBox);
77
void createCloseAction();
79
void setReadOnly(bool readOnly);
80
virtual bool anyModified();
83
class WaitPushUndoStack * m_undoStack;
88
QStatusBar *m_statusBar;
91
static QStringList OtherKnownExtensions;
94
static QString ReadOnlyPlaceholder;
95
static const QString QtFunkyPlaceholder;
98
#endif /* FRITZINGWINDOW_H_ */