kmail

kmglobal.h
1/*
2 * kmail: KDE mail client
3 * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20// removed almost everything: Sven Radej <radej@kde.org>
21
22//this could all go int kmkernel.h
23#ifndef kmglobal_h
24#define kmglobal_h
25
26typedef enum
27{
28 FCNTL,
29 procmail_lockfile,
30 mutt_dotlock,
31 mutt_dotlock_privileged,
32 lock_none
33} LockType;
34
35/*
36 * Define the possible units to use for measuring message expiry.
37 * expireNever is used to switch off message expiry, and expireMaxUnits
38 * must always be the last in the list (for bounds checking).
39 */
40typedef enum {
41 expireNever,
42 expireDays,
43 expireWeeks,
44 expireMonths,
45 expireMaxUnits
46} ExpireUnits;
47
48#define HDR_FROM 0x01
49#define HDR_REPLY_TO 0x02
50#define HDR_TO 0x04
51#define HDR_CC 0x08
52#define HDR_BCC 0x10
53#define HDR_SUBJECT 0x20
54#define HDR_NEWSGROUPS 0x40
55#define HDR_FOLLOWUP_TO 0x80
56#define HDR_IDENTITY 0x100
57#define HDR_TRANSPORT 0x200
58#define HDR_FCC 0x400
59#define HDR_DICTIONARY 0x800
60#define HDR_ALL 0xfff
61
62#define HDR_STANDARD (HDR_SUBJECT|HDR_TO|HDR_CC)
63
64#include <algorithm>
65
66namespace KMail {
67// List of prime numbers shamelessly stolen from GCC STL
68 enum { num_primes = 29 };
69
70 static const unsigned long prime_list[ num_primes ] =
71 {
72 31ul, 53ul, 97ul, 193ul, 389ul,
73 769ul, 1543ul, 3079ul, 6151ul, 12289ul,
74 24593ul, 49157ul, 98317ul, 196613ul, 393241ul,
75 786433ul, 1572869ul, 3145739ul, 6291469ul, 12582917ul,
76 25165843ul, 50331653ul, 100663319ul, 201326611ul, 402653189ul,
77 805306457ul, 1610612741ul, 3221225473ul, 4294967291ul
78 };
79
80 inline unsigned long nextPrime( unsigned long n )
81 {
82 const unsigned long *first = prime_list;
83 const unsigned long *last = prime_list + num_primes;
84 const unsigned long *pos = std::lower_bound( first, last, n );
85 return pos == last ? *( last - 1 ) : *pos;
86 }
87
88}
89
91extern const char* aboutText;
92#endif
folderdiaquotatab.h
Definition: aboutdata.cpp:40