File indexing completed on 2024-11-17 04:49:23

0001 /*
0002   This file is part of KOrganizer.
0003 
0004   SPDX-FileCopyrightText: 2001, 2004 Cornelius Schumacher <schumacher@kde.org>
0005   SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
0006 
0007   SPDX-License-Identifier: GPL-2.0-or-later WITH Qt-Commercial-exception-1.0
0008 */
0009 
0010 #pragma once
0011 
0012 #include "koeventview.h"
0013 
0014 class CalendarView;
0015 class FilterEditDialog;
0016 class SearchDialog;
0017 
0018 namespace CalendarSupport
0019 {
0020 class ArchiveDialog;
0021 }
0022 
0023 namespace IncidenceEditorNG
0024 {
0025 class IncidenceDialog;
0026 }
0027 
0028 namespace KCalendarCore
0029 {
0030 class CalFilter;
0031 }
0032 namespace Akonadi
0033 {
0034 class TagManagementDialog;
0035 }
0036 
0037 class KCMultiDialog;
0038 
0039 /**
0040   This class manages the dialogs used by the calendar view. It owns the objects
0041   and handles creation and selection.
0042 */
0043 class KODialogManager : public QObject
0044 {
0045     Q_OBJECT
0046 public:
0047     explicit KODialogManager(CalendarView *);
0048     ~KODialogManager() override;
0049 
0050     IncidenceEditorNG::IncidenceDialog *createDialog(const Akonadi::Item &item);
0051 
0052     void updateSearchDialog();
0053 
0054     void connectTypeAhead(IncidenceEditorNG::IncidenceDialog *editor, KOEventView *view);
0055 
0056 public Q_SLOTS:
0057     void showOptionsDialog();
0058     void showCategoryEditDialog();
0059     void showSearchDialog();
0060     void showArchiveDialog();
0061     void showFilterEditDialog(QList<KCalendarCore::CalFilter *> *filters);
0062 
0063 private:
0064     void slotHelp();
0065     void createCategoryEditor();
0066     class DialogManagerVisitor;
0067     class EditorDialogVisitor;
0068 
0069     CalendarView *const mMainView;
0070     KCMultiDialog *mOptionsDialog = nullptr;
0071     QPointer<Akonadi::TagManagementDialog> mCategoryEditDialog;
0072     SearchDialog *mSearchDialog = nullptr;
0073     CalendarSupport::ArchiveDialog *mArchiveDialog = nullptr;
0074     FilterEditDialog *mFilterEditDialog = nullptr;
0075 };