diff --git a/akonadi/contact/editor/emaileditwidget.h b/akonadi/contact/editor/emaileditwidget.h index 339349857..4b6150e71 100644 --- a/akonadi/contact/editor/emaileditwidget.h +++ b/akonadi/contact/editor/emaileditwidget.h @@ -1,92 +1,92 @@ /* This file is part of KAddressBook. Copyright (c) 2009 Tobias Koenig This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef EMAILEDITWIDGET_H #define EMAILEDITWIDGET_H #include namespace KABC { class Addressee; } class KLineEdit; class KListWidget; class QToolButton; /** * @short A widget for editing email addresses. * * The widget will show the preferred email address in a lineedit * and provides a button to open a dialog for further editing. */ class EmailEditWidget : public QWidget { Q_OBJECT public: explicit EmailEditWidget( QWidget *parent = 0 ); ~EmailEditWidget(); void loadContact( const KABC::Addressee &contact ); void storeContact( KABC::Addressee &contact ) const; void setReadOnly( bool readOnly ); private Q_SLOTS: void edit(); void textChanged( const QString& ); private: KLineEdit *mEmailEdit; QToolButton *mEditButton; QStringList mEmailList; }; class EmailEditDialog : public KDialog { Q_OBJECT public: - EmailEditDialog( const QStringList &list, QWidget *parent = 0 ); + explicit EmailEditDialog( const QStringList &list, QWidget *parent = 0 ); ~EmailEditDialog(); QStringList emails() const; bool changed() const; protected Q_SLOTS: void add(); void edit(); void remove(); void standard(); void selectionChanged(); private: KListWidget *mEmailListBox; QPushButton *mAddButton; QPushButton *mRemoveButton; QPushButton *mEditButton; QPushButton *mStandardButton; bool mChanged; }; #endif diff --git a/akonadi/contact/editor/imagewidget.h b/akonadi/contact/editor/imagewidget.h index f9ff669e5..8485041b5 100644 --- a/akonadi/contact/editor/imagewidget.h +++ b/akonadi/contact/editor/imagewidget.h @@ -1,83 +1,83 @@ /* This file is part of KAddressBook. Copyright (c) 2009 Tobias Koenig This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef IMAGEWIDGET_H #define IMAGEWIDGET_H #include #include namespace KABC { class Addressee; } class ImageLoader; class ImageWidget : public QPushButton { Q_OBJECT public: enum Type { Photo, Logo }; - ImageWidget( Type type, QWidget *parent = 0 ); + explicit ImageWidget( Type type, QWidget *parent = 0 ); ~ImageWidget(); void loadContact( const KABC::Addressee &contact ); void storeContact( KABC::Addressee &contact ) const; void setReadOnly( bool readOnly ); protected: // image drop handling virtual void dragEnterEvent( QDragEnterEvent* ); virtual void dropEvent( QDropEvent* ); // image drag handling virtual void mousePressEvent( QMouseEvent* ); virtual void mouseMoveEvent( QMouseEvent* ); // context menu handling virtual void contextMenuEvent( QContextMenuEvent* ); private Q_SLOTS: void updateView(); void changeImage(); void saveImage(); void deleteImage(); private: ImageLoader *imageLoader(); Type mType; QImage mImage; bool mHasImage; bool mReadOnly; QPoint mDragStartPos; ImageLoader *mImageLoader; }; #endif diff --git a/akonadi/contact/editor/phoneeditwidget.h b/akonadi/contact/editor/phoneeditwidget.h index c1dd4176a..3c475aadf 100644 --- a/akonadi/contact/editor/phoneeditwidget.h +++ b/akonadi/contact/editor/phoneeditwidget.h @@ -1,266 +1,266 @@ /* This file is part of KAddressBook. Copyright (c) 2009 Tobias Koenig This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef PHONEEDITWIDGET_H #define PHONEEDITWIDGET_H #include #include #include #include class KLineEdit; class QButtonGroup; class QCheckBox; class QScrollArea; class QSignalMapper; class QVBoxLayout; /** * @short A combobox to select a phone number type. */ class PhoneTypeCombo : public KComboBox { Q_OBJECT public: /** * Creates a phone type combo. * * @param parent The parent widget. */ PhoneTypeCombo( QWidget *parent = 0 ); /** * Destroys the phone type combo. */ ~PhoneTypeCombo(); /** * Sets the phone number @p type that shall be selected. */ void setType( KABC::PhoneNumber::Type type ); /** * Returns the selected phone number type. */ KABC::PhoneNumber::Type type() const; private Q_SLOTS: void selected( int ); void otherSelected(); private: void update(); KABC::PhoneNumber::Type mType; int mLastSelected; QList mTypeList; }; /** * A widget that provides selectors for the type * and number of a phone number entry. */ class PhoneNumberWidget : public QWidget { Q_OBJECT public: /** * Creates a new phone number widget. * * @param parent The parent widget. */ PhoneNumberWidget( QWidget *parent = 0 ); /** * Sets the phone @p number of the widget. */ void setNumber( const KABC::PhoneNumber &number ); /** * Returns the phone number of the widget. */ KABC::PhoneNumber number() const; /** * Sets the widget to @p readOnly mode. */ void setReadOnly( bool readOnly ); Q_SIGNALS: void modified(); private: PhoneTypeCombo *mTypeCombo; KLineEdit *mNumberEdit; KABC::PhoneNumber mNumber; }; /** * A widgets that groups together a list of PhoneNumberWidgets */ class PhoneNumberListWidget : public QWidget { Q_OBJECT public: /** * Creates a new phone number list widget. * * @param parent The parent widget. */ PhoneNumberListWidget( QWidget *parent = 0 ); /** * Destroys the phone number list widget. */ ~PhoneNumberListWidget(); /** * Sets the @p list of phone numbers the widget shall show. */ void setPhoneNumbers( const KABC::PhoneNumber::List &list ); /** * Returns the list of phone numbers. */ KABC::PhoneNumber::List phoneNumbers() const; /** * Sets the widget to @p readOnly mode. */ void setReadOnly( bool readOnly ); /** * Returns the number of phone numbers available. */ int phoneNumberCount() const; public Q_SLOTS: /** * Adds a new phone number widget to this widget. */ void add(); /** * Removes the last phone number widget from this widget. */ void remove(); private Q_SLOTS: void changed( int ); private: void recreateNumberWidgets(); KABC::PhoneNumber::List mPhoneNumberList; QList mWidgets; QVBoxLayout *mWidgetLayout; bool mReadOnly; QSignalMapper *mMapper; }; /** * @short A widget for editing phone numbers of a contact. */ class PhoneEditWidget : public QWidget { Q_OBJECT public: /** * Creates a new phone edit widget. * * @param parent The parent widget. */ explicit PhoneEditWidget( QWidget *parent = 0 ); /** * Destroys the phone edit widget. */ ~PhoneEditWidget(); /** * Loads the data from @p contact to the widget. */ void loadContact( const KABC::Addressee &contact ); /** * Stores the data from the widget to the @p contact. */ void storeContact( KABC::Addressee &contact ) const; /** * Sets the widget to @p readOnly mode. */ void setReadOnly( bool readOnly ); private Q_SLOTS: void changed(); private: QPushButton *mAddButton; QPushButton *mRemoveButton; bool mReadOnly; QScrollArea *mListScrollArea; PhoneNumberListWidget *mPhoneNumberListWidget; }; /** * A dialog for editing phone number types. */ class PhoneTypeDialog : public KDialog { public: /** * Creates a new phone type dialog. * * @param type The initial type of the phone number. * @param parent The parent widget. */ - PhoneTypeDialog( KABC::PhoneNumber::Type type, QWidget *parent = 0 ); + explicit PhoneTypeDialog( KABC::PhoneNumber::Type type, QWidget *parent = 0 ); /** * Returns the selected type. */ KABC::PhoneNumber::Type type() const; private: KABC::PhoneNumber::Type mType; KABC::PhoneNumber::TypeList mTypeList; QButtonGroup *mGroup; QCheckBox *mPreferredBox; }; #endif