CommandClassControlNodeView.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. //
  2. // CommandClassControlNodeView.h
  3. // kneet2
  4. //
  5. // Created by Jason Lee on 11/5/15.
  6. // Copyright © 2015 ntels. All rights reserved.
  7. //
  8. #import "JDObject.h"
  9. @class ItemSubModel;
  10. @class CustomButton;
  11. @class CustomLabel;
  12. @protocol CommandClassControlNodeViewDelegate <NSObject>
  13. @optional
  14. - (void)didControlNodeAction:(id)sender;
  15. @end
  16. @interface CommandClassControlNodeView : UIView {
  17. @protected
  18. __weak ItemSubModel *_subItem;
  19. NSString *_cmdClsValue;
  20. BOOL _nodeEnable;
  21. }
  22. @property (weak, nonatomic) id <CommandClassControlNodeViewDelegate> delegate;
  23. @property (weak, nonatomic) ItemSubModel *subItem;
  24. @property (weak, nonatomic) CmdClsValueModel *selectedCmdClsValue;
  25. @property (assign, nonatomic) BOOL nodeEnable;
  26. + (CommandClassControlNodeView *)viewForCommandClass:(CmdClsType)cmdClsType;
  27. - (CGSize)sizeForIntrinsic;
  28. - (CGSize)sizeForIntrinsicForItemCount:(NSInteger)count;
  29. @end
  30. @interface CommandClassControlNodeValveView : CommandClassControlNodeView
  31. @property (weak, nonatomic) IBOutlet CustomButton *btnOpen;
  32. @property (weak, nonatomic) IBOutlet CustomButton *btnClose;
  33. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnOpenWidth;
  34. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnCloseWidth;
  35. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSpace;
  36. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSameWidth;
  37. - (IBAction)btnOpenTouched:(id)sender;
  38. - (IBAction)btnCloseTouched:(id)sender;
  39. @end
  40. @interface CommandClassControlNodeSwitchBinaryView : CommandClassControlNodeView
  41. @property (weak, nonatomic) IBOutlet CustomButton *btnOn;
  42. @property (weak, nonatomic) IBOutlet CustomButton *btnOff;
  43. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnOnWidth;
  44. - (IBAction)btnOnTouched:(id)sender;
  45. - (IBAction)btnOffTouched:(id)sender;
  46. @end
  47. @interface CommandClassControlNodeSensorBinaryView : CommandClassControlNodeSwitchBinaryView
  48. @end
  49. @interface CommandClassControlNodeSwitchMultiLevelView : CommandClassControlNodeView
  50. @property (weak, nonatomic) IBOutlet CustomButton *btnMultiLevel;
  51. - (IBAction)btnMutilLevelTouched:(id)sender;
  52. @end
  53. @interface CommandClassControlNodeSensorMultiLevelView: CommandClassControlNodeSwitchMultiLevelView
  54. @end
  55. @interface CommandClassControlNodeBatteryView : CommandClassControlNodeSwitchMultiLevelView
  56. @end
  57. @interface CommandClassControlNodeMeterView : CommandClassControlNodeSwitchMultiLevelView
  58. @end