objc2_file_provider/generated/NSFileProviderItemDecoration.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4use objc2_foundation::*;
5
6use crate::*;
7
8/// [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovideritemdecorationidentifier?language=objc)
9// NS_TYPED_EXTENSIBLE_ENUM
10pub type NSFileProviderItemDecorationIdentifier = NSString;
11
12extern_protocol!(
13 /// Decorations are defined in the extension's Info.plist by adding a
14 /// NSFileProviderDecorations key with one or many entries to the NSExtension dictionary.
15 ///
16 /// <key
17 /// >NSFileProviderDecorations
18 /// </key
19 /// >
20 /// <array
21 /// >
22 /// <dict
23 /// >
24 /// <key
25 /// >Identifier
26 /// </key
27 /// >
28 /// <string
29 /// >$(PRODUCT_BUNDLE_IDENTIFIER).hasComments
30 /// </string
31 /// >
32 /// <key
33 /// >BadgeImageType
34 /// </key
35 /// >
36 /// <string
37 /// >com.someone.item.decoration.unreadCommentIcon
38 /// </string
39 /// >
40 /// <key
41 /// >Category
42 /// </key
43 /// >
44 /// <string
45 /// >Badge
46 /// </string
47 /// >
48 /// <key
49 /// >LocalizedTitle
50 /// </key
51 /// >
52 /// <dict
53 /// >
54 /// <key
55 /// >NSStringFormat
56 /// </key
57 /// >
58 /// <string
59 /// >%
60 /// @
61 /// unread comments
62 /// </string
63 /// >
64 /// <key
65 /// >NSStringFormatValues
66 /// </key
67 /// >
68 /// <array
69 /// >
70 /// <string
71 /// >item.userInfo.unreadCommentCount
72 /// </string
73 /// >
74 /// </array
75 /// >
76 /// </dict
77 /// >
78 /// </dict
79 /// >
80 /// </array
81 /// >
82 ///
83 /// The keys for each entry are defined as follows:
84 /// Key | Property
85 /// ---------------|----------
86 /// Identifier | The identifier used to refer to this decoration in the item definition (as type `NSFileProviderItemDecorationIdentifier`).
87 /// BadgeImageType | The overlay UTI (see below)
88 /// Label | A localizable title, to be used in detail views, on mouse over and for voice over
89 /// Category | The position of the decoration: one of 'Badge', 'Sharing', or 'FolderBadge'
90 ///
91 /// At rendering time, the icon for the UTI specified by 'BadgeImageType' will be looked up.
92 /// The UTI must conform to 'com.apple.icon-decoration.badge'.
93 ///
94 /// Decorations from different categories are presented in different places in the UI.
95 ///
96 /// Note that regardless of the dictionary key used for the visual decoration, the Label key will be used for mouse over / voice over.
97 ///
98 /// Category | Location
99 /// -------------|----------
100 /// Badge | On top of the icon. The decoration is an image, taken from the BadgeImageType key. Only the first badge is displayed.
101 /// Sharing | Adjacent to the icon. The decoration is a string, taken from the Label key. Only the first label is displayed.
102 /// 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.
103 ///
104 /// See also [Apple's documentation](https://developer.apple.com/documentation/fileprovider/nsfileprovideritemdecorating?language=objc)
105 #[cfg(feature = "NSFileProviderItem")]
106 pub unsafe trait NSFileProviderItemDecorating: NSFileProviderItemProtocol {
107 /// Returns an array of decorations for the item.
108 ///
109 /// To adopt this protocol, implement the -decorations method on your NSFileProviderItem to return valid decoration identifiers
110 /// from your Info.plist.
111 #[unsafe(method(decorations))]
112 #[unsafe(method_family = none)]
113 unsafe fn decorations(
114 &self,
115 ) -> Option<Retained<NSArray<NSFileProviderItemDecorationIdentifier>>>;
116 }
117);