#include </home/clem/local/src/opie/library/qlibrary.h>
Inheritance diagram for QLibrary:


Public Types | |
| enum | Policy { Delayed, Immediately, Manual } |
Public Member Functions | |
| QLibrary (const QString &filename, Policy=Delayed) | |
| ~QLibrary () | |
| void * | resolve (const char *) |
| bool | unload (bool force=FALSE) |
| bool | isLoaded () const |
| void | setPolicy (Policy pol) |
| Policy | policy () const |
| QString | library () const |
| QRESULT | queryInterface (const QUuid &, QUnknownInterface **) |
Static Public Member Functions | |
| static void * | resolve (const QString &filename, const char *) |
Private Member Functions | |
| bool | load () |
| void | createInstanceInternal () |
Private Attributes | |
| QLibraryPrivate * | d |
| QString | libfile |
| Policy | libPol |
| QUnknownInterface * | entry |
This class is temporarily copied from Qt 3.0.
Definition at line 32 of file qlibrary.h.
|
|
This enum type defines the various policies a QLibrary can have with respect to loading and unloading the shared library. The policy can be: Delayed The library get's loaded as soon as needed and unloaded in the destructor Immediately The library is loaded immediately and unloaded in the destructor Manual Like delayed, and library has to be unloaded manually Definition at line 35 of file qlibrary.h. |
|
||||||||||||
|
Creates a QLibrary object for the shared library filename. The library get's loaded if pol is Immediately. Note that filename does not need to include the (platform specific) file extension, so calling
QLibrary lib( "mylib" ); would be equivalent to
QLibrary lib( "mylib.dll" ); on Windows. But "mylib.dll" will obviously not work on other platforms.
Definition at line 154 of file qlibrary.cpp. References d, Immediately, and load(). |
|
|
Deletes the QLibrary object. The library will be unloaded if the policy is not Manual.
Definition at line 168 of file qlibrary.cpp. References d, entry, libPol, Manual, QUnknownInterface::release(), and unload(). |
|
|
Reimplemented in QComLibrary. Definition at line 179 of file qlibrary.cpp. References d, entry, IID_QLibrary, QLibraryInterface::init(), QString::isEmpty(), QLibraryPrivate::killTimer(), libfile, QLibraryPrivate::libIface, libPol, library(), load(), Manual, QLibraryPrivate::pHnd, QUnknownInterface::queryInterface(), qWarning(), resolve(), QLibraryPrivate::startTimer(), and unload(). Referenced by queryInterface(). |
|
|
Returns whether the library is loaded.
Definition at line 277 of file qlibrary.cpp. References d, and QLibraryPrivate::pHnd. Referenced by QComLibrary::createInstanceInternal(), and Opie::Core::Internal::OPluginLibraryHolder::ref(). |
|
|
Returns the filename of the shared library this QLibrary object handles, including the platform specific file extension.
will set str to "mylib.dll" on Windows, and "libmylib.so" on Linux. Definition at line 402 of file qlibrary.cpp. References QString::find(), QString::isEmpty(), and libfile. Referenced by QGPluginManager::addLibrary(), compareAppletPositions(), QComLibrary::createInstanceInternal(), createInstanceInternal(), QLibraryPrivate::loadLibrary(), QLibraryPrivate::tryUnload(), and unload(). |
|
|
Loads the library. Definition at line 285 of file qlibrary.cpp. References d, and QLibraryPrivate::loadLibrary(). Referenced by QComLibrary::createInstanceInternal(), createInstanceInternal(), QLibrary(), resolve(), and setPolicy(). |
|
|
Returns the current policy.
Definition at line 386 of file qlibrary.cpp. References libPol. Referenced by QLibraryPrivate::tryUnload(). |
|
||||||||||||
|
Forwards the query to the component and returns the result. request and iface are propagated to the component's queryInterface implementation. The library gets loaded if necessary. Reimplemented in QComLibrary. Definition at line 428 of file qlibrary.cpp. References createInstanceInternal(), entry, QE_NOINTERFACE, and QUnknownInterface::queryInterface(). Referenced by SysTray::addApplets(), calc::calc(), IrServer::IrServer(), Opie::Core::OGenericPluginLoader::load(), StartMenu::loadApplets(), QPEApplication::Private::loadImageCodecs(), InputMethods::loadInputMethods(), Network::loadPlugin(), MultiauthConfig::loadPlugins(), MediaPlayerState::loadPlugins(), FontDatabase::loadRenderers(), QPEApplication::Private::loadTextCodecs(), main(), QuickPrivate::PluginLoader::queryInterface(), and Opie::Security::Internal::runPlugins(). |
|
||||||||||||
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Loads the library filename and returns the address of the exported symbol symb. Note that like for the constructor, filename does not need to include the (platform specific) file extension. The library staying loaded until the process exits. The function returns a null pointer if the symbol could not be resolved or if loading the library failed. Definition at line 266 of file qlibrary.cpp. |
|
|
Returns the address of the exported symbol symb. The library gets loaded if necessary. The function returns NULL if the symbol could not be resolved, or if loading the library failed.
typedef int (*addProc)( int, int ); addProc add = (addProc) library->resolve( "add" ); if ( add ) return add( 5, 8 ); else return 5 + 8;
Definition at line 238 of file qlibrary.cpp. References d, load(), QLibraryPrivate::pHnd, qWarning(), and QLibraryPrivate::resolveSymbol(). Referenced by QComLibrary::createInstanceInternal(), createInstanceInternal(), MainWindowImp::loadPlugin(), QSettingsPrivate::QSettingsPrivate(), and resolve(). |
|
|
Sets the current policy to pol. The library is loaded if pol is set to Immediately. Definition at line 373 of file qlibrary.cpp. References d, Immediately, libPol, load(), and QLibraryPrivate::pHnd. |
|
|
Releases the component and unloads the library when successful. Returns TRUE if the library could be unloaded, otherwise FALSE. If the component implements the QLibraryInterface, the cleanup() function of this interface will be called. The unloading will be cancelled if the subsequent call to canUnload() returns FALSE. This function gets called automatically in the destructor if the policy is not Manual.
Definition at line 307 of file qlibrary.cpp. References QUnknownInterface::addRef(), QLibraryInterface::canUnload(), QLibraryInterface::cleanup(), d, entry, FALSE, QLibraryPrivate::freeLibrary(), QLibraryPrivate::killTimer(), QLibraryPrivate::libIface, library(), QLibraryPrivate::pHnd, qWarning(), QUnknownInterface::release(), and TRUE. Referenced by StartMenu::clearApplets(), createInstanceInternal(), QPEApplication::Private::loadImageCodecs(), QPEApplication::Private::loadTextCodecs(), InputMethod::releaseInterface(), QLibraryPrivate::tryUnload(), QComLibrary::unload(), and ~QLibrary(). |
|
|
Definition at line 62 of file qlibrary.h. Referenced by createInstanceInternal(), isLoaded(), load(), QLibrary(), resolve(), setPolicy(), unload(), and ~QLibrary(). |
|
|
Reimplemented in QComLibrary. Definition at line 66 of file qlibrary.h. Referenced by createInstanceInternal(), queryInterface(), unload(), and ~QLibrary(). |
|
|
Definition at line 64 of file qlibrary.h. Referenced by createInstanceInternal(), and library(). |
|
|
Definition at line 65 of file qlibrary.h. Referenced by createInstanceInternal(), policy(), setPolicy(), and ~QLibrary(). |
1.4.2