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/MPFunctionLayout.h

57 lines
1.4 KiB
Objective-C

//
// MPFunctionLayout.h
// MathPad
//
// Created by Kim Wittenburg on 22.04.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import <Foundation/Foundation.h>
@class MPFunctionLayout, MPExpressionLayout, MPExpressionStorage, MPFunction;
@interface MPFunctionLayout : NSObject {
@protected
BOOL _valid;
NSSize _cachedSize;
NSMutableArray *_childCache;
}
#pragma mark Creation Methods
+ (instancetype)functionLayoutForFunctionAtIndexPath:(NSIndexPath *)functionPath
parent:(MPExpressionLayout *)parent;
- (id)initWithFunctionPath:(NSIndexPath *)functionPath
parent:(MPExpressionLayout *)parent;
#pragma mark Properties
@property (readonly, nonatomic, weak) MPExpressionLayout *parent;
@property (readonly, nonatomic, strong) NSIndexPath *functionPath;
- (MPExpressionStorage *)expressionStorage;
- (MPFunction *)function; // Convenience
- (NSLayoutManager *)layoutManager;
- (NSTextContainer *)textContainer;
- (NSTextStorage *)textStorage;
#pragma mark Cache Methods
- (void)invalidate;
- (BOOL)hasCacheForChildAtIndex:(NSUInteger)index;
- (MPExpressionLayout *)expressionLayoutForChildAtIndex:(NSUInteger)index;
#pragma mark Size Calculation Methods
- (NSSize)sizeOfFunction;
- (NSSize)calculateSize;
#pragma mark Drawing Methods
- (void)drawFunctionAtPoint:(NSPoint)point;
@end