Commit a6aabab6 authored by Tobias Koenig's avatar Tobias Koenig
Browse files

Added percent() signal to Job and updated documentation and implementation.

svn path=/trunk/KDE/kdepim/libakonadi/; revision=497006
parent b762ee92
......@@ -24,25 +24,45 @@
using namespace PIM;
class DataRequest::DataRequestPrivate
{
public:
DataReference::List mReferences;
QString mPart;
QStringList mAcceptableMimeTypes;
};
DataRequest::DataRequest( const DataReference::List &references, const QString &part,
const QStringList &acceptableMimeTypes )
: d( new DataRequestPrivate )
{
d->mReferences = references;
d->mPart = part;
d->mAcceptableMimeTypes = acceptableMimeTypes;
}
DataRequest::~DataRequest()
{
delete d;
d = 0;
}
int DataRequest::count() const
{
// TODO: return real data
return 0;
}
QByteArray DataRequest::data( int index ) const
QByteArray DataRequest::data( int ) const
{
// TODO: return real data
return QByteArray();
}
QByteArray DataRequest::mimeType( int index ) const
QByteArray DataRequest::mimeType( int ) const
{
// TODO: return real data
return QByteArray();
}
void DataRequest::doStart()
......
......@@ -77,17 +77,22 @@ class DataRequest : public Job
int count() const;
/**
Returns the plain data of the data item at the given @param index.
Returns the plain data of the data item at the given @param index,
or an empty @see QByteArray if @param index is >= @see count().
*/
QByteArray data( int index = 0 ) const;
/**
Returns the mime type of the data item at the given @param index.
Returns the mime type of the data item at the given @param index,
or an empty @see QByteArray if @param index is >= @see count().
*/
QByteArray mimeType( int index = 0 ) const;
private:
void doStart();
class DataRequestPrivate;
DataRequestPrivate *d;
};
}
......
......@@ -170,6 +170,14 @@ class Job : public QObject
*/
void done( PIM::Job *job );
/**
Progress signal showing the overall progress of the job.
@param job The job that emitted this signal.
@param percent The percentage.
*/
void percent( PIM::Job *job, unsigned int percent );
protected:
/**
Subclasses have to use this method to set an error code.
......
......@@ -24,13 +24,22 @@
using namespace PIM;
class Query::QueryPrivate
{
public:
QString mPattern;
};
Query::Query()
: d( new QueryPrivate )
{
}
Query::~Query()
{
delete d;
d = 0;
}
void Query::setQueryPattern( const QString &pattern )
......@@ -40,15 +49,18 @@ void Query::setQueryPattern( const QString &pattern )
QList<PIM::DataReference> Query::result() const
{
// TODO: return real data
return QList<PIM::DataReference>();
}
void Query::doSetQueryPattern( const QString &pattern )
{
d->mPattern = pattern;
}
void Query::doStart()
{
// start communication with pim storage service here
// TODO: start communication with pim storage service here
}
#include "query.moc"
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