diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 54fd32e6f1..faa3a6761a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -293,6 +293,8 @@ IF( APPLE ) macOS/fileprovider_mac.mm macOS/fileproviderdomainmanager.h macOS/fileproviderdomainmanager_mac.mm + macOS/fileprovideritemmetadata.h + macOS/fileprovideritemmetadata.cpp macOS/fileprovidersettingscontroller.h macOS/fileprovidersettingscontroller_mac.mm macOS/fileprovidersocketcontroller.h diff --git a/src/gui/macOS/fileprovideritemmetadata.cpp b/src/gui/macOS/fileprovideritemmetadata.cpp new file mode 100644 index 0000000000..cec1dfa79e --- /dev/null +++ b/src/gui/macOS/fileprovideritemmetadata.cpp @@ -0,0 +1,168 @@ +/* + * Copyright (C) 2023 by Claudio Cambra + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#include "fileprovideritemmetadata.h" + +namespace OCC { + +namespace Mac { + +QString FileProviderItemMetadata::identifier() const +{ + return _identifier; +} + +QString FileProviderItemMetadata::parentItemIdentifier() const +{ + return _parentItemIdentifier; +} + +QString FileProviderItemMetadata::filename() const +{ + return _filename; +} + +QString FileProviderItemMetadata::typeIdentifier() const +{ + return _typeIdentifier; +} + +QString FileProviderItemMetadata::symlinkTargetPath() const +{ + return _symlinkTargetPath; +} + +QString FileProviderItemMetadata::uploadingError() const +{ + return _uploadingError; +} + +QString FileProviderItemMetadata::downloadingError() const +{ + return _downloadingError; +} + +QString FileProviderItemMetadata::mostRecentEditorName() const +{ + return _mostRecentEditorName; +} + +QString FileProviderItemMetadata::ownerName() const +{ + return _ownerName; +} + +QDateTime FileProviderItemMetadata::contentModificationDate() const +{ + return _contentModificationDate; +} + +QDateTime FileProviderItemMetadata::creationDate() const +{ + return _creationDate; +} + +QDateTime FileProviderItemMetadata::lastUsedDate() const +{ + return _lastUsedDate; +} + +QByteArray FileProviderItemMetadata::contentVersion() const +{ + return _contentVersion; +} + +QByteArray FileProviderItemMetadata::metadataVersion() const +{ + return _metadataVersion; +} + +QByteArray FileProviderItemMetadata::tagData() const +{ + return _tagData; +} + +QHash FileProviderItemMetadata::extendedAttributes() const +{ + return _extendedAttributes; +} + +int FileProviderItemMetadata::capabilities() const +{ + return _capabilities; +} + +int FileProviderItemMetadata::fileSystemFlags() const +{ + return _fileSystemFlags; +} + +unsigned int FileProviderItemMetadata::childItemCount() const +{ + return _childItemCount; +} + +unsigned int FileProviderItemMetadata::typeOsCode() const +{ + return _typeOsCode; +} + +unsigned int FileProviderItemMetadata::creatorOsCode() const +{ + return _creatorOsCode; +} + +unsigned long long FileProviderItemMetadata::documentSize() const +{ + return _documentSize; +} + +bool FileProviderItemMetadata::mostRecentVersionDownloaded() const +{ + return _mostRecentVersionDownloaded; +} + +bool FileProviderItemMetadata::uploading() const +{ + return _uploading; +} + +bool FileProviderItemMetadata::uploaded() const +{ + return _uploaded; +} + +bool FileProviderItemMetadata::downloading() const +{ + return _downloading; +} + +bool FileProviderItemMetadata::downloaded() const +{ + return _downloaded; +} + +bool FileProviderItemMetadata::shared() const +{ + return _shared; +} + +bool FileProviderItemMetadata::sharedByCurrentUser() const +{ + return _sharedByCurrentUser; +} + +} + +} diff --git a/src/gui/macOS/fileprovideritemmetadata.h b/src/gui/macOS/fileprovideritemmetadata.h new file mode 100644 index 0000000000..82b91bf5f5 --- /dev/null +++ b/src/gui/macOS/fileprovideritemmetadata.h @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2023 by Claudio Cambra + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +#pragma once + +#include +#include + +namespace OCC { + +namespace Mac { + +class FileProviderItemMetadata +{ + Q_GADGET + + Q_PROPERTY(QString identifier READ identifier CONSTANT) + Q_PROPERTY(QString parentItemIdentifier READ parentItemIdentifier CONSTANT) + Q_PROPERTY(QString filename READ filename CONSTANT) + Q_PROPERTY(QString typeIdentifier READ typeIdentifier CONSTANT) + Q_PROPERTY(QString symlinkTargetPath READ symlinkTargetPath CONSTANT) + Q_PROPERTY(QString uploadingError READ uploadingError CONSTANT) + Q_PROPERTY(QString downloadingError READ downloadingError CONSTANT) + Q_PROPERTY(QString mostRecentEditorName READ mostRecentEditorName CONSTANT) + Q_PROPERTY(QString ownerName READ ownerName CONSTANT) + Q_PROPERTY(QDateTime contentModificationDate READ contentModificationDate CONSTANT) + Q_PROPERTY(QDateTime creationDate READ creationDate CONSTANT) + Q_PROPERTY(QDateTime lastUsedDate READ lastUsedDate CONSTANT) + Q_PROPERTY(QByteArray contentVersion READ contentVersion CONSTANT) + Q_PROPERTY(QByteArray metadataVersion READ metadataVersion CONSTANT) + Q_PROPERTY(QByteArray tagData READ tagData CONSTANT) + Q_PROPERTY(QHash extendedAttributes READ extendedAttributes CONSTANT) + Q_PROPERTY(int capabilities READ capabilities CONSTANT) + Q_PROPERTY(int fileSystemFlags READ fileSystemFlags CONSTANT) + Q_PROPERTY(unsigned int childItemCount READ childItemCount CONSTANT) + Q_PROPERTY(unsigned int typeOsCode READ typeOsCode CONSTANT) + Q_PROPERTY(unsigned int creatorOsCode READ creatorOsCode CONSTANT) + Q_PROPERTY(unsigned long long documentSize READ documentSize CONSTANT) + Q_PROPERTY(bool mostRecentVersionDownloaded READ mostRecentVersionDownloaded CONSTANT) + Q_PROPERTY(bool uploading READ uploading CONSTANT) + Q_PROPERTY(bool uploaded READ uploaded CONSTANT) + Q_PROPERTY(bool downloading READ downloading CONSTANT) + Q_PROPERTY(bool downloaded READ downloaded CONSTANT) + Q_PROPERTY(bool shared READ shared CONSTANT) + Q_PROPERTY(bool sharedByCurrentUser READ sharedByCurrentUser CONSTANT) + +public: + QString identifier() const; + QString parentItemIdentifier() const; + QString filename() const; + QString typeIdentifier() const; + QString symlinkTargetPath() const; + QString uploadingError() const; + QString downloadingError() const; + QString mostRecentEditorName() const; + QString ownerName() const; + QDateTime contentModificationDate() const; + QDateTime creationDate() const; + QDateTime lastUsedDate() const; + QByteArray contentVersion() const; + QByteArray metadataVersion() const; + QByteArray tagData() const; + QHash extendedAttributes() const; + int capabilities() const; + int fileSystemFlags() const; + unsigned int childItemCount() const; + unsigned int typeOsCode() const; + unsigned int creatorOsCode() const; + unsigned long long documentSize() const; + bool mostRecentVersionDownloaded() const; + bool uploading() const; + bool uploaded() const; + bool downloading() const; + bool downloaded() const; + bool shared() const; + bool sharedByCurrentUser() const; + +private: + QString _identifier; + QString _parentItemIdentifier; + QString _filename; + QString _typeIdentifier; + QString _symlinkTargetPath; + QString _uploadingError; + QString _downloadingError; + QString _mostRecentEditorName; + QString _ownerName; + QDateTime _contentModificationDate; + QDateTime _creationDate; + QDateTime _lastUsedDate; + QByteArray _contentVersion; + QByteArray _metadataVersion; + QByteArray _tagData; + QHash _extendedAttributes; + quint64 _favoriteRank = 0; + int _capabilities = 0; + int _fileSystemFlags = 0; + unsigned int _childItemCount = 0; + unsigned int _typeOsCode = 0; + unsigned int _creatorOsCode = 0; + unsigned long long _documentSize = 0; + bool _mostRecentVersionDownloaded = false; + bool _uploading = false; + bool _uploaded = false; + bool _downloading = false; + bool _downloaded = false; + bool _shared = false; + bool _sharedByCurrentUser = false; + bool _trashed = false; +}; + +} + +}