Incidenceeditor

incidenceattachment.h
1/*
2 SPDX-FileCopyrightText: 2010 Bertjan Broeksema <broeksema@kde.org>
3 SPDX-FileCopyrightText: 2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "incidenceeditor-ng.h"
11class QUrl;
12class KJob;
13namespace Ui
14{
15class EventOrTodoDesktop;
16}
17
18class QMenu;
19
20class QListWidgetItem;
21class QMimeData;
22class QAction;
23namespace IncidenceEditorNG
24{
25class AttachmentIconView;
26
27class IncidenceAttachment : public IncidenceEditor
28{
30public:
31 using IncidenceEditorNG::IncidenceEditor::load; // So we don't trigger -Woverloaded-virtual
32 using IncidenceEditorNG::IncidenceEditor::save; // So we don't trigger -Woverloaded-virtual
33
34 explicit IncidenceAttachment(Ui::EventOrTodoDesktop *ui);
35
36 ~IncidenceAttachment() override;
37
38 void load(const KCalendarCore::Incidence::Ptr &incidence) override;
39 void save(const KCalendarCore::Incidence::Ptr &incidence) override;
40 [[nodiscard]] bool isDirty() const override;
41
42 [[nodiscard]] int attachmentCount() const;
43
45 void attachmentCountChanged(int newCount);
46
47private:
48 void addAttachment();
49 void copyToClipboard(); /// Copies selected items to clip board
50 void cutToClipboard(); /// Copies selected items to clipboard and removes them from the list
51 void editSelectedAttachments();
52 void openURL(const QUrl &url);
53 void pasteFromClipboard();
54 void removeSelectedAttachments();
55 void saveAttachment(QListWidgetItem *item);
56 void saveSelectedAttachments();
57 void showAttachment(QListWidgetItem *item);
58 void showContextMenu(const QPoint &pos);
59 void showSelectedAttachments();
60 void slotItemRenamed(QListWidgetItem *item);
61 void slotSelectionChanged();
62 void downloadComplete(KJob *);
63 // void addAttachment( KCalendarCore::Attachment *attachment );
64 void addDataAttachment(const QByteArray &data, const QString &mimeType = QString(), const QString &label = QString());
65 void addUriAttachment(const QString &uri, const QString &mimeType = QString(), const QString &label = QString(), bool inLine = false);
66 void handlePasteOrDrop(const QMimeData *mimeData);
67 void setupActions();
68 void setupAttachmentIconView();
69
70private:
71 AttachmentIconView *mAttachmentView = nullptr;
72 Ui::EventOrTodoDesktop *const mUi;
73
74 QMenu *const mPopupMenu;
75 QAction *mOpenAction = nullptr;
76 QAction *mSaveAsAction = nullptr;
77#ifndef QT_NO_CLIPBOARD
78 QAction *mCopyAction = nullptr;
79 QAction *mCutAction = nullptr;
80#endif
81 QAction *mDeleteAction = nullptr;
82 QAction *mEditAction = nullptr;
83};
84}
virtual void load(const KCalendarCore::Incidence::Ptr &incidence)=0
Load the values of.
QSharedPointer< IncidenceT > incidence() const
Convenience method to get a pointer for a specific const Incidence Type.
virtual void save(const KCalendarCore::Incidence::Ptr &incidence)=0
Store the current values of the editor into.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.