Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qt/qgplugin.h 3.3.8 edited Jan 11 14:46 $ 00003 ** 00004 ** ... 00005 ** 00006 ** Copyright (C) 2001-2007 Trolltech ASA. All rights reserved. 00007 ** 00008 ** This file is part of the kernel module of the Qt GUI Toolkit. 00009 ** 00010 ** This file may be distributed under the terms of the Q Public License 00011 ** as defined by Trolltech ASA of Norway and appearing in the file 00012 ** LICENSE.QPL included in the packaging of this file. 00013 ** 00014 ** This file may be distributed and/or modified under the terms of the 00015 ** GNU General Public License version 2 as published by the Free Software 00016 ** Foundation and appearing in the file LICENSE.GPL included in the 00017 ** packaging of this file. 00018 ** 00019 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 00020 ** licenses may use this file in accordance with the Qt Commercial License 00021 ** Agreement provided with the Software. 00022 ** 00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00025 ** 00026 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00027 ** information about Qt Commercial License Agreements. 00028 ** See http://www.trolltech.com/qpl/ for QPL licensing information. 00029 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00030 ** 00031 ** Contact info@trolltech.com if any conditions of this licensing are 00032 ** not clear to you. 00033 ** 00034 **********************************************************************/ 00035 00036 #ifndef QGPLUGIN_H 00037 #define QGPLUGIN_H 00038 00039 // 00040 // W A R N I N G 00041 // ------------- 00042 // 00043 // This file is not part of the Qt API. It exists for the convenience 00044 // of a number of Qt sources files. This header file may change from 00045 // version to version without notice, or even be removed. 00046 // 00047 // We mean it. 00048 // 00049 // 00050 00051 #ifndef QT_H 00052 #include "qobject.h" 00053 #endif // QT_H 00054 00055 #ifndef QT_NO_COMPONENT 00056 00057 #ifndef Q_EXTERN_C 00058 #ifdef __cplusplus 00059 #define Q_EXTERN_C extern "C" 00060 #else 00061 #define Q_EXTERN_C extern 00062 #endif 00063 #endif 00064 00065 #ifndef Q_EXPORT_PLUGIN 00066 #if defined(QT_THREAD_SUPPORT) 00067 #define QT_THREADED_BUILD 1 00068 #define Q_PLUGIN_FLAGS_STRING "11" 00069 #else 00070 #define QT_THREADED_BUILD 0 00071 #define Q_PLUGIN_FLAGS_STRING "01" 00072 #endif 00073 00074 // this is duplicated at Q_UCM_VERIFICATION_DATA in qcom_p.h 00075 // NOTE: if you change pattern, you MUST change the pattern in 00076 // qcomlibrary.cpp as well. changing the pattern will break all 00077 // backwards compatibility as well (no old plugins will be loaded). 00078 #ifndef Q_PLUGIN_VERIFICATION_DATA 00079 # define Q_PLUGIN_VERIFICATION_DATA \ 00080 static const char *qt_ucm_verification_data = \ 00081 "pattern=""QT_UCM_VERIFICATION_DATA""\n" \ 00082 "version="QT_VERSION_STR"\n" \ 00083 "flags="Q_PLUGIN_FLAGS_STRING"\n" \ 00084 "buildkey="QT_BUILD_KEY"\0"; 00085 #endif // Q_PLUGIN_VERIFICATION_DATA 00086 00087 #define Q_PLUGIN_INSTANTIATE( IMPLEMENTATION ) \ 00088 { \ 00089 IMPLEMENTATION *i = new IMPLEMENTATION; \ 00090 return i->iface(); \ 00091 } 00092 00093 # ifdef Q_WS_WIN 00094 # ifdef Q_CC_BOR 00095 # define Q_EXPORT_PLUGIN(PLUGIN) \ 00096 Q_PLUGIN_VERIFICATION_DATA \ 00097 Q_EXTERN_C __declspec(dllexport) \ 00098 const char * __stdcall qt_ucm_query_verification_data() \ 00099 { return qt_ucm_verification_data; } \ 00100 Q_EXTERN_C __declspec(dllexport) QUnknownInterface* \ 00101 __stdcall ucm_instantiate() \ 00102 Q_PLUGIN_INSTANTIATE( PLUGIN ) 00103 # else 00104 # define Q_EXPORT_PLUGIN(PLUGIN) \ 00105 Q_PLUGIN_VERIFICATION_DATA \ 00106 Q_EXTERN_C __declspec(dllexport) \ 00107 const char *qt_ucm_query_verification_data() \ 00108 { return qt_ucm_verification_data; } \ 00109 Q_EXTERN_C __declspec(dllexport) QUnknownInterface* ucm_instantiate() \ 00110 Q_PLUGIN_INSTANTIATE( PLUGIN ) 00111 # endif 00112 # else 00113 # define Q_EXPORT_PLUGIN(PLUGIN) \ 00114 Q_PLUGIN_VERIFICATION_DATA \ 00115 Q_EXTERN_C \ 00116 const char *qt_ucm_query_verification_data() \ 00117 { return qt_ucm_verification_data; } \ 00118 Q_EXTERN_C QUnknownInterface* ucm_instantiate() \ 00119 Q_PLUGIN_INSTANTIATE( PLUGIN ) 00120 # endif 00121 00122 #endif 00123 00124 struct QUnknownInterface; 00125 00126 class Q_EXPORT QGPlugin : public QObject 00127 { 00128 Q_OBJECT 00129 public: 00130 QGPlugin( QUnknownInterface *i ); 00131 ~QGPlugin(); 00132 00133 QUnknownInterface* iface(); 00134 void setIface( QUnknownInterface *iface ); 00135 00136 private: 00137 QGPlugin(); 00138 QUnknownInterface* _iface; 00139 }; 00140 00141 #endif // QT_NO_COMPONENT 00142 00143 #endif // QGPLUGIN_H