commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
2 |
// |
|
3 |
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
|
4 |
// copy, modify, and distribute this software in source code or binary form for use |
|
5 |
// in connection with the web services and APIs provided by Facebook. |
|
6 |
// |
|
7 |
// As with any software that integrates with the Facebook platform, your use of |
|
8 |
// this software is subject to the Facebook Developer Principles and Policies |
|
9 |
// [http://developers.facebook.com/policy/]. This copyright notice shall be |
|
10 |
// included in all copies or substantial portions of the software. |
|
11 |
// |
|
12 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
13 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
14 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
15 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
16 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
17 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
18 |
|
|
19 |
#import <Foundation/Foundation.h> |
|
20 |
|
e81c27
|
21 |
NS_ASSUME_NONNULL_BEGIN |
H |
22 |
|
bad748
|
23 |
@class FBSDKShareOpenGraphObject; |
W |
24 |
@class FBSDKSharePhoto; |
e81c27
|
25 |
|
H |
26 |
/** |
|
27 |
Enumeration Block |
|
28 |
*/ |
|
29 |
typedef void (^FBSDKEnumerationBlock)(NSString *key, id object, BOOL *stop) |
|
30 |
NS_SWIFT_NAME(EnumerationBlock) |
|
31 |
NS_SWIFT_UNAVAILABLE(""); |
bad748
|
32 |
|
9febd9
|
33 |
/** |
W |
34 |
Protocol defining operations on open graph actions and objects. |
|
35 |
|
|
36 |
The property keys MUST have namespaces specified on them, such as `og:image`. |
bad748
|
37 |
*/ |
e81c27
|
38 |
NS_SWIFT_NAME(ShareOpenGraphValueContaining) |
bad748
|
39 |
@protocol FBSDKShareOpenGraphValueContaining <NSObject, NSSecureCoding> |
e81c27
|
40 |
|
H |
41 |
/** |
|
42 |
Returns a dictionary of all the objects that lets you access each key/object in the receiver. |
|
43 |
*/ |
|
44 |
@property (nonatomic, readonly, strong) NSDictionary<NSString *, id> *allProperties; |
|
45 |
|
|
46 |
/** |
|
47 |
Returns an enumerator object that lets you access each key in the receiver. |
|
48 |
@return An enumerator object that lets you access each key in the receiver |
|
49 |
*/ |
|
50 |
@property (nonatomic, readonly, strong) NSEnumerator *keyEnumerator |
|
51 |
NS_SWIFT_UNAVAILABLE(""); |
|
52 |
|
|
53 |
/** |
|
54 |
Returns an enumerator object that lets you access each value in the receiver. |
|
55 |
@return An enumerator object that lets you access each value in the receiver |
|
56 |
*/ |
|
57 |
@property (nonatomic, readonly, strong) NSEnumerator *objectEnumerator |
|
58 |
NS_SWIFT_UNAVAILABLE(""); |
bad748
|
59 |
|
9febd9
|
60 |
/** |
W |
61 |
Gets an NSArray out of the receiver. |
13e53a
|
62 |
@param key The key for the value |
H |
63 |
@return The NSArray value or nil |
bad748
|
64 |
*/ |
e81c27
|
65 |
- (nullable NSArray<id> *)arrayForKey:(NSString *)key; |
bad748
|
66 |
|
9febd9
|
67 |
/** |
W |
68 |
Applies a given block object to the entries of the receiver. |
13e53a
|
69 |
@param block A block object to operate on entries in the receiver |
bad748
|
70 |
*/ |
e81c27
|
71 |
- (void)enumerateKeysAndObjectsUsingBlock:(FBSDKEnumerationBlock)block |
H |
72 |
NS_SWIFT_UNAVAILABLE(""); |
bad748
|
73 |
|
9febd9
|
74 |
/** |
W |
75 |
Gets an NSNumber out of the receiver. |
13e53a
|
76 |
@param key The key for the value |
H |
77 |
@return The NSNumber value or nil |
bad748
|
78 |
*/ |
e81c27
|
79 |
- (nullable NSNumber *)numberForKey:(NSString *)key; |
bad748
|
80 |
|
9febd9
|
81 |
/** |
e81c27
|
82 |
Gets an NSString out of the receiver. |
H |
83 |
@param key The key for the value |
|
84 |
@return The NSString value or nil |
bad748
|
85 |
*/ |
e81c27
|
86 |
- (nullable NSString *)stringForKey:(NSString *)key; |
H |
87 |
|
|
88 |
/** |
|
89 |
Gets an NSURL out of the receiver. |
|
90 |
@param key The key for the value |
|
91 |
@return The NSURL value or nil |
|
92 |
*/ |
|
93 |
- (nullable NSURL *)URLForKey:(NSString *)key; |
bad748
|
94 |
|
9febd9
|
95 |
/** |
W |
96 |
Gets an FBSDKShareOpenGraphObject out of the receiver. |
13e53a
|
97 |
@param key The key for the value |
H |
98 |
@return The FBSDKShareOpenGraphObject value or nil |
bad748
|
99 |
*/ |
e81c27
|
100 |
- (nullable FBSDKShareOpenGraphObject *)objectForKey:(NSString *)key; |
bad748
|
101 |
|
9febd9
|
102 |
/** |
W |
103 |
Enables subscript access to the values in the receiver. |
13e53a
|
104 |
@param key The key for the value |
H |
105 |
@return The value |
bad748
|
106 |
*/ |
e81c27
|
107 |
- (nullable id)objectForKeyedSubscript:(NSString *)key; |
bad748
|
108 |
|
9febd9
|
109 |
/** |
W |
110 |
Parses properties out of a dictionary into the receiver. |
13e53a
|
111 |
@param properties The properties to parse. |
bad748
|
112 |
*/ |
e81c27
|
113 |
- (void)parseProperties:(NSDictionary<NSString *, id> *)properties; |
bad748
|
114 |
|
9febd9
|
115 |
/** |
W |
116 |
Gets an FBSDKSharePhoto out of the receiver. |
13e53a
|
117 |
@param key The key for the value |
H |
118 |
@return The FBSDKSharePhoto value or nil |
bad748
|
119 |
*/ |
e81c27
|
120 |
- (nullable FBSDKSharePhoto *)photoForKey:(NSString *)key; |
bad748
|
121 |
|
9febd9
|
122 |
/** |
W |
123 |
Removes a value from the receiver for the specified key. |
13e53a
|
124 |
@param key The key for the value |
bad748
|
125 |
*/ |
W |
126 |
- (void)removeObjectForKey:(NSString *)key; |
|
127 |
|
9febd9
|
128 |
/** |
W |
129 |
Sets an NSArray on the receiver. |
|
130 |
|
|
131 |
This method will throw if the array contains any values that is not an NSNumber, NSString, NSURL, |
bad748
|
132 |
FBSDKSharePhoto or FBSDKShareOpenGraphObject. |
13e53a
|
133 |
@param array The NSArray value |
H |
134 |
@param key The key for the value |
bad748
|
135 |
*/ |
e81c27
|
136 |
- (void)setArray:(nullable NSArray<id> *)array forKey:(NSString *)key |
H |
137 |
NS_SWIFT_NAME(set(_:forKey:)); |
bad748
|
138 |
|
9febd9
|
139 |
/** |
W |
140 |
Sets an NSNumber on the receiver. |
13e53a
|
141 |
@param number The NSNumber value |
H |
142 |
@param key The key for the value |
bad748
|
143 |
*/ |
e81c27
|
144 |
- (void)setNumber:(nullable NSNumber *)number forKey:(NSString *)key |
H |
145 |
NS_SWIFT_NAME(set(_:forKey:)); |
bad748
|
146 |
|
9febd9
|
147 |
/** |
W |
148 |
Sets an FBSDKShareOpenGraphObject on the receiver. |
13e53a
|
149 |
@param object The FBSDKShareOpenGraphObject value |
H |
150 |
@param key The key for the value |
bad748
|
151 |
*/ |
e81c27
|
152 |
- (void)setObject:(nullable FBSDKShareOpenGraphObject *)object forKey:(NSString *)key |
H |
153 |
NS_SWIFT_NAME(set(_:forKey:)); |
bad748
|
154 |
|
9febd9
|
155 |
/** |
W |
156 |
Sets an FBSDKSharePhoto on the receiver. |
13e53a
|
157 |
@param photo The FBSDKSharePhoto value |
H |
158 |
@param key The key for the value |
bad748
|
159 |
*/ |
e81c27
|
160 |
- (void)setPhoto:(nullable FBSDKSharePhoto *)photo forKey:(NSString *)key |
H |
161 |
NS_SWIFT_NAME(set(_:forKey:)); |
bad748
|
162 |
|
9febd9
|
163 |
/** |
W |
164 |
Sets an NSString on the receiver. |
13e53a
|
165 |
@param string The NSString value |
H |
166 |
@param key The key for the value |
bad748
|
167 |
*/ |
e81c27
|
168 |
- (void)setString:(nullable NSString *)string forKey:(NSString *)key |
H |
169 |
NS_SWIFT_NAME(set(_:forKey:)); |
bad748
|
170 |
|
9febd9
|
171 |
/** |
W |
172 |
Sets an NSURL on the receiver. |
13e53a
|
173 |
@param URL The NSURL value |
H |
174 |
@param key The key for the value |
bad748
|
175 |
*/ |
e81c27
|
176 |
- (void)setURL:(nullable NSURL *)URL forKey:(NSString *)key |
H |
177 |
NS_SWIFT_NAME(set(_:forKey:)); |
bad748
|
178 |
|
W |
179 |
@end |
|
180 |
|
9febd9
|
181 |
/** |
W |
182 |
A base class to container Open Graph values. |
bad748
|
183 |
*/ |
e81c27
|
184 |
NS_SWIFT_NAME(ShareOpenGraphValueContainer) |
bad748
|
185 |
@interface FBSDKShareOpenGraphValueContainer : NSObject <FBSDKShareOpenGraphValueContaining> |
W |
186 |
|
|
187 |
@end |
e81c27
|
188 |
|
H |
189 |
NS_ASSUME_NONNULL_END |