//
//  YSMASViewConstraint.h
//  Masonry
//
//  Created by Jonas Budelmann on 20/07/13.
//  Copyright (c) 2013 cloudling. All rights reserved.
//

#import "YSMASViewAttribute.h"
#import "YSMASConstraint.h"
#import "YSMASLayoutConstraint.h"
#import "YSMASUtilities.h"

/**
 *  A single constraint.
 *  Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view
 */
@interface YSMASViewConstraint : YSMASConstraint <NSCopying>

/**
 *	First item/view and first attribute of the NSLayoutConstraint
 */
@property (nonatomic, strong, readonly) YSMASViewAttribute *firstViewAttribute;

/**
 *	Second item/view and second attribute of the NSLayoutConstraint
 */
@property (nonatomic, strong, readonly) YSMASViewAttribute *secondViewAttribute;

/**
 *	initialises the YSMASViewConstraint with the first part of the equation
 *
 *	@param	firstViewAttribute	view.ysmas_left, view.ysmas_width etc.
 *
 *	@return	a new view constraint
 */
- (id)initWithFirstViewAttribute:(YSMASViewAttribute *)firstViewAttribute;

/**
 *  Returns all YSMASViewConstraints installed with this view as a first item.
 *
 *  @param  view  A view to retrieve constraints for.
 *
 *  @return An array of YSMASViewConstraints.
 */
+ (NSArray *)installedConstraintsForView:(YSMAS_VIEW *)view;

@end
