1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- //
- // KMHeaderFooterAdjectiveModel.swift
- // PDF Master
- //
- // Created by tangchao on 2022/12/27.
- //
- import Cocoa
- @objcMembers class KMHeaderFooterAdjectiveModel: KMWatermarkAdjectiveBaseModel {
- var leftMargin: CGFloat = 3.0
- var rightMargin: CGFloat = 3.0
- var bottomMargin: CGFloat = 3.0
- var topMargin: CGFloat = 3.0
- var topLeftString: String = ""
- var topCenterString: String = ""
- var topRightString: String = ""
- var bottomLeftString: String = ""
- var bottomCenterString: String = ""
- var bottomRightString: String = ""
-
- var startString: String = "1"
-
- var name: String = ""
-
- var cellHeight: CGFloat {
- get {
- var height: CGFloat = 12.0
- height += 40
-
- if (!self.topLeftString.isEmpty) {
- height += 26.0
- }
- if (!self.topCenterString.isEmpty) {
- height += 26.0
- }
- if (!self.topRightString.isEmpty) {
- height += 26.0
- }
- if (!self.bottomLeftString.isEmpty) {
- height += 26.0
- }
- if (!self.bottomCenterString.isEmpty) {
- height += 26.0
- }
- if (!self.bottomRightString.isEmpty) {
- height += 26.0
- }
- height += 25
-
- return height
- }
- }
-
- var hasVaild: Bool {
- get {
- for string in [self.topLeftString, self.topCenterString, self.topRightString,
- self.bottomLeftString, self.bottomCenterString, self.bottomRightString] {
- if (!string.isEmpty) {
- return true
- }
- }
-
- return false
- }
- }
-
- override init() {
- super.init()
-
- self.textFont = .font(name: "Helvetica", size: 10)
- self.textColor = .color(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0)
- }
- }
|