tdeioslave/imap4

selectinfo.h
1#ifndef _IMAPINFO_H
2#define _IMAPINFO_H
3/**********************************************************************
4 *
5 * imapinfo.h - IMAP4rev1 SELECT / EXAMINE handler
6 * Copyright (C) 2000 Sven Carstens <s.carstens@gmx.de>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 *
22 * Send comments and bug fixes to
23 *
24 *********************************************************************/
25
26#include <tqstringlist.h>
27#include <tqstring.h>
28
29//class handling the info we get on EXAMINE and SELECT
30class imapInfo
31{
32public:
33
34 imapInfo ();
35 imapInfo (const TQStringList &);
36 imapInfo (const imapInfo &);
37 imapInfo & operator = (const imapInfo &);
38
39 ulong _flags (const TQString &) const;
40
41 void setCount (ulong l)
42 {
43 countAvailable_ = true;
44 count_ = l;
45 }
46
47 void setRecent (ulong l)
48 {
49 recentAvailable_ = true;
50 recent_ = l;
51 }
52
53 void setUnseen (ulong l)
54 {
55 unseenAvailable_ = true;
56 unseen_ = l;
57 }
58
59 void setUidValidity (ulong l)
60 {
61 uidValidityAvailable_ = true;
62 uidValidity_ = l;
63 }
64
65 void setUidNext (ulong l)
66 {
67 uidNextAvailable_ = true;
68 uidNext_ = l;
69 }
70
71 void setFlags (ulong l)
72 {
73 flagsAvailable_ = true;
74 flags_ = l;
75 }
76
77 void setFlags (const TQString & inFlag)
78 {
79 flagsAvailable_ = true;
80 flags_ = _flags (inFlag);
81 }
82
83 void setPermanentFlags (ulong l)
84 {
85 permanentFlagsAvailable_ = true;
86 permanentFlags_ = l;
87 }
88
89 void setPermanentFlags (const TQString & inFlag)
90 {
91 permanentFlagsAvailable_ = true;
92 permanentFlags_ = _flags (inFlag);
93 }
94
95 void setReadWrite (bool b)
96 {
97 readWriteAvailable_ = true;
98 readWrite_ = b;
99 }
100
101 ulong count () const
102 {
103 return count_;
104 }
105
106 ulong recent () const
107 {
108 return recent_;
109 }
110
111 ulong unseen () const
112 {
113 return unseen_;
114 }
115
116 ulong uidValidity () const
117 {
118 return uidValidity_;
119 }
120
121 ulong uidNext () const
122 {
123 return uidNext_;
124 }
125
126 ulong flags () const
127 {
128 return flags_;
129 }
130
131 ulong permanentFlags () const
132 {
133 return permanentFlags_;
134 }
135
136 bool readWrite () const
137 {
138 return readWrite_;
139 }
140
141 ulong countAvailable () const
142 {
143 return countAvailable_;
144 }
145
146 ulong recentAvailable () const
147 {
148 return recentAvailable_;
149 }
150
151 ulong unseenAvailable () const
152 {
153 return unseenAvailable_;
154 }
155
156 ulong uidValidityAvailable () const
157 {
158 return uidValidityAvailable_;
159 }
160
161 ulong uidNextAvailable () const
162 {
163 return uidNextAvailable_;
164 }
165
166 ulong flagsAvailable () const
167 {
168 return flagsAvailable_;
169 }
170
171 ulong permanentFlagsAvailable () const
172 {
173 return permanentFlagsAvailable_;
174 }
175
176 bool readWriteAvailable () const
177 {
178 return readWriteAvailable_;
179 }
180
181private:
182
183 ulong count_;
184 ulong recent_;
185 ulong unseen_;
186 ulong uidValidity_;
187 ulong uidNext_;
188 ulong flags_;
189 ulong permanentFlags_;
190 bool readWrite_;
191
192 bool countAvailable_;
193 bool recentAvailable_;
194 bool unseenAvailable_;
195 bool uidValidityAvailable_;
196 bool uidNextAvailable_;
197 bool flagsAvailable_;
198 bool permanentFlagsAvailable_;
199 bool readWriteAvailable_;
200};
201
202#endif