File indexing completed on 2024-04-28 05:11:35

0001 /*
0002   SPDX-FileCopyrightText: 2010 Bertjan Broeksema <broeksema@kde.org>
0003   SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
0004 
0005   SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "incidenceeditor_export.h"
0011 
0012 #include <Akonadi/Collection>
0013 #include <KCalendarCore/IncidenceBase>
0014 
0015 namespace Akonadi
0016 {
0017 class IncidenceChanger;
0018 }
0019 
0020 namespace IncidenceEditorNG
0021 {
0022 class IncidenceDialog;
0023 
0024 namespace IncidenceDialogFactory
0025 {
0026 /**
0027  * Creates a new IncidenceDialog for given type. Returns 0 for unsupported types.
0028  *
0029  * @param needsSaving If true, the editor will be initially dirty, and needs saving.
0030  *                    Apply button will be turned on. This is used for example when
0031  *                    we fill the editor with data that's not yet in akonadi, like
0032  *                    the "Create To-do/Reminder" in KMail.
0033  * @param type   The Incidence type for which to create a dialog.
0034  * @param parent The parent widget of the dialog
0035  * @param flags  The window flags for the dialog.
0036  *
0037  * TODO: Implement support for Journals.
0038  * NOTE: There is no editor for Incidence::TypeFreeBusy
0039  */
0040 INCIDENCEEDITOR_EXPORT IncidenceDialog *create(bool needsSaving,
0041                                                KCalendarCore::IncidenceBase::IncidenceType type,
0042                                                Akonadi::IncidenceChanger *changer,
0043                                                QWidget *parent = nullptr,
0044                                                Qt::WindowFlags flags = {});
0045 
0046 INCIDENCEEDITOR_EXPORT IncidenceDialog *createTodoEditor(const QString &summary,
0047                                                          const QString &description,
0048                                                          const QStringList &attachments,
0049                                                          const QStringList &attendees,
0050                                                          const QStringList &attachmentMimetypes,
0051                                                          const QStringList &attachmentLabels,
0052                                                          bool inlineAttachment,
0053                                                          const Akonadi::Collection &defaultCollection,
0054                                                          bool cleanupAttachmentTemp,
0055                                                          QWidget *parent = nullptr,
0056                                                          Qt::WindowFlags flags = {});
0057 
0058 INCIDENCEEDITOR_EXPORT IncidenceDialog *createEventEditor(const QString &summary,
0059                                                           const QString &description,
0060                                                           const QStringList &attachments,
0061                                                           const QStringList &attendees,
0062                                                           const QStringList &attachmentMimetypes,
0063                                                           const QStringList &attachmentLabels,
0064                                                           bool inlineAttachment,
0065                                                           const Akonadi::Collection &defaultCollection,
0066                                                           bool cleanupAttachmentTempFiles,
0067                                                           QWidget *parent = nullptr,
0068                                                           Qt::WindowFlags flags = {});
0069 } // namespace IncidenceDialogFactory
0070 } // namespace IncidenceEditorNG