forked from scribe-org/Scribe-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandVariables.swift
More file actions
184 lines (149 loc) · 4.37 KB
/
Copy pathCommandVariables.swift
File metadata and controls
184 lines (149 loc) · 4.37 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// SPDX-License-Identifier: GPL-3.0-or-later
/*
* Variables associated with Scribe commands.
*/
import GRDB
import UIKit
// Basic keyboard functionality variables.
var capsLockPossible = false
var doubleSpacePeriodPossible = false
var autoAction0Visible = true
var autoAction2Visible = true
/// States of the emoji display corresponding to the number to show.
enum EmojisToShow {
case zero
case one
case two
case three
}
var emojisToShow: EmojisToShow = .zero
var currentEmojiTriggerWord = ""
var emojiAutoActionRepeatPossible = false
var firstCompletionIsHighlighted = false
var spaceAutoInsertIsPossible = false
var allowUndo = false
var previousWord = ""
var currentPrefix = ""
var pastStringInTextProxy = ""
var backspaceTimer: Timer?
var longPressOnDelete: Bool = false
var baseAutosuggestions = [String]()
var completionWords = [String]()
var numericAutosuggestions = [String]()
var emojisToDisplayArray = [String]()
var pronounAutosuggestionTenses: [String: String] = [:]
var verbsAfterPronounsArray = [String]()
// Variables for basic keyboard appearance.
let commandCursor = "│"
var commandPromptSpacing = ""
// Command input and output variables.
var inputWordIsCapitalized = false
var wordToReturn = ""
var potentialWordsToReturn = [String]()
var invalidCommandMsgWikidata = ""
var invalidCommandTextWikidata1 = ""
var invalidCommandTextWikidata2 = ""
var invalidCommandTextWikidata3 = ""
var invalidCommandMsgWiktionary = ""
var invalidCommandTextWiktionary1 = ""
var invalidCommandTextWiktionary2 = ""
var invalidCommandTextWiktionary3 = ""
// Annotation variables.
var annotationState = false
var activateAnnotationBtn = false
var hasNounForm = false
var hasPrepForm = false
var prepAnnotationForm = ""
var annotationDisplayWord = ""
var wordToCheck = ""
var wordsTyped = [String]()
var annotationsToAssign = [String]()
var annotationBtns = [UIButton]()
var annotationColors = [UIColor]()
var annotationSeparators = [UIView]()
var autoActionAnnotationBtns = [UIButton]()
var autoActionAnnotationSeparators = [UIView]()
var newAutoActionAnnotationsToAssign = [String]()
var newAutoActionAnnotationBtns = [UIButton]()
var newAutoActionAnnotationColors = [UIColor]()
var newAutoActionAnnotationSeparators = [UIView]()
// Prompts and saving groups of languages.
var allPrompts = [""]
var allColoredPrompts: [NSAttributedString] = []
let languagesWithCapitalizedNouns = ["German"]
let languagesWithCaseDependantOnPrepositions = ["German", "Russian"]
// MARK: Translate Variables
var translateKeyLbl = ""
var translatePrompt = ""
var translatePlaceholder = ""
var translatePromptAndCursor = ""
var translatePromptAndPlaceholder = ""
var translatePromptAndColorPlaceholder = NSMutableAttributedString()
var wordToTranslate = ""
// MARK: Conjugate Variables
var conjugateKeyLbl = ""
var conjugatePrompt = ""
var conjugatePlaceholder = ""
var conjugatePromptAndCursor = ""
var conjugatePromptAndPlaceholder = ""
var conjugatePromptAndColorPlaceholder = NSMutableAttributedString()
/// What the view of the conjugation display to display to the user.
enum FormsDisplayDimensions {
case view3x2
case view3x1
case view2x2
case view1x2
case view1x1
}
var formsDisplayDimensions: FormsDisplayDimensions = .view3x2
var allConjugations = [String]()
var allConjugationBtns = [UIButton]()
var formFPS = ""
var formSPS = ""
var formTPS = ""
var formFPP = ""
var formSPP = ""
var formTPP = ""
var formTop = ""
var formMiddle = ""
var formBottom = ""
var formTopLeft = ""
var formTopRight = ""
var formBottomLeft = ""
var formBottomRight = ""
var formLeft = ""
var formRight = ""
var formSingle = ""
var formLabelsDict = [
"FPS": "",
"SPS": "",
"TPS": "",
"FPP": "",
"SPP": "",
"TPP": "",
"Top": "",
"Middle": "",
"Bottom": "",
"TL": "",
"TR": "",
"BL": "",
"BR": "",
"Left": "",
"Right": "",
"Single": ""
]
var verbToConjugate = ""
var verbToDisplay = ""
var wordToDisplay = ""
var conjugationToDisplay = ""
// MARK: Plural Variables
var pluralKeyLbl = ""
var pluralPrompt = ""
var pluralPlaceholder = ""
var pluralPromptAndCursor = ""
var pluralPromptAndPlaceholder = ""
var pluralPromptAndColorPlaceholder = NSMutableAttributedString()
var alreadyPluralMsg = ""
// MARK: Download Data Variables
/// The message shown on the download data button when no language data has been downloaded.
var downloadDataMsg = "Please download language data"