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
16unsafe impl NSCopying for AVTextStyleRule {}
17
18unsafe impl CopyingHelper for AVTextStyleRule {
19    type Result = Self;
20}
21
22unsafe impl NSObjectProtocol for AVTextStyleRule {}
23
24impl AVTextStyleRule {
25    extern_methods!(
26        #[unsafe(method(init))]
27        #[unsafe(method_family = init)]
28        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
29
30        #[unsafe(method(new))]
31        #[unsafe(method_family = new)]
32        pub unsafe fn new() -> Retained<Self>;
33
34        /// Converts an NSArray of AVTextStyleRules into a serializable property list that can be used for persistent storage.
35        ///
36        /// Parameter `textStyleRules`: An array of AVTextStyleRules.
37        ///
38        /// Returns: A serializable property list.
39        ///
40        /// For serialization utilities, see NSPropertyList.h.
41        #[unsafe(method(propertyListForTextStyleRules:))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn propertyListForTextStyleRules(
44            text_style_rules: &NSArray<AVTextStyleRule>,
45        ) -> Retained<AnyObject>;
46
47        /// Converts a property list into an NSArray of AVTextStyleRules.
48        ///
49        /// Parameter `plist`: A property list, normally obtained previously via an invocation of +propertyListForTextStyleRules:.
50        ///
51        /// Returns: An NSArray of AVTextStyleRules
52        #[unsafe(method(textStyleRulesFromPropertyList:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn textStyleRulesFromPropertyList(
55            plist: &AnyObject,
56        ) -> Option<Retained<NSArray<AVTextStyleRule>>>;
57
58        /// Creates an instance of AVTextStyleRule with the specified text markup attributes.
59        ///
60        /// Parameter `textMarkupAttributes`: An NSDictionary with keys representing text style attributes that are specifiable in text markup. Eligible keys are defined in
61        /// <CoreMedia
62        /// /CMTextMarkup.h>.
63        ///
64        /// Returns: An instance of AVTextStyleRule
65        ///
66        /// Equivalent to invoking +textStyleRuleWithTextMarkupAttributes:textSelector: with a value of nil for textSelector.
67        #[unsafe(method(textStyleRuleWithTextMarkupAttributes:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn textStyleRuleWithTextMarkupAttributes(
70            text_markup_attributes: &NSDictionary<NSString, AnyObject>,
71        ) -> Option<Retained<AVTextStyleRule>>;
72
73        /// 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.
74        ///
75        /// Parameter `textMarkupAttributes`: An NSDictionary with keys representing text style attributes that are specifiable in text markup. Eligible keys are defined in
76        /// <CoreMedia
77        /// /CMTextMarkup.h>.
78        ///
79        /// 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.
80        ///
81        /// Returns: An instance of AVTextStyleRule
82        #[unsafe(method(textStyleRuleWithTextMarkupAttributes:textSelector:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn textStyleRuleWithTextMarkupAttributes_textSelector(
85            text_markup_attributes: &NSDictionary<NSString, AnyObject>,
86            text_selector: Option<&NSString>,
87        ) -> Option<Retained<AVTextStyleRule>>;
88
89        /// Creates an instance of AVTextStyleRule with the specified text markup attributes.
90        ///
91        /// Parameter `textMarkupAttributes`: An NSDictionary with keys representing text style attributes that are specifiable in text markup. Eligible keys are defined in
92        /// <CoreMedia
93        /// /CMTextMarkup.h>.
94        ///
95        /// Returns: An instance of AVTextStyleRule
96        ///
97        /// Equivalent to invoking -initWithTextMarkupAttributes:textSelector: with a value of nil for textSelector.
98        #[unsafe(method(initWithTextMarkupAttributes:))]
99        #[unsafe(method_family = init)]
100        pub unsafe fn initWithTextMarkupAttributes(
101            this: Allocated<Self>,
102            text_markup_attributes: &NSDictionary<NSString, AnyObject>,
103        ) -> Option<Retained<Self>>;
104
105        /// 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.
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        /// 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.
112        ///
113        /// Returns: An instance of AVTextStyleRule
114        #[unsafe(method(initWithTextMarkupAttributes:textSelector:))]
115        #[unsafe(method_family = init)]
116        pub unsafe fn initWithTextMarkupAttributes_textSelector(
117            this: Allocated<Self>,
118            text_markup_attributes: &NSDictionary<NSString, AnyObject>,
119            text_selector: Option<&NSString>,
120        ) -> Option<Retained<Self>>;
121
122        /// 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
123        /// <CoreMedia
124        /// /CMTextMarkup.h>.
125        #[unsafe(method(textMarkupAttributes))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn textMarkupAttributes(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
128
129        /// 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.
130        ///
131        /// 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).
132        #[unsafe(method(textSelector))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn textSelector(&self) -> Option<Retained<NSString>>;
135    );
136}