00001 /********************************************************************** 00002 ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of the Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 00021 #ifndef QLIBRARY_P_H 00022 #define QLIBRARY_P_H 00023 00024 // 00025 // W A R N I N G 00026 // ------------- 00027 // 00028 // This file is not part of the Qt API. It exists for the convenience 00029 // of the QLibrary class. This header file may change from 00030 // version to version without notice, or even be removed. 00031 // 00032 // We mean it. 00033 // 00034 // 00035 00036 #include "qlibrary.h" 00037 00038 //#ifndef QT_NO_COMPONENT 00039 00040 //#ifndef QT_H 00041 #include "qwindowdefs.h" 00042 //#ifndef QT_LITE_COMPONENT 00043 #include "qobject.h" 00044 //#endif 00045 //#endif // QT_H 00046 00047 class QTimer; 00048 class QLibrary; 00049 class QLibraryInterface; 00050 00051 /* 00052 Private helper class that saves the platform dependent handle 00053 and does the unload magic using a QTimer. 00054 */ 00055 //#ifndef QT_LITE_COMPONENT 00056 class QLibraryPrivate : public QObject 00057 { 00058 Q_OBJECT 00059 public: 00060 QLibraryPrivate( QLibrary *lib ); 00061 ~QLibraryPrivate(); 00062 00063 void startTimer(); 00064 void killTimer(); 00065 00066 #ifdef Q_WS_WIN 00067 HINSTANCE pHnd; 00068 #else 00069 void *pHnd; 00070 #endif 00071 00072 QLibraryInterface *libIface; 00073 00074 bool loadLibrary(); 00075 bool freeLibrary(); 00076 void *resolveSymbol( const char * ); 00077 00078 private slots: 00079 void tryUnload(); 00080 00081 private: 00082 QTimer *unloadTimer; 00083 QLibrary *library; 00084 }; 00085 00086 #else // QT_LITE_COMPONENT 00087 class QLibraryPrivate 00088 { 00089 public: 00090 QLibraryPrivate( QLibrary *lib ); 00091 00092 void startTimer(); 00093 void killTimer(); 00094 00095 #ifdef Q_WS_WIN 00096 HINSTANCE pHnd; 00097 #else 00098 void *pHnd; 00099 #endif 00100 QLibraryInterface *libIface; 00101 00102 bool loadLibrary(); 00103 bool freeLibrary(); 00104 void *resolveSymbol( const char * ); 00105 00106 private: 00107 QLibrary *library; 00108 }; 00109 //#endif // QT_LITE_COMPONENT 00110 00111 //#endif // QT_NO_COMPONENT 00112 00113 #endif // QLIBRARY_P_H
1.4.2