File indexing completed on 2024-05-12 16:39:24
0001 /* This file is part of the KDE project 0002 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 0003 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org> 0004 Copyright (C) 2000-2005 David Faure <faure@kde.org> 0005 Copyright (C) 2005 Sven L�ppken <sven@kde.org> 0006 Copyright (C) 2008 - 2009 Dag Andersen <danders@get2net> 0007 0008 This program is free software; you can redistribute it and/or 0009 modify it under the terms of the GNU General Public 0010 License as published by the Free Software Foundation; either 0011 version 2 of the License, or (at your option) any later version. 0012 0013 This program is distributed in the hope that it will be useful, 0014 but WITHOUT ANY WARRANTY; without even the implied warranty of 0015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0016 General Public License for more details. 0017 0018 You should have received a copy of the GNU General Public License 0019 along with this program; see the file COPYING. If not, write to 0020 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0021 * Boston, MA 02110-1301, USA. 0022 */ 0023 #ifndef KPLATOWORK_MAINWINDOW_H 0024 #define KPLATOWORK_MAINWINDOW_H 0025 0026 #include "planwork_export.h" 0027 0028 #include <QMap> 0029 #include <QToolButton> 0030 #include <QLabel> 0031 0032 #include <kparts/mainwindow.h> 0033 0034 namespace KParts { 0035 } 0036 namespace KPlatoWork { 0037 class Part; 0038 } 0039 namespace KPlato { 0040 class Document; 0041 } 0042 0043 0044 /////// class KPlatoWork_MainWindow //////// 0045 0046 class PLANWORK_EXPORT KPlatoWork_MainWindow : public KParts::MainWindow 0047 { 0048 Q_OBJECT 0049 0050 public: 0051 explicit KPlatoWork_MainWindow(); 0052 ~KPlatoWork_MainWindow() override; 0053 0054 KPlatoWork::Part *rootDocument() const { return m_part; } 0055 bool openDocument(const QUrl & url); 0056 0057 virtual QString configFile() const; 0058 0059 void editDocument(KPlatoWork::Part *part, const KPlato::Document *doc); 0060 0061 // bool isEditing() const { return m_editing; } 0062 // bool isModified() const; 0063 0064 Q_SIGNALS: 0065 void undo(); 0066 void redo(); 0067 0068 public Q_SLOTS: 0069 virtual void slotFileClose(); 0070 void setCaption(const QString &text) override; 0071 void setCaption(const QString &text, bool modified) override; 0072 0073 protected Q_SLOTS: 0074 bool queryClose() override; 0075 0076 virtual void slotFileOpen(); 0077 /** 0078 * Saves all workpackages 0079 */ 0080 virtual void slotFileSave(); 0081 0082 protected: 0083 virtual bool saveDocument(bool saveas = false, bool silent = false); 0084 0085 private: 0086 KPlatoWork::Part *m_part; 0087 }; 0088 0089 0090 #endif // KPLATOWORK_MAINWINDOW_H 0091