moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kmplot / kmplot / kmplot.h
blobde8ab4ab93ec7c7c5d0273031e9e0e30946e2b1b
1 /*
2 * KmPlot - a math. function plotter for the KDE-Desktop
4 * Copyright (C) 2004 Fredrik Edemar
5 * f_edemar@linux.se
6 *
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.
26 #ifndef KMPLOT_H_
27 #define KMPLOT_H_
29 #ifdef HAVE_CONFIG_H
30 #include <config.h>
31 #endif
33 #include <kapplication.h>
34 #include <kcmdlineargs.h>
35 #include <kparts/mainwindow.h>
37 #include "kmplotIface.h"
38 #include "kmplotprogress.h"
40 class KToggleAction;
42 /**
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
51 Q_OBJECT
52 public:
53 /**
54 * Default Constructor
56 KmPlot( KCmdLineArgs* args);
58 /**
59 * Default Destructor
61 virtual ~KmPlot();
63 /**
64 * Use this method to load whatever file/URL you have
66 bool load(const KURL& url);
68 protected:
69 /**
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 *);
75 /**
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();
85 private slots:
86 void fileNew();
87 void fileOpen();
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();
96 public slots:
97 /// Called when fullscren is enabled/disabled
98 void slotUpdateFullScreen(bool);
99 void setStatusBarText(const QString &, int id);
101 private:
102 void setupAccel();
103 void setupActions();
104 void setupStatusBar();
105 bool checkModified();
106 bool isModified();
107 void openFileInNewWindow(const KURL url);
109 /// Functions for the progressbar
110 bool stopProgressBar();
111 void startProgressBar(int);
112 void increaseProgressBar();
115 private:
116 KParts::ReadOnlyPart *m_part;
117 /// The fullscreen action to be plugged/unplegged to the toolbar
118 KToggleFullScreenAction* m_fullScreen;
119 KmPlotProgress *m_progressbar;
122 #endif // KMPLOT_H_