2 * KmPlot - a math. function plotter for the KDE-Desktop
4 * Copyright (C) 2004 Fredrik Edemar
7 * This file is part of the KDE Project.
8 * KmPlot is part of the KDE-EDU Project.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 #include <kapplication.h>
34 #include <kcmdlineargs.h>
35 #include <kparts/mainwindow.h>
37 #include "kmplotIface.h"
38 #include "kmplotprogress.h"
43 * This is the application "Shell". It has a menubar, toolbar, and
44 * statusbar but relies on the "Part" to do all the real work.
46 * @short Application Shell
47 * @author Fredrik Edemar <f_edemar@linux.se>
49 class KmPlot
: public KParts::MainWindow
, virtual public KmPlotIface
56 KmPlot( KCmdLineArgs
* args
);
64 * Use this method to load whatever file/URL you have
66 bool load(const KURL
& url
);
70 * This method is called when it is time for the app to save its
71 * properties for session management purposes.
73 void saveProperties(KConfig
*);
76 * This method is called when this app is restored. The KConfig
77 * object points to the session management config file that was saved
78 * with @ref saveProperties
80 void readProperties(KConfig
*);
82 /// Quits KmPlot after checking if modifications shall be saved.
83 virtual bool queryClose();
88 void fileOpen(const KURL
&url
);
89 void optionsConfigureKeys();
90 void optionsConfigureToolbars();
91 void applyNewToolbarConfig();
93 /// Called when the user want to cancel the drawing
94 void progressbar_clicked();
97 /// Called when fullscren is enabled/disabled
98 void slotUpdateFullScreen(bool);
99 void setStatusBarText(const QString
&, int id
);
104 void setupStatusBar();
105 bool checkModified();
107 void openFileInNewWindow(const KURL url
);
109 /// Functions for the progressbar
110 bool stopProgressBar();
111 void startProgressBar(int);
112 void increaseProgressBar();
116 KParts::ReadOnlyPart
*m_part
;
117 /// The fullscreen action to be plugged/unplegged to the toolbar
118 KToggleFullScreenAction
* m_fullScreen
;
119 KmPlotProgress
*m_progressbar
;