Kactus2
Kactus2 reference guide
Loading...
Searching...
No Matches
LibraryInterface.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// File: libraryinterface.h
3//-----------------------------------------------------------------------------
4// Project: Kactus 2
5// Author: Antti Kamppi
6// Date: 22.02.2011
7//
8// Description:
9// LibraryInterface defines an interface to operate the IP-XACT-library.
10//-----------------------------------------------------------------------------
11
12#ifndef LIBRARYINTERFACE_H
13#define LIBRARYINTERFACE_H
14
15#include <IPXACTmodels/common/VLNV.h>
16
17#include <QObject>
18#include <QSharedPointer>
19
20class Design;
21class LibraryItem;
22class Document;
23
24//-----------------------------------------------------------------------------
26//-----------------------------------------------------------------------------
28{
29
30public:
31
39 virtual QSharedPointer<Document> getModel(VLNV const& vlnv) = 0;
40
47 template <class T>
48 QSharedPointer<T> getModel(VLNV const& vlnv)
49 {
50 return getModel(vlnv).dynamicCast<T>();
51 }
52
60 virtual QSharedPointer<Document const> getModelReadOnly(VLNV const& vlnv) = 0;
61
68 template <class T>
69 QSharedPointer<T const> getModelReadOnly(VLNV const& vlnv)
70 {
71 return getModelReadOnly(vlnv).dynamicCast<T const>();
72 }
73
80 virtual bool contains(VLNV const& vlnv) const = 0;
81
86 virtual QList<VLNV> getAllVLNVs() const = 0;
87
94 virtual const QString getPath(VLNV const& vlnv) const = 0;
95
102 virtual QString getDirectoryPath(VLNV const& vlnv) const = 0;
103
115 virtual bool writeModelToFile(QString const& path, QSharedPointer<Document> model) = 0;
116
126 virtual bool writeModelToFile(QSharedPointer<Document> model) = 0;
127
129 virtual void searchForIPXactFiles() = 0;
130
141 virtual void getNeededVLNVs(VLNV const& vlnv, QList<VLNV>& list) = 0;
142
152 virtual void getDependencyFiles(VLNV const& vlnv, QStringList& list) = 0;
153
157 virtual LibraryItem const* getTreeRoot() const = 0;
158
167 virtual VLNV::IPXactType getDocumentType(VLNV const& vlnv) = 0;
168
175 virtual int referenceCount(VLNV const& vlnv) const = 0;
176
184 virtual int getOwners(QList<VLNV>& list, VLNV const& vlnvToSearch) const = 0;
185
193 virtual int getChildren(QList<VLNV>& list, VLNV const& vlnvToSearch) const = 0;
194
208 virtual VLNV getDesignVLNV(VLNV const& hierarchyRef) = 0;
209
223 virtual QSharedPointer<Design> getDesign(VLNV const& hierarchyRef) = 0;
224
231 virtual bool isValid(VLNV const& vlnv) = 0;
232
233public slots:
234
240 virtual void onCheckLibraryIntegrity() = 0;
241
246 virtual void onEditItem(VLNV const& vlnv) = 0;
247
253 virtual void onOpenDesign(VLNV const& vlnv, QString const& viewName) = 0;
254
262 virtual void removeObject(VLNV const& vlnv) = 0;
263
270 virtual void removeObjects(const QList<VLNV>& vlnvList) = 0;
271
280 virtual void beginSave() = 0;
281
286 virtual void endSave() = 0;
287
288signals:
289
291 void openDesign(VLNV const& vlnv, QString const& viewName);
292
294 void openBus(VLNV const& busDefVLNV, VLNV const& absDefVLNV, bool disableBusDef);
295
297 void openComponent(VLNV const& vlnv);
298
300 void createAbsDef(VLNV const& busDefVLNV, QString const& directory, bool disableBusDef);
301
303 void itemSelected(VLNV const& vlnv);
304
306 void openSystemDesign(VLNV const& vlnv);
307
309 void openPlatformComponent(VLNV const& vlnv);
310
311};
312
313#endif // LIBRARYINTERFACE_H
LibraryInterface defines an interface to operate the IP-XACT-library.
virtual VLNV::IPXactType getDocumentType(VLNV const &vlnv)=0
virtual VLNV getDesignVLNV(VLNV const &hierarchyRef)=0
virtual void searchForIPXactFiles()=0
Search for IP-XACT files in the file system and add them to library.
void openPlatformComponent(VLNV const &vlnv)
Signal that user wants to open a platform component.
virtual QSharedPointer< Document const > getModelReadOnly(VLNV const &vlnv)=0
void openBus(VLNV const &busDefVLNV, VLNV const &absDefVLNV, bool disableBusDef)
Signal that user wants to open specified bus for editing.
virtual void removeObject(VLNV const &vlnv)=0
void openDesign(VLNV const &vlnv, QString const &viewName)
Signal that user wants to open the specified component for editing.
virtual int referenceCount(VLNV const &vlnv) const =0
virtual QString getDirectoryPath(VLNV const &vlnv) const =0
virtual bool writeModelToFile(QString const &path, QSharedPointer< Document > model)=0
QSharedPointer< T > getModel(VLNV const &vlnv)
void openComponent(VLNV const &vlnv)
Signal that user wants to open specified component for editing.
virtual void removeObjects(const QList< VLNV > &vlnvList)=0
virtual QList< VLNV > getAllVLNVs() const =0
QSharedPointer< T const > getModelReadOnly(VLNV const &vlnv)
virtual QSharedPointer< Design > getDesign(VLNV const &hierarchyRef)=0
virtual bool writeModelToFile(QSharedPointer< Document > model)=0
virtual int getChildren(QList< VLNV > &list, VLNV const &vlnvToSearch) const =0
virtual LibraryItem const * getTreeRoot() const =0
virtual void onEditItem(VLNV const &vlnv)=0
virtual const QString getPath(VLNV const &vlnv) const =0
virtual void endSave()=0
virtual void getNeededVLNVs(VLNV const &vlnv, QList< VLNV > &list)=0
virtual void onOpenDesign(VLNV const &vlnv, QString const &viewName)=0
virtual QSharedPointer< Document > getModel(VLNV const &vlnv)=0
void itemSelected(VLNV const &vlnv)
Signal that the library item specified by vlnv is selected in one of the views.
void openSystemDesign(VLNV const &vlnv)
Signal that user wants to open a system for editing.
virtual int getOwners(QList< VLNV > &list, VLNV const &vlnvToSearch) const =0
virtual bool contains(VLNV const &vlnv) const =0
virtual void getDependencyFiles(VLNV const &vlnv, QStringList &list)=0
void createAbsDef(VLNV const &busDefVLNV, QString const &directory, bool disableBusDef)
Signal that user wants to create a new abstraction definition for given bus definition.
virtual void beginSave()=0
virtual bool isValid(VLNV const &vlnv)=0
virtual void onCheckLibraryIntegrity()=0
LibraryItem class is used to create the hierarchical structure of IP library.
Definition LibraryItem.h:27