23 #include <tqstringlist.h>
24 #include <tqasciidict.h>
25 #include <tqptrlist.h>
26 #include <tdeglobal.h>
34 class KLibFactoryPrivate;
35 class KLibLoaderPrivate;
36 class KLibraryPrivate;
38 # define K_EXPORT_COMPONENT_FACTORY( libname, factory ) \
39 extern "C" { TDE_EXPORT void *init_##libname() { return new factory; } }
50 class TDECORE_EXPORT
KLibrary :
public TQObject
60 KLibrary(
const TQString& libname,
const TQString& filename,
void * handle );
66 TQString name()
const;
72 TQString fileName()
const;
89 void* symbol(
const char* name )
const;
100 bool hasSymbol(
const char* name )
const;
110 void slotObjectCreated( TQObject *obj );
111 void slotObjectDestroyed();
125 TQPtrList<TQObject> m_objs;
130 class KLibWrapPrivate;
197 virtual KLibrary* library(
const char* libname );
230 TQString lastErrorMessage()
const;
246 virtual void unloadLibrary(
const char *libname );
264 static void cleanUp();
282 void slotLibraryDestroyed();
284 void close_pending( KLibWrapPrivate * );
285 TQAsciiDict<KLibWrapPrivate> m_libs;
290 virtual void virtual_hook(
int id,
void* data );
292 KLibLoaderPrivate *d;
342 KLibFactory( TQObject* parent = 0,
const char* name = 0 );
366 TQObject* create( TQObject* parent = 0,
const char* name = 0,
const char* classname =
"TQObject",
const TQStringList &args = TQStringList() );
394 virtual TQObject* createObject( TQObject* parent = 0,
const char* name = 0,
395 const char* className =
"TQObject",
396 const TQStringList &args = TQStringList() ) = 0;
400 virtual void virtual_hook(
int id,
void* data );
402 KLibFactoryPrivate *d;
If you develop a library that is to be loaded dynamically at runtime, then you should return a pointe...
void objectCreated(TQObject *obj)
Emitted in create.
The KLibLoader allows you to load libraries dynamically at runtime.
Represents a dynamically loaded library.
TQString name() const
Returns the name of the library.
KLibFactory * factory()
Returns the factory of the library.
static TDEInstance * instance()
Returns the global instance.
Access to KDE global objects for use in shared libraries.