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/MathPad/MPFunction.h
Kim Wittenburg 982b70d7fb Added Change Notifications to MPExpression, MPMutableExpression and MPFunction
Removed -beginEditing and -endEditing
Optimized -fixSymbols
Updated Project File
2014-05-18 01:06:49 +02:00

64 lines
1.3 KiB
Objective-C

//
// MPFunction.h
// MathPad
//
// Created by Kim Wittenburg on 18.04.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
@class MPFunction, MPExpression, MPRangePath;
@interface MPFunction : NSObject <NSCopying, NSCoding>
#pragma mark Creation Methods
- (instancetype)init;
#pragma mark Working With the Expression Tree
@property (nonatomic, weak) MPExpression *parent; // Documentation: Do not set
- (NSUInteger)numberOfChildren;
- (MPExpression *)childAtIndex:(NSUInteger)index;
- (void)setChild:(MPExpression *)child
atIndex:(NSUInteger)index;
#pragma mark Evaluating Functions
- (double)doubleValue;
#pragma mark Working With Functions
- (BOOL)isEqualToFunction:(MPFunction *)aFunction;
@end
@interface MPFunction (MPFunctionExtensionMethods)
#pragma mark Working With the Expression Tree
// May be overridden for performance improvements
- (NSArray *)children;
- (NSUInteger)indexOfChild:(MPExpression *)child;
- (id)symbolAtIndexPath:(NSIndexPath *)indexPath;
#pragma mark Evaluating Functions
- (float)floatValue;
- (int)intValue;
- (NSInteger)integerValue;
- (long long)longLongValue;
- (NSString *)description;
- (NSUInteger)hash;
@end
@interface MPFunction (MPDisplayExtension)
- (void)symbolsChangedInRangePath:(MPRangePath *)rangePath replacementLength:(NSUInteger)length;
@end