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 #ifndef NDEBUG
00056 #ifndef DEBUG
00057 #define DEBUG (1)
00058 #endif
00059 #endif
00060
00061
00062
00063
00064 #ifndef DEBUG
00065
00066 #endif
00067
00068
00069 #ifdef HAVE_CONFIG_H
00070 #include "config.h"
00071 #endif
00072
00073 #include <unistd.h>
00074 #include <qglobal.h>
00075
00076 #include <kdepimmacros.h>
00077
00078 #if (QT_VERSION < 0x030200)
00079 #error "This is KPilot for KDE3.3 and won't compile with Qt < 3.2.0"
00080 #endif
00081
00082 #ifndef KDE_VERSION
00083 #include <kdeversion.h>
00084 #endif
00085
00086 #if !(KDE_IS_VERSION(3,3,0))
00087 #error "This is KPilot for KDE 3.3 and won't compile with KDE < 3.3.0"
00088 #endif
00089
00090 #include "pilotLinkVersion.h"
00091
00092
00093 #include <qstring.h>
00094
00095 #include <klocale.h>
00096
00097 #ifdef DEBUG
00098 #undef NDEBUG
00099 #undef NO_DEBUG
00100 #endif
00101 #include <kdebug.h>
00102
00103
00104
00105 extern KDE_EXPORT int debug_level;
00106
00107 #ifdef DEBUG
00108 #ifdef __GNUC__
00109 #define KPILOT_FNAMEDEF(l) KPilotDepthCount fname(DEBUGAREA,l,__FUNCTION__)
00110 #else
00111 #define KPILOT_FNAMEDEF(l) KPilotDepthCount fname(DEBUGAREA,l,__FILE__ ":" "__LINE__")
00112 #endif
00113
00114 #define FUNCTIONSETUP KPILOT_FNAMEDEF(1)
00115 #define FUNCTIONSETUPL(l) KPILOT_FNAMEDEF(l)
00116 #define DEBUGAREA 0
00117
00118 #define DEBUGAREA_KPILOT 5510
00119 #define DEBUGAREA_DAEMON 5511
00120 #define DEBUGAREA_CONDUIT 5512
00121 #define DEBUGAREA_DB 5513
00122
00123 #ifdef DEBUG_CERR
00124 #include <iostream>
00125 #endif
00126
00127 class KDE_EXPORT KPilotDepthCount
00128 {
00129 public:
00130 KPilotDepthCount(int area, int level, const char *s);
00131 ~KPilotDepthCount();
00132 QString indent() const;
00133 const char *name() const { return fName; } ;
00134
00135
00136 #ifndef DEBUG_CERR
00137 inline kdbgstream debug(int area=0)
00138 { return kdDebug(debug_level >= fLevel, area); }
00139 #endif
00140
00141 protected:
00142 static int depth;
00143 int fDepth;
00144 int fLevel;
00145 const char *fName;
00146 } ;
00147
00148
00149
00150
00151 #ifdef DEBUG_CERR
00152 #include <iostream>
00153 #define DEBUGKPILOT std::cerr
00154 #define DEBUGDAEMON std::cerr
00155 #define DEBUGCONDUIT std::cerr
00156 #define DEBUGDB std::cerr
00157
00158 using namespace std;
00159
00160 inline std::ostream& operator <<(std::ostream &o, const QString &s)
00161 { if (s.isEmpty()) return o<<"<empty>"; else return o<<s.latin1(); }
00162 inline std::ostream& operator <<(std::ostream &o, const QCString &s)
00163 { if (s.isEmpty()) return o<<"<empty>"; else return o << *s; }
00164
00165
00166
00167 inline std::ostream& operator <<(std::ostream &o, const KPilotDepthCount &d)
00168 { return o << d.indent() << ' ' << d.name(); }
00169
00170 #else
00171
00172
00173
00174
00175 #define DEBUGKPILOT fname.debug(DEBUGAREA_KPILOT)
00176 #define DEBUGDAEMON fname.debug(DEBUGAREA_DAEMON)
00177 #define DEBUGCONDUIT fname.debug(DEBUGAREA_CONDUIT)
00178 #define DEBUGDB fname.debug(DEBUGAREA_DB)
00179
00180 inline kdbgstream& operator <<(kdbgstream o, const KPilotDepthCount &d)
00181 { return o << d.indent() ; }
00182
00183 #endif
00184
00185
00186
00187
00188 #else
00189 #define DEBUGSTREAM kndbgstream
00190 #define DEBUGKPILOT kndDebug()
00191 #define DEBUGDAEMON kndDebug()
00192 #define DEBUGCONDUIT kndDebug()
00193 #define DEBUGDB kndDebug()
00194
00195
00196
00197
00198 #define FUNCTIONSETUP const int fname = 0; Q_UNUSED(fname);
00199 #define FUNCTIONSETUPL(a) const int fname = a; Q_UNUSED(fname);
00200 #endif
00201
00202 #define KPILOT_VERSION "4.6.0 (blivit)"
00203
00204
00205
00206 QString rtExpand(const QString &s, bool richText=true);
00207
00208
00209
00213 KDE_EXPORT QDateTime readTm(const struct tm &t);
00217 KDE_EXPORT struct tm writeTm(const QDateTime &dt);
00218 KDE_EXPORT struct tm writeTm(const QDate &dt);
00219
00220
00221
00222
00223
00224
00225
00226
00227 #define SPACING (10)
00228
00229
00230
00231
00232
00233 #define KPILOT_FREE(a) { if (a) { ::free(a); a=0L; } }
00234 #define KPILOT_DELETE(a) { if (a) { delete a; a=0L; } }
00235
00236
00237
00238
00239
00240
00241
00242 #define TODO_I18N(a) QString::fromLatin1(a)
00243 #define TODO_I18N_P(a,b,c) ((c>1) ? a : b)
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256 #define CSL1(a) QString::fromLatin1(a "")
00257
00258 #endif
|