// // MPExpressionView.h // MathPad // // Created by Kim Wittenburg on 17.04.14. // Copyright (c) 2014 Kim Wittenburg. All rights reserved. // // TODO: Undo/Redo + Delegate (evaluateExpressionView:evaluate...) @class MPExpressionView, MPExpressionStorage, MPFunction, MPRangePath; //@protocol MPExpressionViewDelegate; @interface MPExpressionView : NSView #pragma mark Creation Methods - (id)initWithFrame:(NSRect)frameRect; #pragma mark Properties @property (readonly, nonatomic, strong) MPExpressionStorage *expressionStorage; //@property (nonatomic, weak) id delegate; @property (nonatomic, strong) MPRangePath *selection; @property (nonatomic, strong) NSError *mathError; @property (nonatomic, strong) NSArray *syntaxErrors; @property (nonatomic, weak) id target; @property (nonatomic) SEL action; //@property (nonatomic) BOOL editable; //@property (nonatomic) BOOL selectable; #pragma mark Actions // Radians - Degrees - (IBAction)switchToRadians:(id)sender; - (IBAction)switchToDegrees:(id)sender; - (IBAction)switchRadiansDegrees:(id)sender; // Functions - (IBAction)toggleFunctionsPopover:(id)sender; @end //@protocol MPExpressionViewDelegate //@optional // //#pragma mark Editing //- (MPRangePath *)expressionView:(MPExpressionView *)expressionView willChangeSelectionFromRangePath:(MPRangePath *)oldSelection toRangePath:(MPRangePath *)newSelection; //- (void)expressionView:(MPExpressionView *)expressionView didChangeSelectionFromRangePath:(MPRangePath *)oldSelection toRangePath:(MPRangePath *)newSelection; // //- (BOOL)expressionView:(MPExpressionView *)expressionView shouldChangeSymbolsInRangePath:(MPRangePath *)rangePath replacementElements:(NSArray *)replacement; //- (BOOL)expressionView:(MPExpressionView *)expressionView shouldInsertFunction:(MPFunction *)function replacingRangePath:(MPRangePath *)currentSelection; //- (void)expressionViewDidChange:(MPExpressionView *)expressionView; // //- (BOOL)expressionViewShouldBeginEditing:(MPExpressionView *)expressionView; //- (BOOL)expressionViewShouldEndEditing:(MPExpressionView *)expressionView; //- (void)expressionViewDidBeginEditing:(MPExpressionView *)expressionView; //- (void)expressionDidEndEditing:(MPExpressionView *)expressionView; // //// TODO: Errors... //#pragma mark Evaluation // //- (BOOL)expressionViewShouldEvaluate:(MPExpressionView *)expressionView; //- (void)expressionViewDidEvaluate:(MPExpressionView *)expressionView; // //@end