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

0001 /*
0002   SPDX-FileCopyrightText: 2010 Casey Link <unnamedrambler@gmail.com>
0003   SPDX-FileCopyrightText: 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
0004 
0005   SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "attendeedata.h"
0011 #include "attendeeline.h"
0012 
0013 #include <Libkdepim/MultiplyingLineEditor>
0014 
0015 namespace IncidenceEditorNG
0016 {
0017 class AttendeeLineFactory : public KPIM::MultiplyingLineFactory
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit AttendeeLineFactory(QObject *parent)
0022         : KPIM::MultiplyingLineFactory(parent)
0023     {
0024     }
0025 
0026     KPIM::MultiplyingLine *newLine(QWidget *parent) override
0027     {
0028         return new AttendeeLine(parent);
0029     }
0030 };
0031 
0032 class AttendeeEditor : public KPIM::MultiplyingLineEditor
0033 {
0034     Q_OBJECT
0035 public:
0036     explicit AttendeeEditor(QWidget *parent = nullptr);
0037 
0038     AttendeeData::List attendees() const;
0039 
0040     void addAttendee(const KCalendarCore::Attendee &attendee);
0041     void removeAttendee(const AttendeeData::Ptr &attendee);
0042 
0043     void setActions(AttendeeLine::AttendeeActions actions);
0044 
0045 Q_SIGNALS:
0046     void countChanged(int);
0047     void changed(const KCalendarCore::Attendee &oldAttendee, const KCalendarCore::Attendee &newAttendee);
0048     void editingFinished(KPIM::MultiplyingLine *);
0049 
0050 protected Q_SLOTS:
0051     void slotLineAdded(KPIM::MultiplyingLine *);
0052     void slotCalculateTotal();
0053 };
0054 }