• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

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 }

akonadi

Skip menu "akonadi"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal