// generated by diplomat-tool
// dart format off

part of 'lib.g.dart';

/// See the [Rust documentation for `GeneralCategory`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html) for more information.
enum GeneralCategory {
  /// See the [Rust documentation for `Unassigned`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.Unassigned) for more information.
  unassigned,
  /// See the [Rust documentation for `UppercaseLetter`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.UppercaseLetter) for more information.
  uppercaseLetter,
  /// See the [Rust documentation for `LowercaseLetter`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.LowercaseLetter) for more information.
  lowercaseLetter,
  /// See the [Rust documentation for `TitlecaseLetter`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.TitlecaseLetter) for more information.
  titlecaseLetter,
  /// See the [Rust documentation for `ModifierLetter`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.ModifierLetter) for more information.
  modifierLetter,
  /// See the [Rust documentation for `OtherLetter`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.OtherLetter) for more information.
  otherLetter,
  /// See the [Rust documentation for `NonspacingMark`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.NonspacingMark) for more information.
  nonspacingMark,
  /// See the [Rust documentation for `EnclosingMark`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.EnclosingMark) for more information.
  enclosingMark,
  /// See the [Rust documentation for `SpacingMark`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.SpacingMark) for more information.
  spacingMark,
  /// See the [Rust documentation for `DecimalNumber`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.DecimalNumber) for more information.
  decimalNumber,
  /// See the [Rust documentation for `LetterNumber`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.LetterNumber) for more information.
  letterNumber,
  /// See the [Rust documentation for `OtherNumber`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.OtherNumber) for more information.
  otherNumber,
  /// See the [Rust documentation for `SpaceSeparator`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.SpaceSeparator) for more information.
  spaceSeparator,
  /// See the [Rust documentation for `LineSeparator`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.LineSeparator) for more information.
  lineSeparator,
  /// See the [Rust documentation for `ParagraphSeparator`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.ParagraphSeparator) for more information.
  paragraphSeparator,
  /// See the [Rust documentation for `Control`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.Control) for more information.
  control,
  /// See the [Rust documentation for `Format`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.Format) for more information.
  format,
  /// See the [Rust documentation for `PrivateUse`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.PrivateUse) for more information.
  privateUse,
  /// See the [Rust documentation for `Surrogate`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.Surrogate) for more information.
  surrogate,
  /// See the [Rust documentation for `DashPunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.DashPunctuation) for more information.
  dashPunctuation,
  /// See the [Rust documentation for `OpenPunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.OpenPunctuation) for more information.
  openPunctuation,
  /// See the [Rust documentation for `ClosePunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.ClosePunctuation) for more information.
  closePunctuation,
  /// See the [Rust documentation for `ConnectorPunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.ConnectorPunctuation) for more information.
  connectorPunctuation,
  /// See the [Rust documentation for `OtherPunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.OtherPunctuation) for more information.
  otherPunctuation,
  /// See the [Rust documentation for `MathSymbol`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.MathSymbol) for more information.
  mathSymbol,
  /// See the [Rust documentation for `CurrencySymbol`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.CurrencySymbol) for more information.
  currencySymbol,
  /// See the [Rust documentation for `ModifierSymbol`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.ModifierSymbol) for more information.
  modifierSymbol,
  /// See the [Rust documentation for `OtherSymbol`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.OtherSymbol) for more information.
  otherSymbol,
  /// See the [Rust documentation for `InitialPunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.InitialPunctuation) for more information.
  initialPunctuation,
  /// See the [Rust documentation for `FinalPunctuation`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.GeneralCategory.html#variant.FinalPunctuation) for more information.
  finalPunctuation;

  /// See the [Rust documentation for `for_char`](https://docs.rs/icu/2.2.0/icu/properties/props/trait.EnumeratedProperty.html#tymethod.for_char) for more information.
  static GeneralCategory forChar(Rune ch) {
    final result = _icu4x_GeneralCategory_for_char_mv1(ch);
    return GeneralCategory.values[result];
  }

  /// Get the "long" name of this property value (returns empty if property value is unknown)
  ///
  /// See the [Rust documentation for `get`](https://docs.rs/icu/2.2.0/icu/properties/struct.PropertyNamesLongBorrowed.html#method.get) for more information.
  String? longName() {
    final result = _icu4x_GeneralCategory_long_name_mv1(index);
    if (!result.isOk) {
      return null;
    }
    return result.union.ok._toDart([], isStatic: true);
  }

  /// Get the "short" name of this property value (returns empty if property value is unknown)
  ///
  /// See the [Rust documentation for `get`](https://docs.rs/icu/2.2.0/icu/properties/struct.PropertyNamesShortBorrowed.html#method.get) for more information.
  String? shortName() {
    final result = _icu4x_GeneralCategory_short_name_mv1(index);
    if (!result.isOk) {
      return null;
    }
    return result.union.ok._toDart([], isStatic: true);
  }

  /// Convert to an integer value usable with ICU4C and `CodePointMapData`
  ///
  /// See the [Rust documentation for `to_icu4c_value`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.GeneralCategory.html#method.to_icu4c_value) for more information.
  int toIntegerValue() {
    final result = _icu4x_GeneralCategory_to_integer_value_mv1(index);
    return result;
  }

  /// Convert from an integer value from ICU4C or `CodePointMapData`
  ///
  /// See the [Rust documentation for `from_icu4c_value`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.GeneralCategory.html#method.from_icu4c_value) for more information.
  static GeneralCategory? fromIntegerValue(int other) {
    final result = _icu4x_GeneralCategory_from_integer_value_mv1(other);
    if (!result.isOk) {
      return null;
    }
    return GeneralCategory.values[result.union.ok];
  }

  static GeneralCategory? tryFromStr(String s) {
    final temp = _FinalizedArena();
    final result = _icu4x_GeneralCategory_try_from_str_mv1(s._utf8AllocIn(temp.arena));
    if (!result.isOk) {
      return null;
    }
    return GeneralCategory.values[result.union.ok];
  }

  /// Produces a `GeneralCategoryGroup` mask that can represent a group of general categories
  ///
  /// See the [Rust documentation for `GeneralCategoryGroup`](https://docs.rs/icu/2.2.0/icu/properties/props/struct.GeneralCategoryGroup.html) for more information.
  GeneralCategoryGroup toGroup() {
    final result = _icu4x_GeneralCategory_to_group_mv1(index);
    return GeneralCategoryGroup._fromFfi(result);
  }

}

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<ffi.Int32 Function(ffi.Uint32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_for_char_mv1')
// ignore: non_constant_identifier_names
external int _icu4x_GeneralCategory_for_char_mv1(Rune ch);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_long_name_mv1')
// ignore: non_constant_identifier_names
external _ResultSliceUtf8Void _icu4x_GeneralCategory_long_name_mv1(int self);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultSliceUtf8Void Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_short_name_mv1')
// ignore: non_constant_identifier_names
external _ResultSliceUtf8Void _icu4x_GeneralCategory_short_name_mv1(int self);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<ffi.Uint8 Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_to_integer_value_mv1')
// ignore: non_constant_identifier_names
external int _icu4x_GeneralCategory_to_integer_value_mv1(int self);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultInt32Void Function(ffi.Uint8)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_from_integer_value_mv1')
// ignore: non_constant_identifier_names
external _ResultInt32Void _icu4x_GeneralCategory_from_integer_value_mv1(int other);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_ResultInt32Void Function(_SliceUtf8)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_try_from_str_mv1')
// ignore: non_constant_identifier_names
external _ResultInt32Void _icu4x_GeneralCategory_try_from_str_mv1(_SliceUtf8 s);

// ignore: experimental_member_use
@meta.RecordUse()
@ffi.Native<_GeneralCategoryGroupFfi Function(ffi.Int32)>(isLeaf: true, symbol: 'icu4x_GeneralCategory_to_group_mv1')
// ignore: non_constant_identifier_names
external _GeneralCategoryGroupFfi _icu4x_GeneralCategory_to_group_mv1(int self);

// dart format on
