-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathHeader+WordPress.swift
More file actions
55 lines (51 loc) · 2.73 KB
/
Header+WordPress.swift
File metadata and controls
55 lines (51 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import Foundation
import Aztec
import Gridicons
import WordPressShared
import WordPressSharedUI
// MARK: - Header and List presentation extensions
//
extension Header.HeaderType {
public var formattingIdentifier: FormattingIdentifier {
switch self {
case .none: return FormattingIdentifier.p
case .h1: return FormattingIdentifier.header1
case .h2: return FormattingIdentifier.header2
case .h3: return FormattingIdentifier.header3
case .h4: return FormattingIdentifier.header4
case .h5: return FormattingIdentifier.header5
case .h6: return FormattingIdentifier.header6
@unknown default: fatalError()
}
}
public var description: String {
switch self {
case .none: return AppLocalizedString("Default", comment: "Description of the default paragraph formatting style in the editor.")
case .h1: return AppLocalizedString("Heading 1", comment: "H1 Aztec Style")
case .h2: return AppLocalizedString("Heading 2", comment: "H2 Aztec Style")
case .h3: return AppLocalizedString("Heading 3", comment: "H3 Aztec Style")
case .h4: return AppLocalizedString("Heading 4", comment: "H4 Aztec Style")
case .h5: return AppLocalizedString("Heading 5", comment: "H5 Aztec Style")
case .h6: return AppLocalizedString("Heading 6", comment: "H6 Aztec Style")
@unknown default: fatalError()
}
}
public var accessibilityLabel: String {
switch self {
case .none: return AppLocalizedString("Switches to the default Font Size", comment: "Accessibility Identifier for the Default Font Aztec Style.")
case .h1: return AppLocalizedString("Switches to the Heading 1 font size", comment: "Accessibility Identifier for the H1 Aztec Style")
case .h2: return AppLocalizedString("Switches to the Heading 2 font size", comment: "Accessibility Identifier for the H2 Aztec Style")
case .h3: return AppLocalizedString("Switches to the Heading 3 font size", comment: "Accessibility Identifier for the H3 Aztec Style")
case .h4: return AppLocalizedString("Switches to the Heading 4 font size", comment: "Accessibility Identifier for the H4 Aztec Style")
case .h5: return AppLocalizedString("Switches to the Heading 5 font size", comment: "Accessibility Identifier for the H5 Aztec Style")
case .h6: return AppLocalizedString("Switches to the Heading 6 font size", comment: "Accessibility Identifier for the H6 Aztec Style")
@unknown default: fatalError()
}
}
public var iconImage: UIImage? {
switch self {
case .none: return UIImage(color: .clear, size: Gridicon.defaultSize)
default: return formattingIdentifier.iconImage
}
}
}