objc2_av_foundation/generated/
AVTextStyleRule.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    /// [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avtextstylerule?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct AVTextStyleRule;
14);
15
16extern_conformance!(
17    unsafe impl NSCopying for AVTextStyleRule {}
18);
19
20unsafe impl CopyingHelper for AVTextStyleRule {
21    type Result = Self;
22}
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for AVTextStyleRule {}
26);
27
28impl AVTextStyleRule {
29    extern_methods!(
30        #[unsafe(method(init))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34        #[unsafe(method(new))]
35        #[unsafe(method_family = new)]
36        pub unsafe fn new() -> Retained<Self>;
37
38        /// Converts an NSArray of AVTextStyleRules into a serializable property list that can be used for persistent storage.
39        ///
40        /// Parameter `textStyleRules`: An array of AVTextStyleRules.
41        ///
42        /// Returns: A serializable property list.
43        ///
44        /// For serialization utilities, see NSPropertyList.h.
45        #[unsafe(method(propertyListForTextStyleRules:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn propertyListForTextStyleRules(
48            text_style_rules: &NSArray<AVTextStyleRule>,
49        ) -> Retained<AnyObject>;
50
51        /// Converts a property list into an NSArray of AVTextStyleRules.
52        ///
53        /// Parameter `plist`: A property list, normally obtained previously via an invocation of +propertyListForTextStyleRules:.
54        ///
55        /// Returns: An NSArray of AVTextStyleRules
56        ///
57        /// # Safety
58        ///
59        /// `plist` should be of the correct type.
60        #[unsafe(method(textStyleRulesFromPropertyList:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn textStyleRulesFromPropertyList(
63            plist: &AnyObject,
64        ) -> Option<Retained<NSArray<AVTextStyleRule>>>;
65
66        /// Creates an instance of AVTextStyleRule with the specified text markup attributes.
67        ///
68        /// Parameter `textMarkupAttributes`: An NSDictionary with keys representing text style attributes that are specifiable in text markup. Eligible keys are defined in
69        /// <CoreMedia
70        /// /CMTextMarkup.h>.
71        ///
72        /// Returns: An instance of AVTextStyleRule
73        ///
74        /// Equivalent to invoking +textStyleRuleWithTextMarkupAttributes:textSelector: with a value of nil for textSelector.
75        ///
76        /// # Safety
77        ///
78        /// `text_markup_attributes` generic should be of the correct type.
79        #[unsafe(method(textStyleRuleWithTextMarkupAttributes:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn textStyleRuleWithTextMarkupAttributes(
82            text_markup_attributes: &NSDictionary<NSString, AnyObject>,
83        ) -> Option<Retained<AVTextStyleRule>>;
84
85        /// Creates an instance of AVTextStyleRule with the specified text markup attributes and an identifier for the range or ranges of text to which the attributes should be applied.
86        ///
87        /// Parameter `textMarkupAttributes`: An NSDictionary with keys representing text style attributes that are specifiable in text markup. Eligible keys are defined in
88        /// <CoreMedia
89        /// /CMTextMarkup.h>.
90        ///
91        /// Parameter `textSelector`: An identifier for the range or ranges of text to which the attributes should be applied. Eligible identifiers are determined by the format and content of the legible media. A value of nil indicates that the textMarkupAttributes should be applied as default styles for all text unless overridden by content markup or other applicable text selectors.
92        ///
93        /// Returns: An instance of AVTextStyleRule
94        ///
95        /// # Safety
96        ///
97        /// `text_markup_attributes` generic should be of the correct type.
98        #[unsafe(method(textStyleRuleWithTextMarkupAttributes:textSelector:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn textStyleRuleWithTextMarkupAttributes_textSelector(
101            text_markup_attributes: &NSDictionary<NSString, AnyObject>,
102            text_selector: Option<&NSString>,
103        ) -> Option<Retained<AVTextStyleRule>>;
104
105        /// Creates an instance of AVTextStyleRule with the specified text markup attributes.
106        ///
107        /// Parameter `textMarkupAttributes`: An NSDictionary with keys representing text style attributes that are specifiable in text markup. Eligible keys are defined in
108        /// <CoreMedia
109        /// /CMTextMarkup.h>.
110        ///
111        /// Returns: An instance of AVTextStyleRule
112        ///
113        /// Equivalent to invoking -initWithTextMarkupAttributes:textSelector: with a value of nil for textSelector.
114        ///
115        /// # Safety
116        ///
117        /// `text_markup_attributes` generic should be of the correct type.
118        #[unsafe(method(initWithTextMarkupAttributes:))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn initWithTextMarkupAttributes(
121            this: Allocated<Self>,
122            text_markup_attributes: &NSDictionary<NSString, AnyObject>,
123        ) -> Option<Retained<Self>>;
124
125        /// Creates an instance of AVTextStyleRule with the specified text markup attributes and an identifier for the range or ranges of text to which the attributes should be applied.
126        ///
127        /// Parameter `textMarkupAttributes`: An NSDictionary with keys representing text style attributes that are specifiable in text markup. Eligible keys are defined in
128        /// <CoreMedia
129        /// /CMTextMarkup.h>.
130        ///
131        /// Parameter `textSelector`: An identifier for the range or ranges of text to which the attributes should be applied. Eligible identifiers are determined by the format and content of the legible media. A value of nil indicates that the textMarkupAttributes should be applied as default styles for all text unless overridden by content markup or other applicable text selectors.
132        ///
133        /// Returns: An instance of AVTextStyleRule
134        ///
135        /// # Safety
136        ///
137        /// `text_markup_attributes` generic should be of the correct type.
138        #[unsafe(method(initWithTextMarkupAttributes:textSelector:))]
139        #[unsafe(method_family = init)]
140        pub unsafe fn initWithTextMarkupAttributes_textSelector(
141            this: Allocated<Self>,
142            text_markup_attributes: &NSDictionary<NSString, AnyObject>,
143            text_selector: Option<&NSString>,
144        ) -> Option<Retained<Self>>;
145
146        /// An NSDictionary with keys representing text style attributes that are specifiable in text markup. Eligible keys and the expected types of their corresponding values are defined in
147        /// <CoreMedia
148        /// /CMTextMarkup.h>.
149        #[unsafe(method(textMarkupAttributes))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn textMarkupAttributes(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
152
153        /// A string that identifies the range or ranges of text to which the attributes should be applied. A value of nil indicates that the textMarkupAttributes should be applied as default styles for all text unless overridden by content markup or other applicable text selectors.
154        ///
155        /// The syntax of text selectors is determined by the format of the legible media. Eligible selectors may be determined by the content of the legible media (e.g. CSS selectors that are valid for a specific WebVTT document).
156        #[unsafe(method(textSelector))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn textSelector(&self) -> Option<Retained<NSString>>;
159    );
160}