objc2_ui_kit/generated/
UITextFormattingViewControllerFormattingStyle.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// Type that defines formatting style presented in text formatting view.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerformattingstyle?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct UITextFormattingViewControllerFormattingStyle;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for UITextFormattingViewControllerFormattingStyle {}
20);
21
22extern_conformance!(
23    unsafe impl NSCopying for UITextFormattingViewControllerFormattingStyle {}
24);
25
26unsafe impl CopyingHelper for UITextFormattingViewControllerFormattingStyle {
27    type Result = Self;
28}
29
30extern_conformance!(
31    unsafe impl NSObjectProtocol for UITextFormattingViewControllerFormattingStyle {}
32);
33
34extern_conformance!(
35    unsafe impl NSSecureCoding for UITextFormattingViewControllerFormattingStyle {}
36);
37
38impl UITextFormattingViewControllerFormattingStyle {
39    extern_methods!(
40        /// Formatting style key.
41        #[unsafe(method(styleKey))]
42        #[unsafe(method_family = none)]
43        pub fn styleKey(&self) -> Retained<NSString>;
44
45        /// Style title displayed in UI.
46        #[unsafe(method(title))]
47        #[unsafe(method_family = none)]
48        pub fn title(&self) -> Retained<NSString>;
49
50        /// Attributes corresponding to this formatting style.
51        ///
52        /// Alongside `title`, these may be used to create a preview for this formatting style.
53        #[unsafe(method(attributes))]
54        #[unsafe(method_family = none)]
55        pub fn attributes(&self) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
56
57        /// # Safety
58        ///
59        /// `attributes` generic should be of the correct type.
60        #[unsafe(method(initWithStyleKey:title:attributes:))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn initWithStyleKey_title_attributes(
63            this: Allocated<Self>,
64            style_key: &NSString,
65            string: &NSString,
66            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
67        ) -> Retained<Self>;
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72impl UITextFormattingViewControllerFormattingStyle {
73    extern_methods!(
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[unsafe(method(new))]
79        #[unsafe(method_family = new)]
80        pub fn new() -> Retained<Self>;
81    );
82}
83
84impl DefaultRetained for UITextFormattingViewControllerFormattingStyle {
85    #[inline]
86    fn default_retained() -> Retained<Self> {
87        Self::new()
88    }
89}