ACF $AcfVersion:0$
IFileResourcesManager.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QByteArray>
7#include <QtCore/QList>
8
9// ACF includes
10#include <istd/TSmartPtr.h>
12#include <iprm/IOptionsList.h>
15
16
17namespace ifile
18{
19
20
21class IFileResourceTypeConstraints;
22
23
28{
29public:
31 typedef QList<QByteArray> Ids;
33
54
55
59 virtual Ids GetFileIds() const = 0;
60
66
72 virtual QByteArray GetResourceTypeId(const QByteArray& resourceId) const = 0;
73
82 virtual QByteArray CreateNewFile(
83 const QByteArray& fileTypeId,
84 const istd::IChangeable* dataObjectPtr,
85 const QString& filePath = QString(),
86 const QString& resourceName = QString()) = 0;
87
92 virtual bool RemoveFile(const QByteArray& fileId) = 0;
93
97 virtual DataObjectPtr GetDataObject(const QByteArray& fileId) const = 0;
98
104 virtual idoc::MetaInfoPtr GetFileMetaInfo(const QByteArray& resourceId) const = 0;
105
110 virtual QString GetResourceName(const QByteArray& resourceId) const = 0;
111
117 virtual bool SetResourceName(const QByteArray& resourceId, const QString& name) = 0;
118
123 virtual QString GetResourceDescription(const QByteArray& resourceId) const = 0;
124
130 virtual bool SetResourceDescription(const QByteArray& resourceId, const QString& description) = 0;
131
137 const QByteArray& resourceId,
138 const QByteArray& resourceTypeId = QByteArray(),
139 ilog::IMessageConsumer* messageConsumerPtr = NULL) const = 0;
140};
141
142
143} // namespace ifile
144
145
Interface for describing constraints of file types supported by the file repository implementation.
Manager of file-based resources.
virtual QString GetResourceDescription(const QByteArray &resourceId) const =0
Get the description of the file resource in the storage.
virtual bool RemoveFile(const QByteArray &fileId)=0
Remove file from the resources storage.
virtual QString GetResourceName(const QByteArray &resourceId) const =0
Get the name of the file resource in the storage.
virtual QByteArray GetResourceTypeId(const QByteArray &resourceId) const =0
Get type ID if the resource.
virtual LicenseStatus GetLicenseStatus(const QByteArray &resourceId, const QByteArray &resourceTypeId=QByteArray(), ilog::IMessageConsumer *messageConsumerPtr=NULL) const =0
Get the license status of the given resource.
virtual const IFileResourceTypeConstraints * GetResourceTypeConstraints() const =0
Get type contraints describing each supported type of a resource.
virtual DataObjectPtr GetDataObject(const QByteArray &fileId) const =0
Get data object for the given resource.
virtual idoc::MetaInfoPtr GetFileMetaInfo(const QByteArray &resourceId) const =0
Get meta info of an existing file resource.
virtual QByteArray CreateNewFile(const QByteArray &fileTypeId, const istd::IChangeable *dataObjectPtr, const QString &filePath=QString(), const QString &resourceName=QString())=0
Create new file resource.
istd::TSharedInterfacePtr< istd::IChangeable > DataObjectPtr
virtual Ids GetFileIds() const =0
Get list of file/resource IDs in the repository.
virtual bool SetResourceName(const QByteArray &resourceId, const QString &name)=0
Set the name of the file resource in the storage.
virtual bool SetResourceDescription(const QByteArray &resourceId, const QString &description)=0
Set the description of the file resource in the storage.
LicenseStatus
Status of the resource license.
@ LS_OK
The resource is licensed and the user of the repository has all neccessary rights for using it.
@ LS_NOT_VALID
The resource is licensed, but the user of the repository has no valid licenses for using it.
@ LS_NONE
The resource is not licensed.
Common interface for a message container consuming information objects (messages).
Common interface for data model objects, which can be changed.
Definition IChangeable.h:28
Shared ownership smart pointer for interface types.
#define NULL
Definition istd.h:74
Contains interfaces and implementations of file system related components.