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 unsafe fn styleKey(&self) -> Retained<NSString>;
44
45        /// Style title displayed in UI.
46        #[unsafe(method(title))]
47        #[unsafe(method_family = none)]
48        pub unsafe 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 unsafe fn attributes(&self)
56            -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
57
58        #[unsafe(method(initWithStyleKey:title:attributes:))]
59        #[unsafe(method_family = init)]
60        pub unsafe fn initWithStyleKey_title_attributes(
61            this: Allocated<Self>,
62            style_key: &NSString,
63            string: &NSString,
64            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
65        ) -> Retained<Self>;
66    );
67}
68
69/// Methods declared on superclass `NSObject`.
70impl UITextFormattingViewControllerFormattingStyle {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new() -> Retained<Self>;
79    );
80}