Incidenceeditor

incidenceattendee.h
1/*
2 SPDX-FileCopyrightText: 2010 Casey Link <unnamedrambler@gmail.com>
3 SPDX-FileCopyrightText: 2009-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"
11
12#include <KCalendarCore/FreeBusy>
13#include <KContacts/Addressee>
14namespace Ui
15{
16class EventOrTodoDesktop;
17}
18
19namespace KContacts
20{
21class Addressee;
22class ContactGroup;
23}
24
25class KJob;
26
27namespace IncidenceEditorNG
28{
29class AttendeeComboBoxDelegate;
30class AttendeeLineEditDelegate;
31class AttendeeTableModel;
32class ConflictResolver;
33class IncidenceDateTime;
34
35class IncidenceAttendee : public IncidenceEditor
36{
38public:
39 using IncidenceEditorNG::IncidenceEditor::load; // So we don't trigger -Woverloaded-virtual
40 using IncidenceEditorNG::IncidenceEditor::save; // So we don't trigger -Woverloaded-virtual
41 explicit IncidenceAttendee(QWidget *parent, IncidenceDateTime *dateTime, Ui::EventOrTodoDesktop *ui);
42 ~IncidenceAttendee() override;
43
44 void load(const KCalendarCore::Incidence::Ptr &incidence) override;
45 void save(const KCalendarCore::Incidence::Ptr &incidence) override;
46 [[nodiscard]] bool isDirty() const override;
47 void printDebugInfo() const override;
48
49 AttendeeTableModel *dataModel() const;
50 AttendeeComboBoxDelegate *stateDelegate() const;
51 AttendeeComboBoxDelegate *roleDelegate() const;
52 AttendeeComboBoxDelegate *responseDelegate() const;
53 AttendeeLineEditDelegate *attendeeDelegate() const;
54
55 [[nodiscard]] int attendeeCount() const;
56
58 void attendeeCountChanged(int);
59
60public Q_SLOTS:
61 /// If the user is attendee of the loaded event, one of the following slots
62 /// can be used to change the status.
63 void acceptForMe();
64 void declineForMe();
65
66private:
67 // checks if row is a group, that can/should be expanded
68 void checkIfExpansionIsNeeded(const KCalendarCore::Attendee &attendee);
69
70 // results of the group search job
71 void groupSearchResult(KJob *job);
72 void expandResult(KJob *job);
73 void slotSelectAddresses();
74 void slotSolveConflictPressed();
75 void slotUpdateConflictLabel(int);
76 void slotOrganizerChanged(const QString &organizer);
77 void slotGroupSubstitutionPressed();
78
79 // wrapper for the conflict resolver
80 void slotEventDurationChanged();
81
82 void filterLayoutChanged();
83 void updateCount();
84
85 void slotConflictResolverAttendeeAdded(const QModelIndex &index, int first, int last);
86 void slotConflictResolverAttendeeRemoved(const QModelIndex &index, int first, int last);
87 void slotConflictResolverAttendeeChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
88 void slotConflictResolverLayoutChanged();
89 void slotFreeBusyAdded(const QModelIndex &index, int first, int last);
90 void slotFreeBusyChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
91 void updateFBStatus();
92 void updateFBStatus(const KCalendarCore::Attendee &attendee, const KCalendarCore::FreeBusy::Ptr &fb);
93
94 void slotGroupSubstitutionAttendeeAdded(const QModelIndex &index, int first, int last);
95 void slotGroupSubstitutionAttendeeRemoved(const QModelIndex &index, int first, int last);
96 void slotGroupSubstitutionAttendeeChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
97 void slotGroupSubstitutionLayoutChanged();
98
99 void slotUpdateCryptoPreferences();
100
101 void updateGroupExpand();
102
103 void insertAddresses(const KContacts::Addressee::List &list);
104
105 void changeStatusForMe(KCalendarCore::Attendee::PartStat);
106
107 /** Returns if I was the organizer of the loaded event */
108 [[nodiscard]] bool iAmOrganizer() const;
109
110 /** Reads values from a KContacts::Addressee and inserts a new Attendee
111 * item into the listview with those items. Used when adding attendees
112 * from the addressbook and expanding distribution lists.
113 * The optional Attendee parameter can be used to pass in default values
114 * to be used by the new Attendee.
115 * pos =-1 means insert attendee before empty line
116 */
117 void insertAttendeeFromAddressee(const KContacts::Addressee &a, int pos = -1);
118 void fillOrganizerCombo();
119 void setActions(KCalendarCore::Incidence::IncidenceType actions);
120
121 int rowOfAttendee(const QString &uid) const;
122
123 Ui::EventOrTodoDesktop *mUi = nullptr;
124 QWidget *mParentWidget = nullptr;
125 ConflictResolver *mConflictResolver = nullptr;
126
127 IncidenceDateTime *mDateTime = nullptr;
128 QString mOrganizer;
129
130 /** used dataModel to rely on*/
131 AttendeeTableModel *mDataModel = nullptr;
132 AttendeeLineEditDelegate *mAttendeeDelegate = nullptr;
133 AttendeeComboBoxDelegate *const mStateDelegate;
134 AttendeeComboBoxDelegate *mRoleDelegate = nullptr;
135 AttendeeComboBoxDelegate *mResponseDelegate = nullptr;
136
137 // the QString is Attendee::uid here
139 QMap<KJob *, QString> mMightBeGroupJobs;
140 QMap<KJob *, QString> mExpandGroupJobs;
141};
142}
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.
AddresseeList List
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Aug 30 2024 11:51:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.