@@ -174,6 +174,14 @@ public struct ReplaceBehavior: Hashable, Sendable {
174174 public var fallbacks : [ ReplaceType ]
175175}
176176
177+ public enum CharacterForm : String , Codable , Hashable , Sendable {
178+ case hiragana
179+ case katakana
180+ case halfwidthKatakana = " halfwidth_katakana "
181+ case uppercase
182+ case lowercase
183+ }
184+
177185/// - アクション
178186/// - actions done in key pressing
179187public enum CodableActionData : Codable , Hashable , Sendable {
@@ -203,6 +211,9 @@ public enum CodableActionData: Codable, Hashable, Sendable {
203211 /// - select candidate to complete
204212 case selectCandidate( CandidateSelection )
205213
214+ /// - convert character form then complete current inputting words
215+ case completeCharacterForm( [ CharacterForm ] )
216+
206217 /// - complete current inputting words
207218 case complete
208219
@@ -248,6 +259,7 @@ public extension CodableActionData {
248259 case scheme_type, target
249260 case selection
250261 case replace_type, fallbacks
262+ case forms
251263 }
252264
253265 private enum ValueType : String , Codable {
@@ -259,6 +271,7 @@ public extension CodableActionData {
259271 case smart_delete
260272 case smart_delete_default
261273 case select_candidate
274+ case complete_character_form
262275 case complete
263276 case move_cursor
264277 case smart_move_cursor
@@ -276,6 +289,7 @@ public extension CodableActionData {
276289 private var key : ValueType {
277290 switch self {
278291 case . selectCandidate: return . select_candidate
292+ case . completeCharacterForm: return . complete_character_form
279293 case . complete: return . complete
280294 case . delete: return . delete
281295 case . dismissKeyboard: return . dismiss_keyboard
@@ -359,6 +373,8 @@ public extension CodableActionData {
359373 try container. encode ( value. target, forKey: . target)
360374 case let . selectCandidate( value) :
361375 try container. encode ( value, forKey: . selection)
376+ case let . completeCharacterForm( value) :
377+ try container. encode ( value, forKey: . forms)
362378 case let . moveTab( value) :
363379 try CodableTabArgument ( tab: value) . containerEncode ( container: & container)
364380 case . dismissKeyboard, . enableResizingMode, . toggleTabBar, . toggleCursorBar, . toggleCapsLockState, . complete, . smartDeleteDefault, . paste: break
@@ -391,6 +407,9 @@ public extension CodableActionData {
391407 case . select_candidate:
392408 let selection = try container. decode ( CandidateSelection . self, forKey: . selection)
393409 self = . selectCandidate( selection)
410+ case . complete_character_form:
411+ let forms = try container. decode ( [ CharacterForm ] . self, forKey: . forms)
412+ self = . completeCharacterForm( forms)
394413 case . complete:
395414 self = . complete
396415 case . move_cursor:
0 commit comments