00001 #ifndef SXCOMPONENTLIBRARY_H_INCLUDED
00002 #define SXCOMPONENTLIBRARY_H_INCLUDED
00003
00004 #include "sxGlobal.h"
00005
00006 class sxComponent;
00007 class QLibrary;
00008
00024 class SX_SDKEXPORT sxComponentLibrary
00025 {
00026 public:
00027 virtual ~sxComponentLibrary();
00028 sxComponentLibrary();
00029 explicit sxComponentLibrary(const QString& libname);
00030
00031 bool Load(const QString& libname);
00032 QString Name() const;
00033 QString VersionString() const;
00034 int Version() const;
00035 QString Description() const;
00036 bool IsValid() const;
00037 void SetManifestFileName(const QString& fname);
00038 QString ManifestFileName() const;
00039 sxComponent * Create(int type, bool loadMode) const ;
00040 sxComponent * Create(const QString& lname, int type, bool loadMode) const;
00041 protected:
00042 QString xLibFuncPrefix;
00043 private:
00044 typedef sxComponent * ( * ComponentCreatorFunc)(int);
00045 typedef const char * ( * LibStrFunc)(void);
00046 typedef int (* LibIntFunc)(void);
00047
00048 QLibrary * xLibLoader;
00049 ComponentCreatorFunc yCreator;
00050 QString xName;
00051 int xVersion;
00052 QString xDescription;
00053 QString xManifestFileName;
00054
00055 SX_DISABLE_COPY(sxComponentLibrary)
00056 };
00057
00061 class SX_SDKEXPORT sxUiComponentLibrary : public sxComponentLibrary
00062 {
00063 public:
00064 ~sxUiComponentLibrary();
00065 sxUiComponentLibrary();
00066 sxUiComponentLibrary(const QString& libname);
00067 };
00068
00069
00070 #endif // SXCOMPONENTLIBRARY_H_INCLUDED