Archived
1
This repository has been archived on 2022-08-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
mathpad/MathKit/MPExpressionView.h

73 lines
2.5 KiB
Objective-C

//
// 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 <NSUserInterfaceValidations>
#pragma mark Creation Methods
- (id)initWithFrame:(NSRect)frameRect;
#pragma mark Properties
@property (readonly, nonatomic, strong) MPExpressionStorage *expressionStorage;
//@property (nonatomic, weak) id<MPExpressionViewDelegate> 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 <NSObject>
//@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