1
/* This file is part of the KDE project
2
Copyright (C) 2003 Lucijan Busch <lucijan@kde.org>
3
Copyright (C) 2003-2005 Jaroslaw Staniek <js@iidea.pl>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library 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 GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
21
#ifndef KEXIMAINWINDOW_H
22
#define KEXIMAINWINDOW_H
24
#include "kexisharedactionhost.h"
28
#include <kmdimainfrm.h>
39
* @short Kexi's main window interface
40
* This interface is implemented by KexiMainWindowImpl class.
41
* KexiMainWindow offers simple features what lowers cross-dependency (and also avoids
42
* circular dependencies between Kexi modules).
44
class KEXICORE_EXPORT KexiMainWindow : public KMdiMainFrm, public KexiSharedActionHost
49
virtual ~KexiMainWindow();
51
//! Project data of currently opened project or NULL if no project here yet.
52
virtual KexiProject *project() = 0;
54
/*! Registers dialog \a dlg for watching and adds it to the main window's stack. */
55
virtual void registerChild(KexiDialogBase *dlg) = 0;
57
virtual QPopupMenu* findPopupMenu(const char *popupName) = 0;
59
/*! Generates ID for private "document" like Relations window.
60
Private IDs are negative numbers (while ID regular part instance's IDs are >0)
61
Private means that the object is not stored as-is in the project but is somewhat
62
generated and in most cases there is at most one unique instance document of such type (part).
63
To generate this ID, just app-wide internal counter is used. */
64
virtual int generatePrivateID() = 0;
66
/*! \return a list of all actions defined by application.
67
Not all of them are shared. Don't use plug these actions
68
in your windows by hand but user methods from KexiViewBase! */
69
virtual KActionPtrList allActions() const = 0;
72
//! Opens object pointed by \a item in a view \a viewMode
73
virtual KexiDialogBase * openObject(KexiPart::Item *item, int viewMode = Kexi::DataViewMode) = 0;
75
virtual KexiDialogBase * openObject(const QCString& mime, const QString& name, int viewMode = Kexi::DataViewMode) = 0;
77
/*! Received information from active view that \a dlg has switched
78
its property buffer, so property editor contents should be reloaded.
79
If \a force is true, property editor's data is reloaded even
80
if the currently pointed buffer is the same as before.
81
If \a preservePrevSelection is true and there was a buffer
82
set before call, previously selected item will be preselected
83
in the editor (if found). */
84
virtual void propertyBufferSwitched(KexiDialogBase *dlg, bool force=false,
85
bool preservePrevSelection = true) = 0;
87
/*! Saves dialog's \a dlg data. It dialog's data is never saved,
88
User is asked for name and caption, before saving.
89
\return true on successul closing or false on saving error.
90
If saving was cancelled by user, cancelled is returned.
91
\a messageWhenAskingForName is a i18n'ed text that will be visible
92
within name/caption dialog (see KexiNameDialog), which is popped
93
up for never saved objects. */
94
virtual tristate saveObject( KexiDialogBase *dlg,
95
const QString& messageWhenAskingForName = QString::null ) = 0;
97
virtual tristate closeDialog(KexiDialogBase *dlg) = 0;
100
virtual void slotObjectRenamed(const KexiPart::Item &item) = 0;