Commit 32570882 authored by Tobias Koenig's avatar Tobias Koenig

api and apidox cleanups

svn path=/trunk/KDE/kdepim/akonadi/contact/; revision=1010384
parent c21e2260
......@@ -32,6 +32,11 @@ class AbstractContactEditorWidget;
class Collection;
class Item;
/**
* @short An widget to edit contacts in Akonadi.
*
* @author Tobias Koenig <tokoe@kde.org>
*/
class AKONADI_CONTACT_EXPORT ContactEditor : public QWidget
{
Q_OBJECT
......
......@@ -121,6 +121,7 @@ ContactEditorDialog::ContactEditorDialog( Mode mode, QAbstractItemModel *collect
ContactEditorDialog::~ContactEditorDialog()
{
delete d;
}
void ContactEditorDialog::setContact( const Akonadi::Item &contact )
......
......@@ -32,6 +32,46 @@ namespace Akonadi {
class AbstractContactEditorWidget;
class Item;
/**
* @short A dialog for creating or editing a contact in Akonadi.
*
* This dialog provides a way to create a new contact or edit
* an existing contact in Akonadi.
*
* Example for creating a new contact:
*
* @code
*
* Akonadi::ContactEditorDialog dlg( Akonadi::ContactEditorDialog::CreateMode,
* collectionModel, this );
*
* if ( dlg.exec() ) {
* qDebug() << "New contact has been added to the address book";
* } else {
* qDebug() << "User has canceled operation";
* }
*
* @endcode
*
* Example for editing an existing contact:
*
* @code
*
* const Akonadi::Item contact = ...;
*
* Akonadi::ContactEditorDialog dlg( Akonadi::ContactEditorDialog::EditMode, 0, this );
* dlg.setContact( contact );
*
* if ( dlg.exec() ) {
* qDebug() << "Contact has been edited";
* } else {
* qDebug() << "User has canceled operation";
* }
*
* @endcode
*
* @author Tobias Koenig <tokoe@kde.org>
*/
class AKONADI_CONTACT_EXPORT ContactEditorDialog : public KDialog
{
Q_OBJECT
......@@ -50,7 +90,8 @@ class AKONADI_CONTACT_EXPORT ContactEditorDialog : public KDialog
* Creates a new contact editor dialog with the standard editor widget.
*
* @param mode The mode of the dialog.
* @param collectionModel The collection model.
* @param collectionModel The collection model that is used to allow the user
* to select a target collection for new contacts.
* @param parent The parent widget of the dialog.
*/
ContactEditorDialog( Mode mode, QAbstractItemModel *collectionModel, QWidget *parent = 0 );
......@@ -59,7 +100,8 @@ class AKONADI_CONTACT_EXPORT ContactEditorDialog : public KDialog
* Creates a new contact editor dialog with a custom editor widget.
*
* @param mode The mode of the dialog.
* @param collectionModel The collection model.
* @param collectionModel The collection model that is used to allow the user
* to select a target collection for new contacts.
* @param editorWidget The contact editor widget that shall be used for editing.
* @param parent The parent widget of the dialog.
*/
......@@ -73,6 +115,9 @@ class AKONADI_CONTACT_EXPORT ContactEditorDialog : public KDialog
/**
* Sets the @p contact to edit when in EditMode.
*
* @note The contact item just must have a uid set, all
* other data are fetched by the dialog automatically.
*/
void setContact( const Akonadi::Item &contact );
......
......@@ -20,13 +20,12 @@
#include "contactgroupeditordialog.h"
#include "contactgroupeditor.h"
#include "collectioncombobox.h"
#include "collectionfiltermodel_p.h"
#include "contactgroupeditor.h"
#include <akonadi/descendantsproxymodel.h>
#include <akonadi/item.h>
#include <kabc/contactgroup.h>
#include <klocale.h>
......@@ -35,8 +34,14 @@
using namespace Akonadi;
class ContactGroupEditorDialog::Private
{
public:
ContactGroupEditor *mEditor;
};
ContactGroupEditorDialog::ContactGroupEditorDialog( Mode mode, QAbstractItemModel *collectionModel, QWidget *parent )
: KDialog( parent )
: KDialog( parent ), d( new Private )
{
setCaption( mode == CreateMode ? i18n( "New Contact Group" ) : i18n( "Edit Contact Group" ) );
setButtons( Ok | Cancel );
......@@ -46,8 +51,9 @@ ContactGroupEditorDialog::ContactGroupEditorDialog( Mode mode, QAbstractItemMode
QGridLayout *layout = new QGridLayout( mainWidget );
mEditor = new Akonadi::ContactGroupEditor( mode == CreateMode ?
Akonadi::ContactGroupEditor::CreateMode : Akonadi::ContactGroupEditor::EditMode, this );
d->mEditor = new Akonadi::ContactGroupEditor( mode == CreateMode ?
Akonadi::ContactGroupEditor::CreateMode : Akonadi::ContactGroupEditor::EditMode,
this );
if ( mode == CreateMode ) {
QLabel *label = new QLabel( i18n( "Add to:" ), mainWidget );
......@@ -69,15 +75,15 @@ ContactGroupEditorDialog::ContactGroupEditorDialog( Mode mode, QAbstractItemMode
layout->addWidget( box, 0, 1 );
connect( box, SIGNAL( selectionChanged( const Akonadi::Collection& ) ),
mEditor, SLOT( setDefaultCollection( const Akonadi::Collection& ) ) );
d->mEditor, SLOT( setDefaultCollection( const Akonadi::Collection& ) ) );
mEditor->setDefaultCollection( box->selectedCollection() );
d->mEditor->setDefaultCollection( box->selectedCollection() );
}
layout->addWidget( mEditor, 1, 0, 1, 2 );
layout->addWidget( d->mEditor, 1, 0, 1, 2 );
layout->setColumnStretch( 1, 1 );
connect( mEditor, SIGNAL( contactGroupStored( const Akonadi::Item& ) ),
connect( d->mEditor, SIGNAL( contactGroupStored( const Akonadi::Item& ) ),
this, SIGNAL( contactGroupStored( const Akonadi::Item& ) ) );
setInitialSize( QSize( 420, 120 ) );
......@@ -85,22 +91,23 @@ ContactGroupEditorDialog::ContactGroupEditorDialog( Mode mode, QAbstractItemMode
ContactGroupEditorDialog::~ContactGroupEditorDialog()
{
delete d;
}
void ContactGroupEditorDialog::setCompletionModel( QAbstractItemModel *model )
{
mEditor->setCompletionModel( model );
d->mEditor->setCompletionModel( model );
}
void ContactGroupEditorDialog::setContactGroup( const Akonadi::Item &group )
{
mEditor->loadContactGroup( group );
d->mEditor->loadContactGroup( group );
}
void ContactGroupEditorDialog::slotButtonClicked( int button )
{
if ( button == KDialog::Ok ) {
if ( mEditor->saveContactGroup() )
if ( d->mEditor->saveContactGroup() )
accept();
} else if ( button == KDialog::Cancel ) {
reject();
......
......@@ -32,11 +32,19 @@ namespace Akonadi {
class Item;
class ContactGroupEditor;
/**
* @short A dialog for editing a contact group.
*
* @author Tobias Koenig <tokoe@kde.org>
*/
class AKONADI_CONTACT_EXPORT ContactGroupEditorDialog : public KDialog
{
Q_OBJECT
public:
/**
* Describes the mode of the contact group editor.
*/
enum Mode
{
CreateMode, ///< Creates a new contact group
......@@ -79,7 +87,10 @@ class AKONADI_CONTACT_EXPORT ContactGroupEditorDialog : public KDialog
virtual void slotButtonClicked( int button );
private:
Akonadi::ContactGroupEditor *mEditor;
//@cond PRIVATE
class Private;
Private* const d;
//@endcond
};
}
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
/*
This file is part of KAddressBook.
This file is part of Akonadi Contact.
Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment