kmail

kmglobal.h

Go to the documentation of this file.
00001 /*
00002  * kmail: KDE mail client
00003  * Copyright (c) 1996-1998 Stefan Taferner <taferner@kde.org>
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  *
00019  */
00020 //  removed almost everything: Sven Radej <radej@kde.org>
00021 
00022 //this could all go int kmkernel.h
00023 #ifndef kmglobal_h
00024 #define kmglobal_h
00025 
00026 typedef enum
00027 {
00028     FCNTL,
00029     procmail_lockfile,
00030     mutt_dotlock,
00031     mutt_dotlock_privileged,
00032     lock_none
00033 } LockType;
00034 
00035 /*
00036  * Define the possible units to use for measuring message expiry.
00037  * expireNever is used to switch off message expiry, and expireMaxUnits
00038  * must always be the last in the list (for bounds checking).
00039  */
00040 typedef enum {
00041   expireNever,
00042   expireDays,
00043   expireWeeks,
00044   expireMonths,
00045   expireMaxUnits
00046 } ExpireUnits;
00047 
00048 #define HDR_FROM     0x01
00049 #define HDR_REPLY_TO 0x02
00050 #define HDR_TO       0x04
00051 #define HDR_CC       0x08
00052 #define HDR_BCC      0x10
00053 #define HDR_SUBJECT  0x20
00054 #define HDR_NEWSGROUPS  0x40
00055 #define HDR_FOLLOWUP_TO 0x80
00056 #define HDR_IDENTITY 0x100
00057 #define HDR_TRANSPORT 0x200
00058 #define HDR_FCC       0x400
00059 #define HDR_DICTIONARY 0x800
00060 #define HDR_ALL      0xfff
00061 
00062 #define HDR_STANDARD (HDR_SUBJECT|HDR_TO|HDR_CC)
00063 
00064 #include <algorithm>
00065 
00066 namespace KMail {
00067 // List of prime numbers shamelessly stolen from GCC STL
00068   enum { num_primes = 29 };
00069 
00070   static const unsigned long prime_list[ num_primes ] =
00071   {
00072     31ul,        53ul,         97ul,         193ul,       389ul,
00073     769ul,       1543ul,       3079ul,       6151ul,      12289ul,
00074     24593ul,     49157ul,      98317ul,      196613ul,    393241ul,
00075     786433ul,    1572869ul,    3145739ul,    6291469ul,   12582917ul,
00076     25165843ul,  50331653ul,   100663319ul,  201326611ul, 402653189ul,
00077     805306457ul, 1610612741ul, 3221225473ul, 4294967291ul
00078   };
00079 
00080   inline unsigned long nextPrime( unsigned long n )
00081   {
00082     const unsigned long *first = prime_list;
00083     const unsigned long *last = prime_list + num_primes;
00084     const unsigned long *pos = std::lower_bound( first, last, n );
00085     return pos == last ? *( last - 1 ) : *pos;
00086   }
00087 
00088 }
00089 
00091 extern const char* aboutText;
00092 #endif