• Skip to content
  • Skip to link menu
KDE 4.8 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

KIMAP Library

imapset.h
00001 /*
00002     Copyright (c) 2007 Volker Krause <vkrause@kde.org>
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 #ifndef KIMAP_IMAPSET_H
00021 #define KIMAP_IMAPSET_H
00022 
00023 #include "kimap_export.h"
00024 
00025 #include <QtCore/QByteArray>
00026 #include <QtCore/QDebug>
00027 #include <QtCore/QList>
00028 #include <QtCore/QMetaType>
00029 #include <QtCore/QSharedDataPointer>
00030 
00031 namespace KIMAP {
00032 
00037 class KIMAP_EXPORT ImapInterval
00038 {
00039   public:
00043     typedef qint64 Id;
00044 
00048     typedef QList<ImapInterval> List;
00049 
00053     ImapInterval();
00054 
00058     ImapInterval( const ImapInterval &other );
00059 
00065     explicit ImapInterval( Id begin, Id end = 0 );
00066 
00070     ~ImapInterval();
00071 
00075     ImapInterval& operator=( const ImapInterval &other );
00076 
00080     bool operator==( const ImapInterval &other ) const;
00081 
00086     Id size() const;
00087 
00091     bool hasDefinedBegin() const;
00092 
00097     Id begin() const;
00098 
00102     bool hasDefinedEnd() const;
00103 
00108     Id end() const;
00109 
00113     void setBegin( Id value );
00114 
00118     void setEnd( Id value );
00119 
00123     QByteArray toImapSequence() const;
00124 
00128     static ImapInterval fromImapSequence( const QByteArray &sequence );
00129 
00130   private:
00131     class Private;
00132     QSharedDataPointer<Private> d;
00133 };
00134 
00140 class KIMAP_EXPORT ImapSet
00141 {
00142   public:
00146     typedef qint64 Id;
00147 
00151     ImapSet();
00152 
00156     ImapSet( Id begin, Id end );
00157 
00161     explicit ImapSet( Id value );
00162 
00166     ImapSet( const ImapSet &other );
00167 
00171     ~ImapSet();
00172 
00176     ImapSet& operator=( const ImapSet &other );
00177 
00181     bool operator==( const ImapSet &other ) const;
00182 
00189     void add( Id value );
00190 
00197     void add( const QList<Id> &values );
00198 
00203     void add( const ImapInterval &interval );
00204 
00208     QByteArray toImapSequenceSet() const;
00209 
00213     static ImapSet fromImapSequenceSet( const QByteArray &sequence );
00214 
00218     ImapInterval::List intervals() const;
00219 
00223     bool isEmpty() const;
00224 
00225   private:
00226     class Private;
00227     QSharedDataPointer<Private> d;
00228 };
00229 
00230 }
00231 
00232 KIMAP_EXPORT QDebug& operator<<( QDebug& d, const KIMAP::ImapInterval &interval );
00233 KIMAP_EXPORT QDebug& operator<<( QDebug& d, const KIMAP::ImapSet &set );
00234 
00235 Q_DECLARE_METATYPE( KIMAP::ImapInterval )
00236 Q_DECLARE_METATYPE( KIMAP::ImapInterval::List )
00237 Q_DECLARE_METATYPE( KIMAP::ImapSet )
00238 
00239 #endif

KIMAP Library

Skip menu "KIMAP Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.6.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