Commit b29ab3e8 authored by Tobias Koenig's avatar Tobias Koenig

Add API REVIEW notes and fixed some smaller issues

svn path=/trunk/KDE/kdepimlibs/; revision=1127039
parent 5b72e8d3
......@@ -38,6 +38,7 @@ namespace Akonadi {
* @author Tobias Koenig <tokoe@kde.org>
* @since 4.5
*/
//AK_REVIEW: extend api docs (usage), move class to libkabc
class AKONADI_CONTACT_EXPORT AbstractContactFormatter
{
public:
......@@ -46,8 +47,9 @@ class AKONADI_CONTACT_EXPORT AbstractContactFormatter
*/
enum HtmlForm
{
FullForm, ///< Creates a complete HTML document
DivForm ///< Creates a div HTML element that can be embedded.
SelfcontainedForm, ///< Creates a complete HTML document
EmbeddableForm, ///< Creates a div HTML element that can be embedded.
UserForm = SelfcontainedForm + 42 ///< Point for extension
};
/**
......@@ -58,17 +60,22 @@ class AKONADI_CONTACT_EXPORT AbstractContactFormatter
/**
* Sets the @p contact that shall be formatted.
*/
//AK_REVIEW: add getter and make it non-abstract
virtual void setContact( const KABC::Addressee &contact ) = 0;
//AK_REVIEW: add method setItem( const Akonadi::Item ) and getter
/**
* Sets the custom field @p descriptions that shall be used.
*/
//AK_REVIEW: change QVariantList to QList<QMap<QString, QVariant>>
//AK_REVIEW: add getter and make it non-abstract
virtual void setCustomFieldDescriptions( const QVariantList &descriptions ) = 0;
/**
* Returns the contact formatted as HTML
*/
virtual QString toHtml( HtmlForm form = FullForm ) const = 0;
virtual QString toHtml( HtmlForm form = SelfcontainedForm ) const = 0;
};
}
......
......@@ -26,8 +26,6 @@
#include <QtGui/QWidget>
class KLineEdit;
namespace KABC {
class ContactGroup;
}
......
......@@ -95,7 +95,7 @@ class AKONADI_CONTACT_EXPORT ContactGroupSearchJob : public ItemSearchJob
* This needs to be called before calling setQuery() to have an effect.
* By default, the number of results is unlimited.
*
* @since 4.5
* @since 4.4.3
*/
void setLimit( int limit );
......
......@@ -120,6 +120,7 @@ class AKONADI_CONTACT_EXPORT ContactSearchJob : public ItemSearchJob
* Sets the @p criterion and @p value for the search.
*
* @note ExactMatch is used for the matching.
* @todo Merge with the method below in KDE5
*/
void setQuery( Criterion criterion, const QString &value );
......
......@@ -57,6 +57,7 @@ namespace Akonadi {
* @author Tobias Koenig <tokoe@kde.org>
* @since 4.5
*/
//AK_REVIEW: rename to ContactsFilterProxyModel, extend API docs
class AKONADI_CONTACT_EXPORT ContactsFilterModel : public QSortFilterProxyModel
{
Q_OBJECT
......@@ -67,7 +68,7 @@ class AKONADI_CONTACT_EXPORT ContactsFilterModel : public QSortFilterProxyModel
*
* @param parent The parent object.
*/
ContactsFilterModel( QObject *parent );
explicit ContactsFilterModel( QObject *parent = 0 );
/**
* Destroys the contacts filter model.
......
......@@ -161,13 +161,13 @@ class AKONADI_CONTACT_EXPORT ContactsTreeModel : public EntityTreeModel
*/
enum Roles
{
DateRole = UserRole + 1 ///< The QDate object for the current index.
DateRole = UserRole + 1, ///< The QDate object for the current index.
UserRole = DateRole + 42
};
/**
* Creates a new contacts tree model.
*
* @param session The Session to use to communicate with Akonadi.
* @param monitor The ChangeRecorder whose entities should be represented in the model.
* @param parent The parent object.
*/
......@@ -188,10 +188,12 @@ class AKONADI_CONTACT_EXPORT ContactsTreeModel : public EntityTreeModel
*/
Columns columns() const;
//@cond PRIVATE
virtual QVariant entityData( const Item &item, int column, int role = Qt::DisplayRole ) const;
virtual QVariant entityData( const Collection &collection, int column, int role = Qt::DisplayRole ) const;
virtual QVariant entityHeaderData( int section, Qt::Orientation orientation, int role, HeaderGroup headerGroup ) const;
virtual int entityColumnCount( HeaderGroup headerGroup ) const;
//@endcond
private:
//@cond PRIVATE
......
......@@ -62,6 +62,7 @@ namespace Akonadi {
* @author Tobias Koenig <tokoe@kde.org>
* @since 4.5
*/
//AK_REVIEW: rename to EmailAddressSelectionWidget
class AKONADI_CONTACT_EXPORT EmailAddressSelectionView : public QWidget
{
Q_OBJECT
......@@ -70,6 +71,7 @@ class AKONADI_CONTACT_EXPORT EmailAddressSelectionView : public QWidget
/**
* The selection of an email address.
*/
//AK_REVIEW: move to EmailAddressSelection class
class AKONADI_CONTACT_EXPORT Selection
{
public:
......
......@@ -249,7 +249,7 @@ QString StandardContactFormatter::toHtml( HtmlForm form ) const
strAddr.append( customData );
strAddr.append( QString::fromLatin1( "</table></div>\n" ) );
if ( form == DivForm )
if ( form == EmbeddableForm )
return strAddr;
const QString document = QString::fromLatin1(
......
......@@ -76,7 +76,7 @@ class AKONADI_CONTACT_EXPORT StandardContactFormatter : public AbstractContactFo
/**
* Returns the contact formatted as HTML
*/
virtual QString toHtml( HtmlForm form = FullForm ) const;
virtual QString toHtml( HtmlForm form = SelfcontainedForm ) const;
private:
//@cond PRIVATE
......
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