moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kig / kig / kig.h
blob3bfb53133ec3c4deb6a5c8c4ee1a6f51545cbcf3
1 /**
2 This file is part of Kig, a KDE program for Interactive Geometry...
3 Copyright (C) 2002 Dominique Devriese <devriese@kde.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 USA
19 **/
22 #ifndef KIG_KIG_H
23 #define KIG_KIG_H
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
29 #include <kdeversion.h>
31 #ifdef KDE_IS_VERSION
32 #if KDE_IS_VERSION( 3, 1, 90 )
33 #undef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
34 #else
35 #define KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
36 #endif
37 #else
38 #define KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
39 #endif
41 #include <kapplication.h>
42 #include <kparts/mainwindow.h>
43 #include <dcopclient.h>
45 class KToggleAction;
46 class KRecentFilesAction;
48 /**
49 * This is the application "Shell". It has a menubar, toolbar, and
50 * statusbar but relies on the "Part" to do all the real work.
52 class Kig : public KParts::MainWindow
54 Q_OBJECT
55 public:
56 /**
57 * Default Constructor
59 Kig();
61 /**
62 * Default Destructor
64 virtual ~Kig();
66 public slots:
67 /**
68 * Open file in this window
69 * @param file file to open
71 void load (const KURL& file);
73 /**
74 * this opens the file specified in s in a new window
76 * @param s
78 void openURL (const QString& s) { openURL(KURL(s)); };
79 void openURL (const KURL& s);
81 protected:
83 /**
84 * The user started dragging something onto us...
86 * @param e
88 void dragEnterEvent(QDragEnterEvent* e);
90 /**
91 * The user dropped something onto us...
93 * @param e
95 void dropEvent (QDropEvent* e);
97 /**
98 * this is called by the framework before closing the window, to
99 * allow the user to save his changes... returning false cancels the
100 * close request...
102 bool queryClose();
105 * This method is called when it is time for the app to save its
106 * properties for session management purposes.
108 void saveProperties(KConfig *);
111 * This method is called when this app is restored. The KConfig
112 * object points to the session management config file that was saved
113 * with @ref saveProperties
115 void readProperties(KConfig *);
117 private slots:
118 void fileNew();
119 void fileOpen();
120 // Qt moc doesn't handle ifdef's, so i'm disabling it..
121 // #ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
122 void optionsShowToolbar();
123 void optionsShowStatusbar();
124 // #endif
125 // #if KDE_IS_VERSION( 3, 2, 90 )
126 void optionsConfigureKeys();
127 // #endif
128 void optionsConfigureToolbars();
130 void applyNewToolbarConfig();
132 void tipOfDay();
133 void startupTipOfDay();
135 private:
136 void setupActions();
138 KParts::ReadWritePart *m_part;
140 //#ifdef KIG_DONT_USE_NEW_KMAINWINDOW_FEATURES
141 KToggleAction *m_toolbarAction;
142 KToggleAction *m_statusbarAction;
143 //#endif
144 KRecentFilesAction *m_recentFilesAction;
146 KConfig* config;
148 static bool kimageioRegistered;
151 #endif // KIG_KIG_H