V8HorizontalPickerView.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // V8HorizontalPickerView.h
  3. //
  4. // Created by Shawn Veader on 9/17/10.
  5. // Copyright 2010 V8 Labs, LLC. All rights reserved.
  6. //
  7. #import <UIKit/UIKit.h>
  8. #import "V8HorizontalPickerViewProtocol.h"
  9. // position of indicator view, if shown
  10. typedef enum {
  11. V8HorizontalPickerIndicatorBottom = 0,
  12. V8HorizontalPickerIndicatorTop
  13. } V8HorizontalPickerIndicatorPosition;
  14. @interface V8LabelNode : NSObject
  15. @property NSString *title;
  16. @property NSURL *file;
  17. @property UIImage *face;
  18. @end
  19. @interface V8HorizontalPickerView : UIView <UIScrollViewDelegate> { }
  20. // delegate and datasources to feed scroll view. this view only maintains a weak reference to these
  21. @property (nonatomic, weak) IBOutlet id <V8HorizontalPickerViewDataSource> dataSource;
  22. @property (nonatomic, weak) IBOutlet id <V8HorizontalPickerViewDelegate> delegate;
  23. @property (nonatomic, readonly) NSInteger numberOfElements;
  24. @property (nonatomic, readonly) NSInteger currentSelectedIndex;
  25. // what font to use for the element labels?
  26. @property (nonatomic, strong) UIFont *elementFont;
  27. // color of labels used in picker
  28. @property (nonatomic, strong) UIColor *textColor;
  29. @property (nonatomic, strong) UIColor *selectedTextColor; // color of current selected element
  30. // the point, defaults to center of view, where the selected element sits
  31. @property (nonatomic, assign) CGPoint selectionPoint;
  32. @property (nonatomic, strong) UIView *selectionIndicatorView;
  33. @property (nonatomic, assign) V8HorizontalPickerIndicatorPosition indicatorPosition;
  34. // views to display on edges of picker (eg: gradients, etc)
  35. @property (nonatomic, strong) UIView *leftEdgeView;
  36. @property (nonatomic, strong) UIView *rightEdgeView;
  37. // views for left and right of scrolling area
  38. @property (nonatomic, strong) UIView *leftScrollEdgeView;
  39. @property (nonatomic, strong) UIView *rightScrollEdgeView;
  40. // padding for left/right scroll edge views
  41. @property (nonatomic, assign) CGFloat scrollEdgeViewPadding;
  42. // select mask view
  43. @property (nonatomic, strong) UIView *selectedMaskView;
  44. - (void)reloadData;
  45. - (void)scrollToElement:(NSInteger)index animated:(BOOL)animate;
  46. @end
  47. // sub-class of UILabel that knows how to change it's state
  48. @interface V8HorizontalPickerLabel : UILabel <V8HorizontalPickerElementState> { }
  49. @property (nonatomic, assign) BOOL selectedElement;
  50. @property (nonatomic, strong) UIColor *selectedStateColor;
  51. @property (nonatomic, strong) UIColor *normalStateColor;
  52. @end