ctkPluginStorage_p.h

Go to the documentation of this file.
00001 /*=============================================================================
00002 
00003   Library: CTK
00004 
00005   Copyright (c) 2010 German Cancer Research Center,
00006     Division of Medical and Biological Informatics
00007 
00008   Licensed under the Apache License, Version 2.0 (the "License");
00009   you may not use this file except in compliance with the License.
00010   You may obtain a copy of the License at
00011 
00012     http://www.apache.org/licenses/LICENSE-2.0
00013 
00014   Unless required by applicable law or agreed to in writing, software
00015   distributed under the License is distributed on an "AS IS" BASIS,
00016   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00017   See the License for the specific language governing permissions and
00018   limitations under the License.
00019 
00020 =============================================================================*/
00021 
00022 #ifndef CTKPLUGINSTORAGE_P_H
00023 #define CTKPLUGINSTORAGE_P_H
00024 
00025 #include <QList>
00026 #include <QStringList>
00027 
00028 #include "ctkPluginDatabase_p.h"
00029 
00030 // Qt class forward declarations
00031 class QIODevice;
00032 
00033 
00034   // CTK class forward declarations
00035   class ctkPluginArchive;
00036   class ctkPluginFrameworkContext;
00037 
00041   class ctkPluginStorage {
00042 
00043   private:
00044 
00045     QMutex archivesLock;
00046 
00050     QList<ctkPluginArchive*> archives;
00051 
00055     ctkPluginFrameworkContext* framework;
00056 
00060     ctkPluginDatabase pluginDatabase;
00061 
00062   public:
00063 
00069     ctkPluginStorage(ctkPluginFrameworkContext* framework);
00070 
00071 
00079     ctkPluginArchive* insertPlugin(const QUrl& location, const QString& localPath);
00080 
00081 
00092     ctkPluginArchive* updatePluginArchive(ctkPluginArchive* old, const QString& localPath);
00093 
00094 
00102     void replacePluginArchive(ctkPluginArchive* oldPA, ctkPluginArchive* newPA);
00103 
00112     bool removeArchive(ctkPluginArchive* pa);
00113 
00114 
00120     QList<ctkPluginArchive*> getAllPluginArchives() const;
00121 
00122 
00129     QList<QString> getStartOnLaunchPlugins();
00130 
00131     QByteArray getPluginResource(long pluginId, const QString& res) const;
00132 
00133     QStringList findResourcesPath(long pluginId, const QString& path) const;
00134 
00138     void close();
00139 
00140     ~ctkPluginStorage();
00141 
00142 };
00143 
00144 
00145 #endif // CTKPLUGINSTORAGE_P_H
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines