hank
2019-01-22 13e53a03f4d50169d0cf7f72d414753ae6b421ce
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
21 @class FBSDKShareOpenGraphObject;
22 @class FBSDKSharePhoto;
23
9febd9 24 /**
W 25   Protocol defining operations on open graph actions and objects.
26
27  The property keys MUST have namespaces specified on them, such as `og:image`.
bad748 28  */
W 29 @protocol FBSDKShareOpenGraphValueContaining <NSObject, NSSecureCoding>
30
9febd9 31 /**
W 32   Gets an NSArray out of the receiver.
13e53a 33  @param key The key for the value
H 34  @return The NSArray value or nil
bad748 35  */
W 36 - (NSArray *)arrayForKey:(NSString *)key;
37
9febd9 38 /**
W 39   Applies a given block object to the entries of the receiver.
13e53a 40  @param block A block object to operate on entries in the receiver
bad748 41  */
W 42 - (void)enumerateKeysAndObjectsUsingBlock:(void (^)(NSString *key, id object, BOOL *stop))block;
43
9febd9 44 /**
W 45   Returns an enumerator object that lets you access each key in the receiver.
13e53a 46  @return An enumerator object that lets you access each key in the receiver
bad748 47  */
W 48 - (NSEnumerator *)keyEnumerator;
49
9febd9 50 /**
W 51   Gets an NSNumber out of the receiver.
13e53a 52  @param key The key for the value
H 53  @return The NSNumber value or nil
bad748 54  */
W 55 - (NSNumber *)numberForKey:(NSString *)key;
56
9febd9 57 /**
W 58   Returns an enumerator object that lets you access each value in the receiver.
13e53a 59  @return An enumerator object that lets you access each value in the receiver
bad748 60  */
W 61 - (NSEnumerator *)objectEnumerator;
62
9febd9 63 /**
W 64   Gets an FBSDKShareOpenGraphObject out of the receiver.
13e53a 65  @param key The key for the value
H 66  @return The FBSDKShareOpenGraphObject value or nil
bad748 67  */
W 68 - (FBSDKShareOpenGraphObject *)objectForKey:(NSString *)key;
69
9febd9 70 /**
W 71   Enables subscript access to the values in the receiver.
13e53a 72  @param key The key for the value
H 73  @return The value
bad748 74  */
W 75 - (id)objectForKeyedSubscript:(NSString *)key;
76
9febd9 77 /**
W 78   Parses properties out of a dictionary into the receiver.
13e53a 79  @param properties The properties to parse.
bad748 80  */
W 81 - (void)parseProperties:(NSDictionary *)properties;
82
9febd9 83 /**
W 84   Gets an FBSDKSharePhoto out of the receiver.
13e53a 85  @param key The key for the value
H 86  @return The FBSDKSharePhoto value or nil
bad748 87  */
W 88 - (FBSDKSharePhoto *)photoForKey:(NSString *)key;
89
9febd9 90 /**
W 91   Removes a value from the receiver for the specified key.
13e53a 92  @param key The key for the value
bad748 93  */
W 94 - (void)removeObjectForKey:(NSString *)key;
95
9febd9 96 /**
W 97   Sets an NSArray on the receiver.
98
99  This method will throw if the array contains any values that is not an NSNumber, NSString, NSURL,
bad748 100  FBSDKSharePhoto or FBSDKShareOpenGraphObject.
13e53a 101  @param array The NSArray value
H 102  @param key The key for the value
bad748 103  */
W 104 - (void)setArray:(NSArray *)array forKey:(NSString *)key;
105
9febd9 106 /**
W 107   Sets an NSNumber on the receiver.
13e53a 108  @param number The NSNumber value
H 109  @param key The key for the value
bad748 110  */
W 111 - (void)setNumber:(NSNumber *)number forKey:(NSString *)key;
112
9febd9 113 /**
W 114   Sets an FBSDKShareOpenGraphObject on the receiver.
13e53a 115  @param object The FBSDKShareOpenGraphObject value
H 116  @param key The key for the value
bad748 117  */
W 118 - (void)setObject:(FBSDKShareOpenGraphObject *)object forKey:(NSString *)key;
119
9febd9 120 /**
W 121   Sets an FBSDKSharePhoto on the receiver.
13e53a 122  @param photo The FBSDKSharePhoto value
H 123  @param key The key for the value
bad748 124  */
W 125 - (void)setPhoto:(FBSDKSharePhoto *)photo forKey:(NSString *)key;
126
9febd9 127 /**
W 128   Sets an NSString on the receiver.
13e53a 129  @param string The NSString value
H 130  @param key The key for the value
bad748 131  */
W 132 - (void)setString:(NSString *)string forKey:(NSString *)key;
133
9febd9 134 /**
W 135   Sets an NSURL on the receiver.
13e53a 136  @param URL The NSURL value
H 137  @param key The key for the value
bad748 138  */
W 139 - (void)setURL:(NSURL *)URL forKey:(NSString *)key;
140
9febd9 141 /**
W 142   Gets an NSString out of the receiver.
13e53a 143  @param key The key for the value
H 144  @return The NSString value or nil
bad748 145  */
W 146 - (NSString *)stringForKey:(NSString *)key;
147
9febd9 148 /**
W 149   Gets an NSURL out of the receiver.
13e53a 150  @param key The key for the value
H 151  @return The NSURL value or nil
bad748 152  */
W 153 - (NSURL *)URLForKey:(NSString *)key;
154
155 @end
156
9febd9 157 /**
W 158   A base class to container Open Graph values.
bad748 159  */
W 160 @interface FBSDKShareOpenGraphValueContainer : NSObject <FBSDKShareOpenGraphValueContaining>
161
162 @end