24 #include <QStringList> 32 : pFactoryManager(factoryManager)
35 pFactoryManager->registerFactory(
this);
40 pFactoryManager->unRegisterFactory(
this);
55 for (k = 0; k < pRegisteredFactories.size(); ++k) {
62 <<
"KLFFactoryManager::findFactoryFor(object type="<<objType<<
"): No factory found!";
71 for (k = 0; k < pRegisteredFactories.size(); ++k) {
72 objtypes << pRegisteredFactories[k]->supportedTypes();
79 if (pRegisteredFactories.indexOf(factory) != -1) {
80 qWarning()<<
"KLFFactory<>::registerFactory(): Factory " << factory <<
" is already registered!";
83 pRegisteredFactories.prepend(factory);
88 if (pRegisteredFactories.indexOf(factory) == -1) {
89 qWarning()<<
"KLFFactory<>::unRegisterFactory(): Factory "<<factory<<
" is not registered!";
92 pRegisteredFactories.removeAll(factory);
Base declarations for klatexformula and some utilities.
bool contains(const QString &str, Qt::CaseSensitivity cs) const
Base class for factories.
#define KLF_ASSERT_NOT_NULL(ptr, msg, failaction)
Asserting Non-NULL pointers (NON-FATAL)
A base abstract factory manager class.
virtual ~KLFFactoryManager()
QStringList allSupportedTypes()
KLFFactoryBase * findFactoryFor(const QString &objType)
virtual QStringList supportedTypes() const =0
A list of object types that this factory supports instantiating.
virtual ~KLFFactoryBase()
KLFFactoryBase(KLFFactoryManager *factoryManager)