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 |
/** |
27832c
|
86 |
Warning: This class is deprecated. |
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 |
*/ |
27832c
|
94 |
__attribute__ ((deprecated)) |
bad748
|
95 |
@interface FBSDKLikeControl : UIControl <FBSDKLiking> |
W |
96 |
|
9febd9
|
97 |
/** |
W |
98 |
The foreground color to use for the content of the receiver. |
bad748
|
99 |
*/ |
W |
100 |
@property (nonatomic, strong) UIColor *foregroundColor; |
|
101 |
|
9febd9
|
102 |
/** |
W |
103 |
The position for the auxiliary view for the receiver. |
bad748
|
104 |
|
9febd9
|
105 |
|
W |
106 |
- See:FBSDKLikeControlAuxiliaryPosition |
bad748
|
107 |
*/ |
W |
108 |
@property (nonatomic, assign) FBSDKLikeControlAuxiliaryPosition likeControlAuxiliaryPosition; |
|
109 |
|
9febd9
|
110 |
/** |
W |
111 |
The text alignment of the social sentence. |
bad748
|
112 |
|
9febd9
|
113 |
|
W |
114 |
This value is only valid for FBSDKLikeControlStyleStandard with |
bad748
|
115 |
FBSDKLikeControlAuxiliaryPositionTop|Bottom. |
W |
116 |
*/ |
|
117 |
@property (nonatomic, assign) FBSDKLikeControlHorizontalAlignment likeControlHorizontalAlignment; |
|
118 |
|
9febd9
|
119 |
/** |
W |
120 |
The style to use for the receiver. |
bad748
|
121 |
|
9febd9
|
122 |
|
W |
123 |
- See:FBSDKLikeControlStyle |
bad748
|
124 |
*/ |
W |
125 |
@property (nonatomic, assign) FBSDKLikeControlStyle likeControlStyle; |
|
126 |
|
9febd9
|
127 |
/** |
W |
128 |
The preferred maximum width (in points) for autolayout. |
bad748
|
129 |
|
9febd9
|
130 |
|
W |
131 |
This property affects the size of the receiver when layout constraints are applied to it. During layout, |
bad748
|
132 |
if the text extends beyond the width specified by this property, the additional text is flowed to one or more new |
W |
133 |
lines, thereby increasing the height of the receiver. |
|
134 |
*/ |
|
135 |
@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; |
|
136 |
|
9febd9
|
137 |
/** |
W |
138 |
If YES, a sound is played when the receiver is toggled. |
bad748
|
139 |
|
W |
140 |
@default YES |
|
141 |
*/ |
|
142 |
@property (nonatomic, assign, getter = isSoundEnabled) BOOL soundEnabled; |
|
143 |
|
|
144 |
@end |