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