kpilot/lib
options.h00001 #ifndef _KPILOT_OPTIONS_H
00002 #define _KPILOT_OPTIONS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #define USE_KHEXEDIT
00041
00042
00043
00044
00045 #ifndef QT_NO_ASCII_CAST
00046
00047 #endif
00048 #ifndef QT_NO_CAST_ASCII
00049
00050 #endif
00051
00052
00053
00054
00055 #undef NDEBUG
00056
00057
00058
00059
00060
00061 #ifndef DEBUG
00062 #define DEBUG (1)
00063 #endif
00064 #define DEBUG_CERR (1)
00065
00066 #ifdef HAVE_CONFIG_H
00067 #include "config.h"
00068 #endif
00069
00070 #include <unistd.h>
00071 #include <qglobal.h>
00072
00073 #if (QT_VERSION < 0x030300)
00074 #error "This is KPilot for KDE3.5 and won't compile with Qt < 3.3.0"
00075 #endif
00076
00077 #ifndef KDE_VERSION
00078 #include <kdeversion.h>
00079 #endif
00080
00081 #if !(KDE_IS_VERSION(3,4,0))
00082 #error "This is KPilot for (really) KDE 3.5 and won't compile with KDE < 3.4.0"
00083 #endif
00084
00085 #if !(KDE_IS_VERSION(3,5,0))
00086 #warning "This is KPilot for KDE 3.5 and might not compile with KDE < 3.5.0"
00087 #endif
00088
00089 #include "pilotLinkVersion.h"
00090
00091
00092 #include <qstring.h>
00093
00094 #include <klocale.h>
00095
00096 #ifdef DEBUG
00097 #undef NDEBUG
00098 #undef NO_DEBUG
00099 #endif
00100 #include <kdebug.h>
00101
00102
00103
00104 extern KDE_EXPORT int debug_level;
00105
00106 #ifdef DEBUG
00107 #ifdef __GNUC__
00108 #define KPILOT_FNAMEDEF(l) KPilotDepthCount fname(DEBUGAREA,l,__FUNCTION__)
00109 #else
00110 #define KPILOT_FNAMEDEF(l) KPilotDepthCount fname(DEBUGAREA,l,__FILE__ ":" "__LINE__")
00111 #endif
00112
00113 #define FUNCTIONSETUP KPILOT_FNAMEDEF(1)
00114 #define FUNCTIONSETUPL(l) KPILOT_FNAMEDEF(l)
00115 #define DEBUGAREA 0
00116
00117 #define DEBUGAREA_KPILOT 5510
00118 #define DEBUGAREA_LIBRARY 5511
00119 #define DEBUGAREA_CONDUIT 5512
00120 #define DEBUGAREA_DB 5513
00121
00122 #ifdef DEBUG_CERR
00123 #include <iostream>
00124 #endif
00125
00126 class KDE_EXPORT KPilotDepthCount
00127 {
00128 public:
00129 KPilotDepthCount(int area, int level, const char *s);
00130 ~KPilotDepthCount();
00131 QString indent() const;
00132 const char *name() const { return fName; } ;
00133
00134
00135 #ifndef DEBUG_CERR
00136 inline kdbgstream debug(int area=0)
00137 { return kdDebug(debug_level >= fLevel, area); }
00138 #endif
00139
00140 protected:
00141 static int depth;
00142 int fDepth;
00143 int fLevel;
00144 const char *fName;
00145 } ;
00146
00147
00148
00149
00150 #ifdef DEBUG_CERR
00151 #include <iostream>
00152 #define DEBUGKPILOT std::cerr
00153 #define DEBUGLIBRARY std::cerr
00154 #define DEBUGCONDUIT std::cerr
00155 #define DEBUGDB std::cerr
00156 using namespace std;
00157
00158 inline std::ostream& operator <<(std::ostream &o, const QString &s)
00159 { if (s.isEmpty()) return o<<"<empty>"; else return o<<s.latin1(); }
00160 inline std::ostream& operator <<(std::ostream &o, const QCString &s)
00161 { if (s.isEmpty()) return o<<"<empty>"; else return o << *s; }
00162
00163
00164
00165 inline std::ostream& operator <<(std::ostream &o, const KPilotDepthCount &d)
00166 { return o << d.indent() << ' ' << d.name(); }
00167
00168 #else
00169
00170
00171
00172
00173 #define DEBUGKPILOT fname.debug(DEBUGAREA_KPILOT)
00174 #define DEBUGLIBRARY fname.debug(DEBUGAREA_LIBRARY)
00175 #define DEBUGCONDUIT fname.debug(DEBUGAREA_CONDUIT)
00176 #define DEBUGDB fname.debug(DEBUGAREA_DB)
00177
00178 inline kdbgstream& operator <<(kdbgstream o, const KPilotDepthCount &d)
00179 { return o << d.indent() ; }
00180
00181 #endif
00182
00183
00184
00185
00186 #else
00187 #define DEBUGSTREAM kndbgstream
00188 #define DEBUGKPILOT kndDebug()
00189 #define DEBUGLIBRARY kndDebug()
00190 #define DEBUGCONDUIT kndDebug()
00191 #define DEBUGDB kndDebug()
00192
00193
00194
00195
00196 #define FUNCTIONSETUP const int fname = 0; Q_UNUSED(fname);
00197 #define FUNCTIONSETUPL(a) const int fname = a; Q_UNUSED(fname);
00198 #endif
00199
00200 #define KPILOT_VERSION "4.9.0 (depth9)"
00201
00202
00203
00204 QString rtExpand(const QString &s, bool richText=true);
00205
00206
00207
00211 KDE_EXPORT QDateTime readTm(const struct tm &t);
00215 KDE_EXPORT struct tm writeTm(const QDateTime &dt);
00216 KDE_EXPORT struct tm writeTm(const QDate &dt);
00217
00218
00219
00220
00221
00222
00223
00224
00225 #define SPACING (10)
00226
00227
00228
00229
00230
00231 #define KPILOT_FREE(a) { if (a) { ::free(a); a=0L; } }
00232 #define KPILOT_DELETE(a) { if (a) { delete a; a=0L; } }
00233
00234
00235
00236
00237
00238
00239
00240 #define TODO_I18N(a) QString::fromLatin1(a)
00241 #define TODO_I18N_P(a,b,c) ((c>1) ? a : b)
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254 #define CSL1(a) QString::fromLatin1(a "")
00255
00256 #endif
|