00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
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 
00037 
00038 
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 
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