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