1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- /*=============================================================================
-
- Library: CTK
-
- Copyright (c) German Cancer Research Center,
- Division of Medical and Biological Informatics
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- =============================================================================*/
- #ifndef CTKCMDLINEMODULEMANAGER_H
- #define CTKCMDLINEMODULEMANAGER_H
- #include <ctkCommandLineModulesCoreExport.h>
- #include <QStringList>
- #include <QString>
- #include "ctkCmdLineModuleReference.h"
- struct ctkCmdLineModuleBackend;
- struct ctkCmdLineModuleFrontendFactory;
- class ctkCmdLineModuleFrontend;
- class ctkCmdLineModuleFuture;
- struct ctkCmdLineModuleManagerPrivate;
- /**
- * \class ctkCmdLineModuleManager
- * \brief Main manager class to handle loading and unloading of modules.
- * \ingroup CommandLineModulesCore
- */
- class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleManager : public QObject
- {
- Q_OBJECT
- public:
- enum ValidationMode {
- /** registerModule() will throw an exception if the XML is invalid */
- STRICT_VALIDATION,
- /** no XML schema validation at all */
- SKIP_VALIDATION,
- /**
- * registerModule() will validate the XML description but proceed with
- * registration on validation error.
- */
- WEAK_VALIDATION
- };
- ctkCmdLineModuleManager(ValidationMode = STRICT_VALIDATION, const QString& cacheDir = QString());
- ~ctkCmdLineModuleManager();
- void registerBackend(ctkCmdLineModuleBackend* backend);
- ctkCmdLineModuleReference registerModule(const QUrl& location);
- void unregisterModule(const ctkCmdLineModuleReference& moduleRef);
- ctkCmdLineModuleReference moduleReference(const QUrl& location) const;
- QList<ctkCmdLineModuleReference> moduleReferences() const;
- ctkCmdLineModuleFuture run(ctkCmdLineModuleFrontend* frontend);
- Q_SIGNALS:
- void moduleRegistered(const ctkCmdLineModuleReference&);
- void moduleUnregistered(const ctkCmdLineModuleReference&);
- private:
- QScopedPointer<ctkCmdLineModuleManagerPrivate> d;
- Q_DISABLE_COPY(ctkCmdLineModuleManager)
- };
- #endif // CTKCMDLINEMODULEMANAGER_H
|