dcop
dcoptypes.h
Go to the documentation of this file.00001 /* 00002 Copyright (c) 2002 Matthias Ettrich <ettrich@kde.org> 00003 00004 Permission is hereby granted, free of charge, to any person obtaining a copy 00005 of this software and associated documentation files (the "Software"), to deal 00006 in the Software without restriction, including without limitation the rights 00007 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00008 copies of the Software, and to permit persons to whom the Software is 00009 furnished to do so, subject to the following conditions: 00010 00011 The above copyright notice and this permission notice shall be included in 00012 all copies or substantial portions of the Software. 00013 00014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00017 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00020 */ 00021 00022 #ifndef DCOPTYPES_H 00023 #define DCOPTYPES_H 00024 00025 #include <dcopref.h> 00026 00027 // standard c/c++ types 00028 inline const char* dcopTypeName( bool ) { return "bool"; } 00029 inline const char* dcopTypeName( char ) { return "char"; } 00030 inline const char* dcopTypeName( uchar ) { return "uchar"; } 00031 inline const char* dcopTypeName( int ) { return "int"; } 00032 inline const char* dcopTypeName( uint ) { return "uint"; } 00033 inline const char* dcopTypeName( long ) { return "long int"; } 00034 inline const char* dcopTypeName( ulong ) { return "ulong"; } 00035 inline const char* dcopTypeName( double ) { return "double"; } 00036 inline const char* dcopTypeName( float ) { return "float"; } 00037 inline const char* dcopTypeName( const char* ) { return "QCString"; } 00038 00039 // dcop specialities 00040 class DCOPRef; inline const char* dcopTypeName( const DCOPRef& ) { return "DCOPRef"; } 00041 00042 // Qt variant types 00043 class QString; inline const char* dcopTypeName( const QString& ) { return "QString"; } 00044 class QCString; inline const char* dcopTypeName( const QCString& ) { return "QCString"; } 00045 class QFont; inline const char* dcopTypeName( const QFont& ) { return "QFont"; } 00046 class QPixmap; inline const char* dcopTypeName( const QPixmap& ) { return "QPixmap"; } 00047 class QBrush; inline const char* dcopTypeName( const QBrush& ) { return "QBrush"; } 00048 class QRect; inline const char* dcopTypeName( const QRect& ) { return "QRect"; } 00049 class QPoint; inline const char* dcopTypeName( const QPoint& ) { return "QPoint"; } 00050 class QImage; inline const char* dcopTypeName( const QImage& ) { return "QImage"; } 00051 class QSize; inline const char* dcopTypeName( const QSize& ) { return "QSize"; } 00052 class QColor; inline const char* dcopTypeName( const QColor& ) { return "QColor"; } 00053 class QPalette; inline const char* dcopTypeName( const QPalette& ) { return "QPalette"; } 00054 class QColorGroup; inline const char* dcopTypeName( const QColorGroup& ) { return "QColorGroup"; } 00055 class QIconSet; inline const char* dcopTypeName( const QIconSet& ) { return "QIconSet"; } 00056 class QDataStream; inline const char* dcopTypeName( const QDataStream& ) { return "QDataStream"; } 00057 class QPointArray; inline const char* dcopTypeName( const QPointArray& ) { return "QPointArray"; } 00058 class QRegion; inline const char* dcopTypeName( const QRegion& ) { return "QRegion"; } 00059 class QBitmap; inline const char* dcopTypeName( const QBitmap& ) { return "QBitmap"; } 00060 class QCursor; inline const char* dcopTypeName( const QCursor& ) { return "QCursor"; } 00061 class QStringList; inline const char* dcopTypeName( const QStringList& ) { return "QStringList"; } 00062 class QSizePolicy; inline const char* dcopTypeName( const QSizePolicy& ) { return "QSizePolicy"; } 00063 class QDate; inline const char* dcopTypeName( const QDate& ) { return "QDate"; } 00064 class QTime; inline const char* dcopTypeName( const QTime& ) { return "QTime"; } 00065 class QDateTime; inline const char* dcopTypeName( const QDateTime& ) { return "QDateTime"; } 00066 class QBitArray; inline const char* dcopTypeName( const QBitArray& ) { return "QBitArray"; } 00067 class QKeySequence; inline const char* dcopTypeName( const QKeySequence& ) { return "QKeySequence"; } 00068 class QVariant; inline const char* dcopTypeName( const QVariant& ) { return "QVariant"; } 00069 00070 // And some KDE types 00071 class KURL; inline const char* dcopTypeName( const KURL& ) { return "KURL"; } 00072 00073 // generic template fallback for unknown types 00074 template <class T> inline const char* dcopTypeName( const T& ) { return "<unknown>"; } 00075 00076 // type initialization for standard c/c++ types 00077 inline void dcopTypeInit(bool& b){b=false;} 00078 inline void dcopTypeInit(char& c){c=0;} 00079 inline void dcopTypeInit(uchar& c){c=0;} 00080 inline void dcopTypeInit(int& i){i=0;} 00081 inline void dcopTypeInit(uint& i){i=0;} 00082 inline void dcopTypeInit(long& l){l=0;} 00083 inline void dcopTypeInit(ulong& l){l=0;} 00084 inline void dcopTypeInit(float& f){f=0;} 00085 inline void dcopTypeInit(double& d){d=0;} 00086 inline void dcopTypeInit(const char* s ){s=0;} 00087 00088 // generic template fallback for self-initializing classes 00089 template <class T> inline void dcopTypeInit(T&){} 00090 00091 #endif