akonadi
itemfetchscope.cpp
00001 /* 00002 Copyright (c) 2008 Kevin Krammer <kevin.krammer@gmx.at> 00003 00004 This library is free software; you can redistribute it and/or modify it 00005 under the terms of the GNU Library General Public License as published by 00006 the Free Software Foundation; either version 2 of the License, or (at your 00007 option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00012 License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to the 00016 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 02110-1301, USA. 00018 */ 00019 00020 #include "itemfetchscope.h" 00021 00022 #include "itemfetchscope_p.h" 00023 00024 #include <QtCore/QStringList> 00025 00026 using namespace Akonadi; 00027 00028 ItemFetchScope::ItemFetchScope() 00029 { 00030 d = new ItemFetchScopePrivate(); 00031 } 00032 00033 ItemFetchScope::ItemFetchScope( const ItemFetchScope &other ) 00034 : d( other.d ) 00035 { 00036 } 00037 00038 ItemFetchScope::~ItemFetchScope() 00039 { 00040 } 00041 00042 ItemFetchScope &ItemFetchScope::operator=( const ItemFetchScope &other ) 00043 { 00044 if ( &other != this ) 00045 d = other.d; 00046 00047 return *this; 00048 } 00049 00050 QSet< QByteArray > ItemFetchScope::payloadParts() const 00051 { 00052 return d->mPayloadParts; 00053 } 00054 00055 void ItemFetchScope::fetchPayloadPart(const QByteArray & part, bool fetch) 00056 { 00057 if ( fetch ) 00058 d->mPayloadParts.insert( part ); 00059 else 00060 d->mPayloadParts.remove( part ); 00061 } 00062 00063 bool ItemFetchScope::fullPayload() const 00064 { 00065 return d->mFullPayload; 00066 } 00067 00068 void ItemFetchScope::fetchFullPayload(bool fetch) 00069 { 00070 d->mFullPayload = fetch; 00071 } 00072 00073 QSet< QByteArray > ItemFetchScope::attributes() const 00074 { 00075 return d->mAttributes; 00076 } 00077 00078 void ItemFetchScope::fetchAttribute(const QByteArray & type, bool fetch) 00079 { 00080 if ( fetch ) 00081 d->mAttributes.insert( type ); 00082 else 00083 d->mAttributes.remove( type ); 00084 } 00085 00086 bool ItemFetchScope::allAttributes() const 00087 { 00088 return d->mAllAttributes; 00089 } 00090 00091 void ItemFetchScope::fetchAllAttributes(bool fetch) 00092 { 00093 d->mAllAttributes = fetch; 00094 } 00095 00096 bool ItemFetchScope::isEmpty() const 00097 { 00098 return d->mPayloadParts.isEmpty() && d->mAttributes.isEmpty() && !d->mFullPayload && !d->mAllAttributes; 00099 } 00100 00101 bool ItemFetchScope::cacheOnly() const 00102 { 00103 return d->mCacheOnly; 00104 } 00105 00106 void ItemFetchScope::setCacheOnly(bool cacheOnly) 00107 { 00108 d->mCacheOnly = cacheOnly; 00109 } 00110 00111 ItemFetchScope::AncestorRetrieval ItemFetchScope::ancestorRetrieval() const 00112 { 00113 return d->mAncestorDepth; 00114 } 00115 00116 void ItemFetchScope::setAncestorRetrieval( AncestorRetrieval depth ) 00117 { 00118 d->mAncestorDepth = depth; 00119 } 00120 00121 void ItemFetchScope::setFetchModificationTime( bool retrieveMtime ) 00122 { 00123 d->mFetchMtime = retrieveMtime; 00124 } 00125 00126 bool ItemFetchScope::fetchModificationTime() const 00127 { 00128 return d->mFetchMtime; 00129 } 00130
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:52:57 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:52:57 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.