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