kexi

keximainwindow.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
00003    Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KEXIMAINWINDOW_H
00022 #define KEXIMAINWINDOW_H
00023 
00024 #include <qmap.h>
00025 #include <qintdict.h>
00026 
00027 #include <kmdimainfrm.h>
00028 #include <kexiutils/tristate.h>
00029 
00030 #include "kexisharedactionhost.h"
00031 #include "kexi.h"
00032 
00033 class KexiDialogBase;
00034 class KexiProject;
00035 namespace KexiPart {
00036     class Item;
00037 }
00038 
00045 class KEXICORE_EXPORT KexiMainWindow : public KMdiMainFrm, public KexiSharedActionHost
00046 {
00047     Q_OBJECT
00048     public:
00050         enum PrintActionType {
00051             PrintItem,
00052             PreviewItem,
00053             PageSetupForItem
00054         };
00055 
00056         KexiMainWindow();
00057         virtual ~KexiMainWindow();
00058 
00060         virtual KexiProject *project() = 0;
00061 
00063         virtual void registerChild(KexiDialogBase *dlg) = 0;
00064 
00065         virtual QPopupMenu* findPopupMenu(const char *popupName) = 0;
00066 
00072         virtual int generatePrivateID() = 0;
00073 
00077         virtual KActionPtrList allActions() const = 0;
00078 
00080         virtual KexiDialogBase* currentDialog() const = 0;
00081 
00083         virtual bool userMode() const = 0;
00084 
00085     signals:
00088         void acceptProjectClosingRequested(bool& cancel);
00089 
00092         void beforeProjectClosing();
00093 
00095         void projectClosed();
00096 
00097     public slots:
00101         virtual bool newObject( KexiPart::Info *info, bool& openingCancelled ) = 0;
00102 
00104         virtual KexiDialogBase * openObject(KexiPart::Item *item, int viewMode,
00105             bool &openingCancelled, QMap<QString,QString>* staticObjectArgs = 0,
00106             QString* errorMessage = 0) = 0;
00107 
00109         virtual KexiDialogBase * openObject(const QCString& mime, const QString& name, 
00110             int viewMode, bool &openingCancelled, QMap<QString,QString>* staticObjectArgs = 0) = 0;
00111 
00115         virtual tristate closeObject(KexiPart::Item* item) = 0;
00116 
00118         virtual void acceptPropertySetEditing() = 0;
00119 
00127         virtual void propertySetSwitched(KexiDialogBase *dlg, bool force=false,
00128             bool preservePrevSelection = true, const QCString& propertyToSelect = QCString()) = 0;
00129 
00137         virtual tristate saveObject( KexiDialogBase *dlg,
00138             const QString& messageWhenAskingForName = QString::null, bool dontAsk = false ) = 0;
00139 
00144         virtual tristate closeDialog(KexiDialogBase *dlg) = 0;
00145 
00158         virtual tristate getNewObjectInfo( KexiPart::Item *partItem, KexiPart::Part *part,
00159             bool& allowOverwriting, const QString& messageWhenAskingForName = QString::null ) = 0;
00160 
00164         virtual void highlightObject(const QCString& mime, const QCString& name) = 0;
00165 
00168         virtual tristate printItem(KexiPart::Item* item) = 0;
00169 
00172         virtual tristate printPreviewForItem(KexiPart::Item* item) = 0;
00173 
00176         virtual tristate showPageSetupForItem(KexiPart::Item* item) = 0;
00177 
00180         virtual tristate executeCustomActionForObject(KexiPart::Item* item, const QString& actionName) = 0;
00181 
00182     protected slots:
00183         virtual void slotObjectRenamed(const KexiPart::Item &item, const QCString& oldName) = 0;
00184 
00185 };
00186 
00187 
00188 #endif
00189 
KDE Home | KDE Accessibility Home | Description of Access Keys