nextcloud-desktop/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/NextcloudFilesDatabaseTables.swift
Claudio Cambra 18119b32bf
Add database table for directory from iOS NC
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2023-05-12 13:21:10 +08:00

116 lines
4.3 KiB
Swift

/*
* Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
*
* 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.
*/
import Foundation
import RealmSwift
class NextcloudFileMetadataTable: Object {
override func isEqual(_ object: Any?) -> Bool {
if let object = object as? NextcloudFileMetadataTable {
return self.fileId == object.fileId &&
self.account == object.account &&
self.path == object.path &&
self.fileName == object.fileName
}
return false
}
@objc dynamic var account = ""
@objc dynamic var assetLocalIdentifier = ""
@objc dynamic var checksums = ""
@objc dynamic var chunk: Bool = false
@objc dynamic var classFile = ""
@objc dynamic var commentsUnread: Bool = false
@objc dynamic var contentType = ""
@objc dynamic var creationDate = NSDate()
@objc dynamic var dataFingerprint = ""
@objc dynamic var date = NSDate()
@objc dynamic var directory: Bool = false
@objc dynamic var deleteAssetLocalIdentifier: Bool = false
@objc dynamic var downloadURL = ""
@objc dynamic var e2eEncrypted: Bool = false
@objc dynamic var edited: Bool = false
@objc dynamic var etag = ""
@objc dynamic var etagResource = ""
@objc dynamic var favorite: Bool = false
@objc dynamic var fileId = ""
@objc dynamic var fileName = ""
@objc dynamic var fileNameView = ""
@objc dynamic var hasPreview: Bool = false
@objc dynamic var iconName = ""
@objc dynamic var iconUrl = ""
@objc dynamic var isExtractFile: Bool = false
@objc dynamic var livePhoto: Bool = false
@objc dynamic var mountType = ""
@objc dynamic var name = "" // for unifiedSearch is the provider.id
@objc dynamic var note = ""
@objc dynamic var ocId = ""
@objc dynamic var ownerId = ""
@objc dynamic var ownerDisplayName = ""
@objc public var lock = false
@objc public var lockOwner = ""
@objc public var lockOwnerEditor = ""
@objc public var lockOwnerType = 0
@objc public var lockOwnerDisplayName = ""
@objc public var lockTime: Date?
@objc public var lockTimeOut: Date?
@objc dynamic var path = ""
@objc dynamic var permissions = ""
@objc dynamic var quotaUsedBytes: Int64 = 0
@objc dynamic var quotaAvailableBytes: Int64 = 0
@objc dynamic var resourceType = ""
@objc dynamic var richWorkspace: String?
@objc dynamic var serverUrl = ""
@objc dynamic var session = ""
@objc dynamic var sessionError = ""
@objc dynamic var sessionSelector = ""
@objc dynamic var sessionTaskIdentifier: Int = 0
@objc dynamic var sharePermissionsCollaborationServices: Int = 0
let sharePermissionsCloudMesh = List<String>()
let shareType = List<Int>()
@objc dynamic var size: Int64 = 0
@objc dynamic var status: Int = 0
@objc dynamic var subline: String?
@objc dynamic var trashbinFileName = ""
@objc dynamic var trashbinOriginalLocation = ""
@objc dynamic var trashbinDeletionTime = NSDate()
@objc dynamic var uploadDate = NSDate()
@objc dynamic var url = ""
@objc dynamic var urlBase = ""
@objc dynamic var user = ""
@objc dynamic var userId = ""
override static func primaryKey() -> String {
return "ocId"
}
}
class NextcloudDirectoryMetadataTable: Object {
@objc dynamic var account = ""
@objc dynamic var colorFolder: String?
@objc dynamic var e2eEncrypted: Bool = false
@objc dynamic var etag = ""
@objc dynamic var favorite: Bool = false
@objc dynamic var fileId = ""
@objc dynamic var ocId = ""
@objc dynamic var offline: Bool = false
@objc dynamic var permissions = ""
@objc dynamic var richWorkspace: String?
@objc dynamic var serverUrl = ""
override static func primaryKey() -> String {
return "ocId"
}
}