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 <UIKit/UIKit.h> |
|
20 |
|
|
21 |
#import <FBSDKCoreKit/FBSDKMacros.h> |
|
22 |
|
|
23 |
#import <FBSDKShareKit/FBSDKLikeObjectType.h> |
|
24 |
#import <FBSDKShareKit/FBSDKLiking.h> |
|
25 |
|
9febd9
|
26 |
/** |
W |
27 |
NS_ENUM (NSUInteger, FBSDKLikeControlAuxiliaryPosition) |
bad748
|
28 |
|
9febd9
|
29 |
Specifies the position of the auxiliary view relative to the like button. |
bad748
|
30 |
*/ |
W |
31 |
typedef NS_ENUM(NSUInteger, FBSDKLikeControlAuxiliaryPosition) |
|
32 |
{ |
9febd9
|
33 |
/** The auxiliary view is inline with the like button. */ |
bad748
|
34 |
FBSDKLikeControlAuxiliaryPositionInline, |
9febd9
|
35 |
/** The auxiliary view is above the like button. */ |
bad748
|
36 |
FBSDKLikeControlAuxiliaryPositionTop, |
9febd9
|
37 |
/** The auxiliary view is below the like button. */ |
bad748
|
38 |
FBSDKLikeControlAuxiliaryPositionBottom, |
W |
39 |
}; |
|
40 |
|
9febd9
|
41 |
/** |
W |
42 |
Converts an FBSDKLikeControlAuxiliaryPosition to an NSString. |
bad748
|
43 |
*/ |
W |
44 |
FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlAuxiliaryPosition(FBSDKLikeControlAuxiliaryPosition auxiliaryPosition); |
|
45 |
|
9febd9
|
46 |
/** |
W |
47 |
NS_ENUM(NSUInteger, FBSDKLikeControlHorizontalAlignment) |
bad748
|
48 |
|
9febd9
|
49 |
Specifies the horizontal alignment for FBSDKLikeControlStyleStandard with |
bad748
|
50 |
FBSDKLikeControlAuxiliaryPositionTop or FBSDKLikeControlAuxiliaryPositionBottom. |
W |
51 |
*/ |
|
52 |
typedef NS_ENUM(NSUInteger, FBSDKLikeControlHorizontalAlignment) |
|
53 |
{ |
9febd9
|
54 |
/** The subviews are left aligned. */ |
bad748
|
55 |
FBSDKLikeControlHorizontalAlignmentLeft, |
9febd9
|
56 |
/** The subviews are center aligned. */ |
bad748
|
57 |
FBSDKLikeControlHorizontalAlignmentCenter, |
9febd9
|
58 |
/** The subviews are right aligned. */ |
bad748
|
59 |
FBSDKLikeControlHorizontalAlignmentRight, |
W |
60 |
}; |
|
61 |
|
9febd9
|
62 |
/** |
W |
63 |
Converts an FBSDKLikeControlHorizontalAlignment to an NSString. |
bad748
|
64 |
*/ |
W |
65 |
FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlHorizontalAlignment(FBSDKLikeControlHorizontalAlignment horizontalAlignment); |
|
66 |
|
9febd9
|
67 |
/** |
W |
68 |
NS_ENUM (NSUInteger, FBSDKLikeControlStyle) |
bad748
|
69 |
|
9febd9
|
70 |
Specifies the style of a like control. |
bad748
|
71 |
*/ |
W |
72 |
typedef NS_ENUM(NSUInteger, FBSDKLikeControlStyle) |
|
73 |
{ |
9febd9
|
74 |
/** Displays the button and the social sentence. */ |
bad748
|
75 |
FBSDKLikeControlStyleStandard = 0, |
9febd9
|
76 |
/** Displays the button and a box that contains the like count. */ |
bad748
|
77 |
FBSDKLikeControlStyleBoxCount, |
W |
78 |
}; |
|
79 |
|
9febd9
|
80 |
/** |
W |
81 |
Converts an FBSDKLikeControlStyle to an NSString. |
bad748
|
82 |
*/ |
W |
83 |
FBSDK_EXTERN NSString *NSStringFromFBSDKLikeControlStyle(FBSDKLikeControlStyle style); |
|
84 |
|
9febd9
|
85 |
/** |
bad748
|
86 |
|
9febd9
|
87 |
UI control to like an object in the Facebook graph. |
bad748
|
88 |
|
9febd9
|
89 |
|
W |
90 |
Taps on the like button within this control will invoke an API call to the Facebook app through a |
bad748
|
91 |
fast-app-switch that allows the user to like the object. Upon return to the calling app, the view will update |
W |
92 |
with the new state and send actions for the UIControlEventValueChanged event. |
|
93 |
*/ |
|
94 |
@interface FBSDKLikeControl : UIControl <FBSDKLiking> |
|
95 |
|
9febd9
|
96 |
/** |
W |
97 |
The foreground color to use for the content of the receiver. |
bad748
|
98 |
*/ |
W |
99 |
@property (nonatomic, strong) UIColor *foregroundColor; |
|
100 |
|
9febd9
|
101 |
/** |
W |
102 |
The position for the auxiliary view for the receiver. |
bad748
|
103 |
|
9febd9
|
104 |
|
W |
105 |
- See:FBSDKLikeControlAuxiliaryPosition |
bad748
|
106 |
*/ |
W |
107 |
@property (nonatomic, assign) FBSDKLikeControlAuxiliaryPosition likeControlAuxiliaryPosition; |
|
108 |
|
9febd9
|
109 |
/** |
W |
110 |
The text alignment of the social sentence. |
bad748
|
111 |
|
9febd9
|
112 |
|
W |
113 |
This value is only valid for FBSDKLikeControlStyleStandard with |
bad748
|
114 |
FBSDKLikeControlAuxiliaryPositionTop|Bottom. |
W |
115 |
*/ |
|
116 |
@property (nonatomic, assign) FBSDKLikeControlHorizontalAlignment likeControlHorizontalAlignment; |
|
117 |
|
9febd9
|
118 |
/** |
W |
119 |
The style to use for the receiver. |
bad748
|
120 |
|
9febd9
|
121 |
|
W |
122 |
- See:FBSDKLikeControlStyle |
bad748
|
123 |
*/ |
W |
124 |
@property (nonatomic, assign) FBSDKLikeControlStyle likeControlStyle; |
|
125 |
|
9febd9
|
126 |
/** |
W |
127 |
The preferred maximum width (in points) for autolayout. |
bad748
|
128 |
|
9febd9
|
129 |
|
W |
130 |
This property affects the size of the receiver when layout constraints are applied to it. During layout, |
bad748
|
131 |
if the text extends beyond the width specified by this property, the additional text is flowed to one or more new |
W |
132 |
lines, thereby increasing the height of the receiver. |
|
133 |
*/ |
|
134 |
@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; |
|
135 |
|
9febd9
|
136 |
/** |
W |
137 |
If YES, a sound is played when the receiver is toggled. |
bad748
|
138 |
|
W |
139 |
@default YES |
|
140 |
*/ |
|
141 |
@property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; |
|
142 |
|
|
143 |
@end |