NCCellProtocol.swift 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //
  2. // NCCellProtocol.swift
  3. // Nextcloud
  4. //
  5. // Created by Philippe Weidmann on 05.06.20.
  6. // Copyright © 2020 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. import UIKit
  24. protocol NCCellProtocol {
  25. var fileAvatarImageView: UIImageView? { get }
  26. var fileAccount: String? { get set }
  27. var fileOcId: String? { get set }
  28. var fileOcIdTransfer: String? { get set }
  29. var filePreviewImageView: UIImageView? { get set }
  30. var fileUser: String? { get set }
  31. var fileTitleLabel: UILabel? { get set }
  32. var fileInfoLabel: UILabel? { get set }
  33. var fileSubinfoLabel: UILabel? { get set }
  34. var fileStatusImage: UIImageView? { get set }
  35. var fileLocalImage: UIImageView? { get set }
  36. var fileFavoriteImage: UIImageView? { get set }
  37. var fileSharedImage: UIImageView? { get set }
  38. var fileMoreImage: UIImageView? { get set }
  39. var cellSeparatorView: UIView? { get set }
  40. func titleInfoTrailingDefault()
  41. func titleInfoTrailingFull()
  42. func writeInfoDateSize(date: NSDate, size: Int64)
  43. func setButtonMore(image: UIImage)
  44. func hideImageItem(_ status: Bool)
  45. func hideImageFavorite(_ status: Bool)
  46. func hideImageStatus(_ status: Bool)
  47. func hideImageLocal(_ status: Bool)
  48. func hideLabelTitle(_ status: Bool)
  49. func hideLabelInfo(_ status: Bool)
  50. func hideLabelSubinfo(_ status: Bool)
  51. func hideButtonShare(_ status: Bool)
  52. func hideButtonMore(_ status: Bool)
  53. func selected(_ status: Bool, isEditMode: Bool)
  54. func setAccessibility(label: String, value: String)
  55. func setTags(tags: [String])
  56. func setIconOutlines()
  57. }
  58. extension NCCellProtocol {
  59. var fileAvatarImageView: UIImageView? {
  60. return nil
  61. }
  62. var fileAccount: String? {
  63. get { return nil }
  64. set {}
  65. }
  66. var fileOcId: String? {
  67. get { return nil }
  68. set {}
  69. }
  70. var fileOcIdTransfer: String? {
  71. get { return nil }
  72. set {}
  73. }
  74. var filePreviewImageView: UIImageView? {
  75. get { return nil }
  76. set {}
  77. }
  78. var fileTitleLabel: UILabel? {
  79. get { return nil }
  80. set {}
  81. }
  82. var fileInfoLabel: UILabel? {
  83. get { return nil }
  84. set { }
  85. }
  86. var fileSubinfoLabel: UILabel? {
  87. get { return nil }
  88. set { }
  89. }
  90. var fileStatusImage: UIImageView? {
  91. get { return nil }
  92. set {}
  93. }
  94. var fileLocalImage: UIImageView? {
  95. get { return nil }
  96. set {}
  97. }
  98. var fileFavoriteImage: UIImageView? {
  99. get { return nil }
  100. set {}
  101. }
  102. var fileSharedImage: UIImageView? {
  103. get { return nil }
  104. set {}
  105. }
  106. var fileMoreImage: UIImageView? {
  107. get { return nil }
  108. set {}
  109. }
  110. var cellSeparatorView: UIView? {
  111. get { return nil }
  112. set {}
  113. }
  114. func titleInfoTrailingDefault() {}
  115. func titleInfoTrailingFull() {}
  116. func writeInfoDateSize(date: NSDate, size: Int64) {}
  117. func setButtonMore(image: UIImage) {}
  118. func hideImageItem(_ status: Bool) {}
  119. func hideImageFavorite(_ status: Bool) {}
  120. func hideImageStatus(_ status: Bool) {}
  121. func hideImageLocal(_ status: Bool) {}
  122. func hideLabelTitle(_ status: Bool) {}
  123. func hideLabelInfo(_ status: Bool) {}
  124. func hideLabelSubinfo(_ status: Bool) {}
  125. func hideButtonShare(_ status: Bool) {}
  126. func hideButtonMore(_ status: Bool) {}
  127. func selected(_ status: Bool, isEditMode: Bool) {}
  128. func setAccessibility(label: String, value: String) {}
  129. func setTags(tags: [String]) {}
  130. func setIconOutlines() {}
  131. }