KMNAnnotationPopMode.swift 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. //
  2. // KMNAnnotationPopMode.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by 丁林圭 on 2024/12/1.
  6. //
  7. import Cocoa
  8. @objc public enum ListViewPopType: Int, CaseIterable{
  9. case generaAnnotation = 0
  10. case freeTextAnnotation
  11. case shapeAnnotation
  12. case linkAnnotation
  13. case formAnnotation
  14. case formRadioAnnotation
  15. case multpleAnnotation
  16. case popTypeNone
  17. }
  18. @objc public enum linkDetailType: Int, CaseIterable{
  19. case linkSetting
  20. case page
  21. case url
  22. case email
  23. }
  24. @objc public enum DetailPopType: Int, CaseIterable{
  25. case freeTextAlight = 0
  26. case contentEditAlight
  27. case freeTextDoubleAlight
  28. case doubleObjectAlight
  29. case freeTextMultpleAlight
  30. case multpleObjectAlight
  31. case detailNone
  32. }
  33. @objc public enum ObjectAlignType: Int, CaseIterable{
  34. case alightLeft = 0
  35. case alightRight
  36. case alightTop
  37. case alightVer
  38. case alightHor
  39. case alightBottom
  40. case averageVer
  41. case averageHor
  42. }
  43. @objc public enum ListViewDetailPopType: Int, CaseIterable{
  44. case textAlight = 0
  45. case alight
  46. }
  47. let changeValue:CGFloat = 1.0
  48. class KMNAnnotationPopMode: NSObject {
  49. private(set) var annotation: CPDFAnnotation?
  50. private(set) var annotations: [CPDFAnnotation] = []
  51. private(set) var annotationType: CAnnotationType = CAnnotationType.unkown
  52. private(set) var popType: ListViewPopType = .popTypeNone
  53. init(pdfAnnotations: [CPDFAnnotation]) {
  54. super.init()
  55. if let firstAnnotation = pdfAnnotations.first {
  56. annotation = firstAnnotation
  57. }
  58. self.annotations = pdfAnnotations
  59. popType = self.annotationPopType()
  60. }
  61. private func annotationPopType()->ListViewPopType {
  62. let firstAnnotation:CPDFAnnotation = annotations.first ?? CPDFAnnotation.init()
  63. let type = annotationType(annotation: firstAnnotation)
  64. if annotations.count == 0 {
  65. return .popTypeNone
  66. } else if annotations.count == 1 {
  67. return type
  68. } else {
  69. var isSampleAnnotation = true
  70. for i in 1 ..< annotations.count {
  71. let annotation = annotations[i]
  72. if type != annotationType(annotation: annotation) {
  73. isSampleAnnotation = false
  74. break
  75. }
  76. }
  77. if(isSampleAnnotation) {
  78. return type
  79. } else {
  80. return .popTypeNone
  81. }
  82. }
  83. }
  84. public func annotationType(annotation:CPDFAnnotation)->ListViewPopType {
  85. if annotation.isKind(of: CPDFMarkupAnnotation.self) {
  86. return .generaAnnotation
  87. } else if annotation.isKind(of: CPDFFreeTextAnnotation.self) {
  88. return .freeTextAnnotation
  89. } else if (annotation.isKind(of: CPDFInkAnnotation.self) ||
  90. annotation.isKind(of: CPDFCircleAnnotation.self) ||
  91. annotation.isKind(of: CPDFSquareAnnotation.self) ||
  92. annotation.isKind(of: CPDFLineAnnotation.self) ||
  93. annotation.isKind(of: CPDFPolygonAnnotation.self) ||
  94. annotation.isKind(of: CPDFPolylineAnnotation.self) ||
  95. annotation.isKind(of: CSelfSignAnnotation.self)) {
  96. return .shapeAnnotation
  97. } else if annotation.isKind(of: CPDFLinkAnnotation.self) {
  98. if(annotations.count > 1) {
  99. return .multpleAnnotation
  100. } else {
  101. return .linkAnnotation
  102. }
  103. } else if annotation.isForm() {
  104. if(annotations.count > 1) {
  105. return .multpleAnnotation
  106. } else if(annotations.count == 1) {
  107. if(annotation.isKind(of: CPDFButtonWidgetAnnotation.self)) {
  108. let button = annotation as! CPDFButtonWidgetAnnotation
  109. if(button.controlType() == .radioButtonControl) {
  110. return .formRadioAnnotation
  111. }
  112. }
  113. return .formAnnotation
  114. }
  115. }
  116. return .popTypeNone
  117. }
  118. private func convertAnnotationType(firstAnnotation:CPDFAnnotation) -> CAnnotationType {
  119. var annotationType = CAnnotationType.unkown
  120. if firstAnnotation.isKind(of: CSelfSignAnnotationFreeText.self) {
  121. let freeText:CSelfSignAnnotationFreeText = firstAnnotation as! CSelfSignAnnotationFreeText
  122. annotationType = freeText.subType
  123. } else if firstAnnotation.isKind(of: CPDFPolygonAnnotation.self) {
  124. annotationType = CAnnotationType.polyGon
  125. } else if firstAnnotation.isKind(of: CPDFPolylineAnnotation.self) {
  126. annotationType = CAnnotationType.line
  127. } else if firstAnnotation.isKind(of: CSelfSignAnnotation.self) {
  128. let selfSignAnnotation:CSelfSignAnnotation = firstAnnotation as! CSelfSignAnnotation
  129. annotationType = selfSignAnnotation.annotationType
  130. } else if firstAnnotation.isKind(of: CPDFFreeTextAnnotation.self) {
  131. annotationType = CAnnotationType.freeText
  132. } else if firstAnnotation.isKind(of: CPDFTextAnnotation.self) {
  133. annotationType = CAnnotationType.anchored
  134. } else if firstAnnotation.isKind(of: CPDFCircleAnnotation.self) {
  135. annotationType = CAnnotationType.circle
  136. } else if firstAnnotation.isKind(of: CPDFSquareAnnotation.self) {
  137. annotationType = CAnnotationType.square
  138. } else if firstAnnotation.isKind(of: CPDFMarkupAnnotation.self) {
  139. let markupAnnotation:CPDFMarkupAnnotation = firstAnnotation as! CPDFMarkupAnnotation
  140. let markupType = markupAnnotation.markupType()
  141. if markupType == .highlight {
  142. annotationType = CAnnotationType.highlight
  143. } else if(markupType == .strikeOut) {
  144. annotationType = CAnnotationType.strikeOut
  145. } else if(markupType == .underline) {
  146. annotationType = CAnnotationType.underline
  147. } else if(markupType == .squiggly) {
  148. annotationType = CAnnotationType.squiggly
  149. }
  150. } else if firstAnnotation.isKind(of: CPDFLineAnnotation.self) {
  151. let lineAnnotation:CPDFLineAnnotation = firstAnnotation as! CPDFLineAnnotation
  152. if lineAnnotation.isArrowLine() == true {
  153. annotationType = CAnnotationType.arrow
  154. } else {
  155. annotationType = CAnnotationType.line
  156. }
  157. } else if firstAnnotation.isKind(of: KMTableAnnotation.self) {
  158. annotationType = CAnnotationType.table
  159. } else if firstAnnotation.isKind(of: CPDFInkAnnotation.self) {
  160. annotationType = CAnnotationType.ink
  161. } else if firstAnnotation.isKind(of: CPDFLinkAnnotation.self) {
  162. annotationType = CAnnotationType.link
  163. } else if firstAnnotation.isKind(of: CPDFListSignatureAnnotation.self) {
  164. annotationType = CAnnotationType.signSignature
  165. } else if firstAnnotation.isKind(of: CPDFStampAnnotation.self) {
  166. annotationType = CAnnotationType.stamp
  167. } else if firstAnnotation.isKind(of: CPDFButtonWidgetAnnotation.self) {
  168. let buttonWidgetAnnotation:CPDFButtonWidgetAnnotation = firstAnnotation as! CPDFButtonWidgetAnnotation
  169. let controlType = buttonWidgetAnnotation.controlType()
  170. if controlType == .radioButtonControl {
  171. annotationType = CAnnotationType.radioButton
  172. } else if(controlType == .checkBoxControl) {
  173. annotationType = CAnnotationType.checkBox
  174. } else if(controlType == .pushButtonControl) {
  175. annotationType = CAnnotationType.actionButton
  176. }
  177. } else if firstAnnotation.isKind(of: CPDFTextWidgetAnnotation.self) {
  178. annotationType = CAnnotationType.textField
  179. } else if firstAnnotation.isKind(of: CPDFChoiceWidgetAnnotation.self) {
  180. annotationType = CAnnotationType.textField
  181. }
  182. else if firstAnnotation.isKind(of: CPDFChoiceWidgetAnnotation.self) {
  183. let choiceWidgetAnnotation:CPDFChoiceWidgetAnnotation = firstAnnotation as! CPDFChoiceWidgetAnnotation
  184. if(choiceWidgetAnnotation.isListChoice == true) {
  185. annotationType = CAnnotationType.listMenu
  186. } else {
  187. annotationType = CAnnotationType.comboBox
  188. }
  189. } else if firstAnnotation.isKind(of: CPDFSignatureWidgetAnnotation.self) {
  190. annotationType = CAnnotationType.signature
  191. }
  192. return annotationType
  193. }
  194. public func annotationColor()->NSColor? { //返回颜色是nil说明颜色不一样,返回透明则说明是没有颜色或者透明色
  195. var color:NSColor? = nil
  196. let isNotSameColor: Bool = CPDFListView.isAnnotationsContainMultiType(annotations, withType: .color)
  197. if isNotSameColor == false {
  198. let anColor = annotation?.color
  199. color = (anColor != nil) ? anColor : .clear
  200. }
  201. return color
  202. }
  203. public func setAnnotationColor(annotationColor:NSColor?) {
  204. for i in 0 ..< annotations.count {
  205. let annotation = annotations[i]
  206. if annotation.isKind(of: CSelfSignAnnotation.self) == true {
  207. if let signAnnotation:CSelfSignAnnotation = annotation as? CSelfSignAnnotation {
  208. signAnnotation.lineColor = annotationColor
  209. }
  210. } else {
  211. annotation.color = annotationColor
  212. }
  213. let annotationType = convertAnnotationType(firstAnnotation: annotation)
  214. var keyValue = ""
  215. if annotationType == .highlight {
  216. keyValue = CHighlightNoteColorKey
  217. } else if annotationType == .underline {
  218. keyValue = CUnderlineNoteColorKey
  219. } else if annotationType == .strikeOut {
  220. keyValue = CStrikeOutNoteColorKey
  221. } else if annotationType == .squiggly {
  222. keyValue = CSquigglyNoteColorKey
  223. } else if annotationType == .circle {
  224. keyValue = CCircleNoteColorKey
  225. } else if annotationType == .square {
  226. keyValue = CSquareNoteColorKey
  227. } else if annotationType == .freeText ||
  228. annotationType == .signDate ||
  229. annotationType == .signText {
  230. keyValue = CFreeTextNoteBorderColorKey
  231. } else if annotationType == .line {
  232. keyValue = CLineNoteColorKey
  233. } else if annotationType == .arrow {
  234. keyValue = CArrowNoteColorKey
  235. } else if annotationType == .ink {
  236. keyValue = CInkNoteColorKey
  237. } else if annotationType == .signFalse {
  238. keyValue = CAnnotationSelfSignFalseColorKey
  239. } else if annotationType == .signTure {
  240. keyValue = CAnnotationSelfSignTureColorKey
  241. } else if annotationType == .signLine {
  242. keyValue = CAnnotationSelfSignLineColorKey
  243. } else if annotationType == .signDot {
  244. keyValue = CAnnotationSelfSignDotColorKey
  245. } else if annotationType == .redact {
  246. keyValue = CAnnotationRedactBorderColorKey
  247. }
  248. if keyValue.isEmpty == false {
  249. if annotationColor != nil {
  250. UserDefaults.standard.setPDFListViewColor(annotationColor!, forKey: keyValue)
  251. } else {
  252. UserDefaults.standard.removeObject(forKey: keyValue)
  253. }
  254. }
  255. }
  256. }
  257. public func annotationFontColor()->NSColor? { //不管相同还是不相同 pop框都是显示第一个颜色
  258. var fontColor:NSColor? = nil
  259. if annotation?.isKind(of: CPDFFreeTextAnnotation.self) == true {
  260. let freeTextAnnotation = annotation as! CPDFFreeTextAnnotation
  261. let anColor = freeTextAnnotation.fontColor
  262. fontColor = (anColor != nil) ? anColor : .clear
  263. }
  264. return fontColor
  265. }
  266. public func setAnnotationFontColor(annotationFontColor:NSColor?) {
  267. for i in 0 ..< annotations.count {
  268. let annotation = annotations[i]
  269. if annotation.isKind(of: CPDFFreeTextAnnotation.self) == true {
  270. let freeTextAnnotation = annotation as! CPDFFreeTextAnnotation
  271. freeTextAnnotation.fontColor = annotationFontColor
  272. let keyValue = CFreeTextNoteFontColorKey
  273. if annotationFontColor != nil {
  274. UserDefaults.standard.setPDFListViewColor(annotationFontColor!, forKey: keyValue)
  275. } else {
  276. UserDefaults.standard.removeObject(forKey: keyValue)
  277. }
  278. }
  279. }
  280. }
  281. public func annotationAlignment()->NSTextAlignment { //natural时说明不一致
  282. var textAlignment:NSTextAlignment = .natural
  283. if annotation?.isKind(of: CPDFFreeTextAnnotation.self) == true {
  284. let freeTextAnnotation = annotation as! CPDFFreeTextAnnotation
  285. let isNotSameColor: Bool = CPDFListView.isAnnotationsContainMultiType(annotations, withType: .font_Alignment)
  286. if isNotSameColor == false {
  287. textAlignment = freeTextAnnotation.alignment
  288. }
  289. }
  290. return textAlignment
  291. }
  292. public func setAnnotationAlignment(annotationAlignment:NSTextAlignment) {
  293. for i in 0 ..< annotations.count {
  294. let annotation = annotations[i]
  295. if annotation.isKind(of: CPDFFreeTextAnnotation.self) == true {
  296. let freeTextAnnotation = annotation as! CPDFFreeTextAnnotation
  297. freeTextAnnotation.alignment = annotationAlignment
  298. let keyValue = CFreeTextNoteAlignmentKey
  299. UserDefaults.standard.set(annotationAlignment.rawValue, forKey: keyValue)
  300. }
  301. }
  302. }
  303. public func annotationFontName()->CPDFFont? { //返回字体是nil说明字体名不一样
  304. var cFont:CPDFFont? = nil
  305. if annotation?.isKind(of: CPDFFreeTextAnnotation.self) == true {
  306. let isNotSameName: Bool = CPDFListView.isAnnotationsContainMultiType(annotations, withType: .font_Name)
  307. let isNotSameStyle: Bool = CPDFListView.isAnnotationsContainMultiType(annotations, withType: .font_Style)
  308. if isNotSameName == false && isNotSameStyle == false {
  309. let freeTextAnnotation = annotation as! CPDFFreeTextAnnotation
  310. cFont = freeTextAnnotation.cFont
  311. }
  312. }
  313. return cFont
  314. }
  315. public func setAnnotationFont(font:CPDFFont) {
  316. for i in 0 ..< annotations.count {
  317. let annotation = annotations[i]
  318. if annotation.isKind(of: CPDFFreeTextAnnotation.self) == true {
  319. let freeTextAnnotation = annotation as! CPDFFreeTextAnnotation
  320. freeTextAnnotation.cFont = font
  321. let keyValue = CFreeTextNoteFontNameKey
  322. let appleFont:String = CPDFFont.convertAppleFont(font) ?? "Helvetica"
  323. UserDefaults.standard.set(appleFont, forKey: keyValue)
  324. }
  325. }
  326. }
  327. public func annotationFieldName()->String? { //pop只有一个的时候才会支持获取,不然是对齐
  328. var fieldName:String? = nil
  329. if annotations.count == 1 && annotation?.isForm() == true {
  330. if(annotation?.isKind(of: CPDFWidgetAnnotation.self) == true) {
  331. if let widgetAnnotation = annotation as? CPDFWidgetAnnotation {
  332. fieldName = widgetAnnotation.fieldName()
  333. }
  334. }
  335. }
  336. return fieldName
  337. }
  338. public func setannotationFieldName(fieldName:String) {
  339. for i in 0 ..< annotations.count {
  340. let annotation = annotations[i]
  341. if annotation.isKind(of: CPDFWidgetAnnotation.self) == true {
  342. if let widgetAnnotation = annotation as? CPDFWidgetAnnotation {
  343. widgetAnnotation.setFieldName(fieldName)
  344. }
  345. }
  346. }
  347. }
  348. public func annotationGropName()->String? { //pop只有一个的时候才会支持获取,不然是对齐
  349. var gropNameName:String? = nil
  350. if annotations.count == 1 && annotation?.isForm() == true {
  351. if(annotation?.isKind(of: CPDFButtonWidgetAnnotation.self) == true) {
  352. if let buttonWidgetAnnotation = annotation as? CPDFButtonWidgetAnnotation {
  353. if buttonWidgetAnnotation.controlType() == .radioButtonControl {
  354. gropNameName = buttonWidgetAnnotation.buttonWidgetStateString()
  355. }
  356. }
  357. }
  358. }
  359. return gropNameName
  360. }
  361. public func setannotationGropName(gropName:String) {
  362. for i in 0 ..< annotations.count {
  363. let annotation = annotations[i]
  364. if(annotation.isKind(of: CPDFButtonWidgetAnnotation.self) == true) {
  365. if let buttonWidgetAnnotation = annotation as? CPDFButtonWidgetAnnotation {
  366. buttonWidgetAnnotation.setButtonWidgetStateString(gropName)
  367. }
  368. }
  369. }
  370. }
  371. public func zoomOutFontSize()->Bool{ //悬浮菜单注释同一类型
  372. var isChange:Bool = false
  373. for i in 0 ..< annotations.count {
  374. let annotation = annotations[i]
  375. if annotation.isKind(of: CPDFFreeTextAnnotation.self) == true {
  376. let freeTextAnnotation = annotation as! CPDFFreeTextAnnotation
  377. var fontSize = freeTextAnnotation.fontSize
  378. if(fontSize > changeValue) {
  379. fontSize -= changeValue
  380. freeTextAnnotation.fontSize = fontSize
  381. let keyValue = CFreeTextNoteFontSizeKey
  382. UserDefaults.standard.set(fontSize, forKey: keyValue)
  383. isChange = true
  384. }
  385. }
  386. }
  387. return isChange
  388. }
  389. public func zoomInFontSize()->Bool{ //悬浮菜单注释同一类型
  390. for i in 0 ..< annotations.count {
  391. let annotation = annotations[i]
  392. if annotation.isKind(of: CPDFFreeTextAnnotation.self) == true {
  393. let freeTextAnnotation = annotation as! CPDFFreeTextAnnotation
  394. var fontSize = freeTextAnnotation.fontSize
  395. fontSize += changeValue
  396. freeTextAnnotation.fontSize = fontSize
  397. let keyValue = CFreeTextNoteFontSizeKey
  398. UserDefaults.standard.set(fontSize, forKey: keyValue)
  399. }
  400. }
  401. return true
  402. }
  403. public func zoomOutShapeWidth()->Bool{
  404. for i in 0 ..< annotations.count {
  405. let annotation = annotations[i]
  406. var shapeWidth = annotation.borderWidth
  407. if annotation.isKind(of: CSelfSignAnnotation.self) == true {
  408. if let signAnnotation:CSelfSignAnnotation = annotation as? CSelfSignAnnotation {
  409. shapeWidth = signAnnotation.lineAnnotationWidth
  410. }
  411. }
  412. if(shapeWidth > changeValue) {
  413. shapeWidth -= changeValue
  414. if annotation.isKind(of: CSelfSignAnnotation.self) == true {
  415. if let signAnnotation:CSelfSignAnnotation = annotation as? CSelfSignAnnotation {
  416. signAnnotation.lineAnnotationWidth = shapeWidth
  417. }
  418. } else {
  419. annotation.borderWidth = shapeWidth
  420. }
  421. var keyValue = ""
  422. let annotationType = convertAnnotationType(firstAnnotation: annotation)
  423. if annotationType == .circle {
  424. keyValue = CCircleNoteLineWidthKey
  425. } else if annotationType == .square {
  426. keyValue = CSquareNoteLineWidthKey
  427. } else if annotationType == .line {
  428. keyValue = CLineNoteLineWidthKey
  429. } else if annotationType == .arrow {
  430. keyValue = CArrowNoteLineWidthKey
  431. } else if annotationType == .ink {
  432. keyValue = CInkNoteLineWidthKey
  433. } else if annotationType == .freeText {
  434. keyValue = CAnnotationTextWidgetLineWidthKey
  435. } else if annotationType == .signFalse {
  436. keyValue = CAnnotationSelfSignFalseLineWidthKey
  437. } else if annotationType == .signTure {
  438. keyValue = CAnnotationSelfSignTureLineWidthKey
  439. } else if annotationType == .signCircle {
  440. keyValue = CAnnotationSelfSignCircleLineWidthKey
  441. } else if annotationType == .signLine {
  442. keyValue = CAnnotationSelfSignLineLineWidthKey
  443. }
  444. if keyValue.isEmpty == false {
  445. UserDefaults.standard.set(shapeWidth, forKey: keyValue)
  446. }
  447. return true
  448. }
  449. }
  450. return false
  451. }
  452. public func zoomInShapeWidth()->Bool{
  453. for i in 0 ..< annotations.count {
  454. let annotation = annotations[i]
  455. var shapeWidth = annotation.borderWidth
  456. if annotation.isKind(of: CSelfSignAnnotation.self) == true {
  457. if let signAnnotation:CSelfSignAnnotation = annotation as? CSelfSignAnnotation {
  458. shapeWidth = signAnnotation.lineAnnotationWidth
  459. }
  460. }
  461. shapeWidth += changeValue
  462. if annotation.isKind(of: CSelfSignAnnotation.self) == true {
  463. if let signAnnotation:CSelfSignAnnotation = annotation as? CSelfSignAnnotation {
  464. signAnnotation.lineAnnotationWidth = shapeWidth
  465. }
  466. } else {
  467. annotation.borderWidth = shapeWidth
  468. }
  469. var keyValue = ""
  470. let annotationType = convertAnnotationType(firstAnnotation: annotation)
  471. if annotationType == .circle {
  472. keyValue = CCircleNoteLineWidthKey
  473. } else if annotationType == .square {
  474. keyValue = CSquareNoteLineWidthKey
  475. } else if annotationType == .line {
  476. keyValue = CLineNoteLineWidthKey
  477. } else if annotationType == .arrow {
  478. keyValue = CArrowNoteLineWidthKey
  479. } else if annotationType == .ink {
  480. keyValue = CInkNoteLineWidthKey
  481. } else if annotationType == .freeText {
  482. keyValue = CAnnotationTextWidgetLineWidthKey
  483. } else if annotationType == .signFalse {
  484. keyValue = CAnnotationSelfSignFalseLineWidthKey
  485. } else if annotationType == .signTure {
  486. keyValue = CAnnotationSelfSignTureLineWidthKey
  487. } else if annotationType == .signCircle {
  488. keyValue = CAnnotationSelfSignCircleLineWidthKey
  489. } else if annotationType == .signLine {
  490. keyValue = CAnnotationSelfSignLineLineWidthKey
  491. }
  492. if keyValue.isEmpty == false {
  493. UserDefaults.standard.set(shapeWidth, forKey: keyValue)
  494. }
  495. }
  496. return true
  497. }
  498. }