kpilot
options.hGo to the documentation of this file.00001 #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 #include "config.h"
00038
00039 #include <qglobal.h>
00040 #include <qnamespace.h>
00041 #include <qstring.h>
00042
00043 #if (QT_VERSION < 0x030300)
00044 #error "This is KPilot for KDE3.5 and won't compile with Qt < 3.3.0"
00045 #endif
00046
00047 #include <kdebug.h>
00048 #include <kdeversion.h>
00049 #include <klocale.h>
00050
00051 #if !(KDE_IS_VERSION(3,4,0))
00052 #error "This is KPilot for (really) KDE 3.5 and won't compile with KDE < 3.4.0"
00053 #endif
00054
00055 #if !(KDE_IS_VERSION(3,5,0))
00056 #warning "This is KPilot for KDE 3.5 and might not compile with KDE < 3.5.0"
00057 #endif
00058
00059 #include "pilotLinkVersion.h"
00060
00061 #include <iostream>
00062
00063 using namespace std;
00064 inline std::ostream& operator <<(std::ostream &o, const QString &s)
00065 { if (s.isEmpty()) return o<<"<empty>"; else return o<<s.latin1(); }
00066 inline std::ostream& operator <<(std::ostream &o, const QCString &s)
00067 { if (s.isEmpty()) return o<<"<empty>"; else return o << *s; }
00068
00069
00070 #ifndef NDEBUG
00071 #define DEBUG (1)
00072 #endif
00073
00074 extern KDE_EXPORT int debug_level;
00075
00076 class KDE_EXPORT KPilotDepthCount
00077 {
00078 public:
00079 KPilotDepthCount(int, int level, const char *s);
00080 KPilotDepthCount(int level, const char *s);
00081 ~KPilotDepthCount();
00082 const char *indent() const;
00083 inline const char *name() const { return fName; } ;
00084 inline int level() const { return fLevel; } ;
00085
00086 protected:
00087 static int depth;
00088 int fDepth;
00089 int fLevel;
00090 const char *fName;
00091 } ;
00092
00093
00094 #ifdef DEBUG
00095 #ifdef __GNUC__
00096 #define KPILOT_FNAMEDEF(l) KPilotDepthCount fname(l,__FUNCTION__)
00097 #else
00098 #define KPILOT_FNAMEDEF(l) KPilotDepthCount fname(l,__FILE__ ":" "__LINE__")
00099 #endif
00100
00101 #define FUNCTIONSETUP KPILOT_FNAMEDEF(1)
00102 #define FUNCTIONSETUPL(l) KPILOT_FNAMEDEF(l)
00103
00104
00105
00106
00107 #define DEBUGKPILOT std::cerr
00108 #define WARNINGKPILOT std::cerr.clear(std::ios_base::goodbit),\
00109 std::cerr << "! " << k_funcinfo << std::endl << "! "
00110
00111
00112
00113
00114 inline std::ostream& operator <<(std::ostream &o, const KPilotDepthCount &d)
00115 {
00116 if (debug_level >= d.level())
00117 {
00118 o.clear(std::ios_base::goodbit);
00119 return o << d.indent() << ' ' << d.name();
00120 }
00121 else
00122 {
00123 o.setstate(std::ios_base::badbit | std::ios_base::failbit);
00124 return o;
00125 }
00126 }
00127
00128 #else
00129
00130
00131
00132 #define DEBUGSTREAM kndbgstream
00133 #define DEBUGKPILOT kndDebug()
00134 #define WARNINGKPILOT kndDebug()
00135
00136
00137
00138
00139 #define FUNCTIONSETUP const int fname = 0; Q_UNUSED(fname);
00140 #define FUNCTIONSETUPL(a) const int fname = a; Q_UNUSED(fname);
00141 #endif
00142
00143 #define KPILOT_VERSION "4.9.4-3510 (elsewhere)"
00144
00145
00146
00147 QString rtExpand(const QString &s, Qt::TextFormat richText);
00148
00149
00150
00154 KDE_EXPORT QDateTime readTm(const struct tm &t);
00158 KDE_EXPORT struct tm writeTm(const QDateTime &dt);
00159 KDE_EXPORT struct tm writeTm(const QDate &dt);
00160
00161
00162
00163
00164
00165
00166
00167
00168 #define SPACING (10)
00169
00170
00171
00172
00173
00174 #define KPILOT_FREE(a) { if (a) { ::free(a); a=0L; } }
00175 #define KPILOT_DELETE(a) { if (a) { delete a; a=0L; } }
00176
00177
00178
00179
00180
00181
00182
00183 #define TODO_I18N(a) QString::fromLatin1(a)
00184 #define TODO_I18N_P(a,b,c) ((c>1) ? a : b)
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197 #define CSL1(a) QString::fromLatin1(a "")
00198
00199 #endif
|