2 Copyright (C) 2010 Casey Link <unnamedrambler@gmail.com>
3 Copyright (C) 2009-2010 Klaralvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
5 This library is free software; you can redistribute it and/or modify it
6 under the terms of the GNU Library General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or (at your
8 option) any later version.
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to the
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef ATTENDEELINE_H
22 #define ATTENDEELINE_H
24 #include "attendeedata.h"
26 #include <libkdepim/multiplyingline.h>
27 #include <libkdepim/addresseelineedit.h>
30 #include <KGlobalSettings>
34 #include <QToolButton>
38 namespace IncidenceEditorsNG
{
42 class AttendeeComboBox
: public QToolButton
46 explicit AttendeeComboBox( QWidget
*parent
);
48 void addItem( const QIcon
& icon
, const QString
& text
);
49 void addItems( const QStringList
& texts
);
51 int currentIndex() const;
59 /** Clears the combobox, removing all items. */
61 void setCurrentIndex( int index
);
64 void keyPressEvent( QKeyEvent
*ev
);
66 void slotActionTriggered();
69 QList
<QPair
<QString
, QIcon
> > mList
;
73 class AttendeeCheckBox
: public QCheckBox
77 explicit AttendeeCheckBox( QWidget
*parent
);
84 void keyPressEvent( QKeyEvent
*ev
);
87 class AttendeeLineEdit
: public KPIM::AddresseeLineEdit
91 explicit AttendeeLineEdit( QWidget
* parent
);
101 void keyPressEvent( QKeyEvent
*ev
);
104 class AttendeeLine
: public KPIM::MultiplyingLine
108 enum AttendeeActions
{
113 AttendeeLine( QWidget
* parent
);
114 virtual ~AttendeeLine(){}
116 virtual void activate();
117 virtual bool isActive() const;
119 virtual bool isEmpty() const;
120 virtual void clear();
122 virtual bool isModified() const;
123 virtual void clearModified();
125 virtual KPIM::MultiplyingLineData::Ptr
data() const;
126 virtual void setData( const KPIM::MultiplyingLineData::Ptr
&data
);
128 virtual void fixTabOrder( QWidget
* previous
);
129 virtual QWidget
* tabOut() const;
131 virtual void moveCompletionPopup();
132 virtual void setCompletionMode( KGlobalSettings::Completion
);
134 virtual int setColumnWidth( int w
);
136 void setActions( AttendeeActions actions
);
140 void editingFinished( KPIM::MultiplyingLine
* );
143 void slotTextChanged( const QString
& );
144 void slotEditingFinished();
145 void slotComboChanged();
147 void dataFromFields();
148 void fieldsFromData();
150 AttendeeComboBox
*mRoleCombo
;
151 AttendeeComboBox
*mStateCombo
;
152 AttendeeCheckBox
*mResponseCheck
;
153 AttendeeLineEdit
*mEdit
;
154 QSharedPointer
<AttendeeData
> mData
;
164 #endif // ATTENDEELINE_H