Add another crash guard, should cover Andy's LDAP crashes.
[kdepim.git] / korganizer / kodialogmanager.h
blobc9a6db51daf7152eba3e9c418ada9d42639e3605
1 /*
2 This file is part of KOrganizer.
4 Copyright (c) 2001,2004 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution.
25 #ifndef KODIALOGMANAGER_H
26 #define KODIALOGMANAGER_H
28 #include "koeventview.h"
30 #include <QList>
31 #include <QPointer>
33 class CalendarView;
34 class FilterEditDialog;
35 class KCMultiDialog;
36 class SearchDialog;
38 namespace Akonadi {
39 class Item;
42 namespace IncidenceEditorNG {
43 class CategoryEditDialog;
44 class IncidenceDialog;
47 namespace KCal {
48 class CalFilter;
51 namespace CalendarSupport {
52 class ArchiveDialog;
55 /**
56 This class manages the dialogs used by the calendar view. It owns the objects
57 and handles creation and selection.
59 class KODialogManager : public QObject
61 Q_OBJECT
62 public:
63 explicit KODialogManager( CalendarView * );
64 virtual ~KODialogManager();
66 /** */
67 IncidenceEditorNG::IncidenceDialog *createDialog( const Akonadi::Item& item );
69 // TODO_NG: see if editors-NG have the needed slots.
70 void connectEditor( IncidenceEditorNG::IncidenceDialog *editor );
72 void updateSearchDialog();
74 void connectTypeAhead( IncidenceEditorNG::IncidenceDialog *editor, KOEventView *view );
76 public slots:
77 void showOptionsDialog();
78 void showCategoryEditDialog();
79 void showSearchDialog();
80 void showArchiveDialog();
81 void showFilterEditDialog( QList<KCalCore::CalFilter*> *filters );
83 private:
84 void createCategoryEditor();
85 class DialogManagerVisitor;
86 class EditorDialogVisitor;
88 CalendarView *mMainView;
89 KCMultiDialog *mOptionsDialog;
90 QPointer<IncidenceEditorNG::CategoryEditDialog> mCategoryEditDialog;
91 SearchDialog *mSearchDialog;
92 CalendarSupport::ArchiveDialog *mArchiveDialog;
93 FilterEditDialog *mFilterEditDialog;
96 #endif