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
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 7 2012 23:55:08 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 7 2012 23:55:08 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.