• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KIMAP Library

  • kimap
imapset.h
1/*
2 Copyright (c) 2007 Volker Krause <vkrause@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#ifndef KIMAP_IMAPSET_H
21#define KIMAP_IMAPSET_H
22
23#include "kimap_export.h"
24
25#include <QtCore/QByteArray>
26#include <QtCore/QDebug>
27#include <QtCore/QList>
28#include <QtCore/QMetaType>
29#include <QtCore/QSharedDataPointer>
30
31namespace KIMAP {
32
37class KIMAP_EXPORT ImapInterval
38{
39 public:
43 typedef qint64 Id;
44
48 typedef QList<ImapInterval> List;
49
53 ImapInterval();
54
58 ImapInterval( const ImapInterval &other );
59
65 explicit ImapInterval( Id begin, Id end = 0 );
66
70 ~ImapInterval();
71
75 ImapInterval& operator=( const ImapInterval &other );
76
80 bool operator==( const ImapInterval &other ) const;
81
86 Id size() const;
87
91 bool hasDefinedBegin() const;
92
97 Id begin() const;
98
102 bool hasDefinedEnd() const;
103
108 Id end() const;
109
113 void setBegin( Id value );
114
118 void setEnd( Id value );
119
123 QByteArray toImapSequence() const;
124
128 static ImapInterval fromImapSequence( const QByteArray &sequence );
129
130 private:
131 class Private;
132 QSharedDataPointer<Private> d;
133};
134
140class KIMAP_EXPORT ImapSet
141{
142 public:
146 typedef qint64 Id;
147
151 ImapSet();
152
156 ImapSet( Id begin, Id end );
157
161 explicit ImapSet( Id value );
162
166 ImapSet( const ImapSet &other );
167
171 ~ImapSet();
172
176 ImapSet& operator=( const ImapSet &other );
177
181 bool operator==( const ImapSet &other ) const;
182
189 void add( Id value );
190
197 void add( const QList<Id> &values );
198
204 void add( const ImapInterval &interval );
205
209 QByteArray toImapSequenceSet() const;
210
214 static ImapSet fromImapSequenceSet( const QByteArray &sequence );
215
219 ImapInterval::List intervals() const;
220
224 bool isEmpty() const;
225
226 private:
227 class Private;
228 QSharedDataPointer<Private> d;
229};
230
231}
232
233KIMAP_EXPORT QDebug& operator<<( QDebug& d, const KIMAP::ImapInterval &interval );
234KIMAP_EXPORT QDebug& operator<<( QDebug& d, const KIMAP::ImapSet &set );
235
236Q_DECLARE_METATYPE( KIMAP::ImapInterval )
237Q_DECLARE_METATYPE( KIMAP::ImapInterval::List )
238Q_DECLARE_METATYPE( KIMAP::ImapSet )
239
240#endif
KIMAP::ImapInterval
Represents a single interval in an ImapSet.
Definition imapset.h:38
KIMAP::ImapInterval::List
QList< ImapInterval > List
A list of ImapInterval objects.
Definition imapset.h:48
KIMAP::ImapInterval::Id
qint64 Id
Describes the ids stored in the interval.
Definition imapset.h:43
KIMAP::ImapSet
Represents a set of natural numbers (1-> ) in a as compact as possible form.
Definition imapset.h:141
KIMAP::ImapSet::Id
qint64 Id
Describes the ids stored in the set.
Definition imapset.h:146
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIMAP Library

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

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal