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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
/// [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovideritemdecorationidentifier?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSFileProviderItemDecorationIdentifier = NSString;
extern_protocol!(
/// Decorations are defined in the extension's Info.plist by adding a
/// NSFileProviderDecorations key with one or many entries to the NSExtension dictionary.
///
/// <key
/// >NSFileProviderDecorations
/// </key
/// >
/// <array
/// >
/// <dict
/// >
/// <key
/// >Identifier
/// </key
/// >
/// <string
/// >$(PRODUCT_BUNDLE_IDENTIFIER).hasComments
/// </string
/// >
/// <key
/// >BadgeImageType
/// </key
/// >
/// <string
/// >com.someone.item.decoration.unreadCommentIcon
/// </string
/// >
/// <key
/// >Category
/// </key
/// >
/// <string
/// >Badge
/// </string
/// >
/// <key
/// >LocalizedTitle
/// </key
/// >
/// <dict
/// >
/// <key
/// >NSStringFormat
/// </key
/// >
/// <string
/// >%
/// @
/// unread comments
/// </string
/// >
/// <key
/// >NSStringFormatValues
/// </key
/// >
/// <array
/// >
/// <string
/// >item.userInfo.unreadCommentCount
/// </string
/// >
/// </array
/// >
/// </dict
/// >
/// </dict
/// >
/// </array
/// >
///
/// The keys for each entry are defined as follows:
/// Key | Property
/// ---------------|----------
/// Identifier | The identifier used to refer to this decoration in the item definition (as type `NSFileProviderItemDecorationIdentifier`).
/// BadgeImageType | The overlay UTI (see below)
/// Label | A localizable title, to be used in detail views, on mouse over and for voice over
/// Category | The position of the decoration: one of 'Badge', 'Sharing', or 'FolderBadge'
///
/// At rendering time, the icon for the UTI specified by 'BadgeImageType' will be looked up.
/// The UTI must conform to 'com.apple.icon-decoration.badge'.
///
/// Decorations from different categories are presented in different places in the UI.
///
/// Note that regardless of the dictionary key used for the visual decoration, the Label key will be used for mouse over / voice over.
///
/// Category | Location
/// -------------|----------
/// Badge | On top of the icon. The decoration is an image, taken from the BadgeImageType key. Only the first badge is displayed.
/// Sharing | Adjacent to the icon. The decoration is a string, taken from the Label key. Only the first label is displayed.
/// FolderBadge | Embossed on top of the folder icon. The image from the BadgeImageType key will be embossed. Only the first badge is displayed. Only valid for folders.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovideritemdecorating?language=objc)
#[cfg(feature = "NSFileProviderItem")]
pub unsafe trait NSFileProviderItemDecorating: NSFileProviderItemProtocol {
/// Returns an array of decorations for the item.
///
/// To adopt this protocol, implement the -decorations method on your NSFileProviderItem to return valid decoration identifiers
/// from your Info.plist.
#[unsafe(method(decorations))]
#[unsafe(method_family = none)]
unsafe fn decorations(
&self,
) -> Option<Retained<NSArray<NSFileProviderItemDecorationIdentifier>>>;
}
);