00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "collectionfetchscope.h"
00022
00023 #include <QString>
00024 #include <QStringList>
00025
00026 namespace Akonadi {
00027
00028 class CollectionFetchScopePrivate : public QSharedData
00029 {
00030 public:
00031 CollectionFetchScopePrivate() :
00032 ancestorDepth( CollectionFetchScope::None ),
00033 unsubscribed( false ),
00034 statistics( false )
00035 {
00036 }
00037
00038 CollectionFetchScopePrivate( const CollectionFetchScopePrivate &other )
00039 : QSharedData( other )
00040 {
00041 resource = other.resource;
00042 contentMimeTypes = other.contentMimeTypes;
00043 ancestorDepth = other.ancestorDepth;
00044 unsubscribed = other.unsubscribed;
00045 statistics = other.statistics;
00046 }
00047
00048 public:
00049 QString resource;
00050 QStringList contentMimeTypes;
00051 CollectionFetchScope::AncestorRetrieval ancestorDepth;
00052 bool unsubscribed;
00053 bool statistics;
00054 };
00055
00056 CollectionFetchScope::CollectionFetchScope()
00057 {
00058 d = new CollectionFetchScopePrivate();
00059 }
00060
00061 CollectionFetchScope::CollectionFetchScope( const CollectionFetchScope &other )
00062 : d( other.d )
00063 {
00064 }
00065
00066 CollectionFetchScope::~CollectionFetchScope()
00067 {
00068 }
00069
00070 CollectionFetchScope &CollectionFetchScope::operator=( const CollectionFetchScope &other )
00071 {
00072 if ( &other != this )
00073 d = other.d;
00074
00075 return *this;
00076 }
00077
00078 bool CollectionFetchScope::isEmpty () const
00079 {
00080 return d->resource.isEmpty() && d->contentMimeTypes.isEmpty() && !d->statistics && !d->unsubscribed && d->ancestorDepth == None;
00081 }
00082
00083 bool CollectionFetchScope::includeUnubscribed () const
00084 {
00085 return includeUnsubscribed();
00086 }
00087
00088 bool CollectionFetchScope::includeUnsubscribed () const
00089 {
00090 return d->unsubscribed;
00091 }
00092
00093 void CollectionFetchScope::setIncludeUnsubscribed (bool include)
00094 {
00095 d->unsubscribed = include;
00096 }
00097
00098 bool CollectionFetchScope::includeStatistics () const
00099 {
00100 return d->statistics;
00101 }
00102
00103 void CollectionFetchScope::setIncludeStatistics (bool include)
00104 {
00105 d->statistics = include;
00106 }
00107
00108 QString CollectionFetchScope::resource () const
00109 {
00110 return d->resource;
00111 }
00112
00113 void CollectionFetchScope::setResource (const QString & resource)
00114 {
00115 d->resource = resource;
00116 }
00117
00118 QStringList CollectionFetchScope::contentMimeTypes () const
00119 {
00120 return d->contentMimeTypes;
00121 }
00122
00123 void CollectionFetchScope::setContentMimeTypes (const QStringList & mimeTypes)
00124 {
00125 d->contentMimeTypes = mimeTypes;
00126 }
00127
00128 CollectionFetchScope::AncestorRetrieval CollectionFetchScope::ancestorRetrieval() const
00129 {
00130 return d->ancestorDepth;
00131 }
00132
00133 void CollectionFetchScope::setAncestorRetrieval( AncestorRetrieval ancestorDepth )
00134 {
00135 d->ancestorDepth = ancestorDepth;
00136 }
00137
00138 }