57 lines
2.2 KiB
Objective-C
57 lines
2.2 KiB
Objective-C
//
|
|
// MPFunctionLayout.h
|
|
// MathPad
|
|
//
|
|
// Created by Kim Wittenburg on 07.08.14.
|
|
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
|
|
//
|
|
|
|
@import Cocoa;
|
|
#import "MPLayout.h"
|
|
|
|
@interface MPFunctionLayout : MPLayout
|
|
|
|
+ (MPFunctionLayout *)functionLayoutForFunction:(MPFunction *)function
|
|
parent:(MPExpressionLayout *)parent;
|
|
|
|
@property (readonly, nonatomic, weak) MPFunction *function;
|
|
|
|
@end
|
|
|
|
@interface MPFunctionLayout (MPSubclassOverride)
|
|
|
|
- (instancetype)initWithFunction:(MPFunction *)function
|
|
parent:(MPExpressionLayout *)parent;
|
|
|
|
#pragma mark Cache Methods
|
|
- (CTLineRef)lineForPrivateCacheIndex:(NSUInteger)index
|
|
generator:(CTLineRef (^)())generator;
|
|
- (id)objectForPrivateCacheIndex:(NSUInteger)index
|
|
generator:(id (^)())generator;
|
|
|
|
// Should also implement accessor method for special function type:
|
|
// - (MPCustomFunction *)customFunction
|
|
// {
|
|
// return (MPCustomFunction *)self.function;
|
|
// }
|
|
|
|
#pragma mark Size and Drawing Methods
|
|
- (BOOL)childAtIndexUsesSmallSize:(NSUInteger)index; // May be implemented
|
|
- (NSPoint)offsetOfChildLayoutAtIndex:(NSUInteger)index; // To be implemented
|
|
- (NSIndexPath *)indexPathForMousePoint:(NSPoint)point;
|
|
- (NSIndexPath *)indexPathForLocalMousePoint:(NSPoint)point; // To be implemented
|
|
- (NSRect)generateBounds; // To be implemented
|
|
- (void)draw; // To be implemented
|
|
|
|
// Specify the child that is used when the cursor enters the function from the left or right respectively
|
|
- (NSUInteger)indexOfLeadingChild; // To be implemented
|
|
- (NSUInteger)indexOfTrailingChild; // To be implemented
|
|
|
|
// The index of the child before (left) or after (right) the child at @c index. return NSNotFound if there is no child before or after @c index.
|
|
- (NSUInteger)indexOfChildBeforeChildAtIndex:(NSUInteger)index; // May be implemented
|
|
- (NSUInteger)indexOfChildAfterChildAtIndex:(NSUInteger)index; // May be implemented
|
|
- (NSUInteger)indexOfChildBelowChildAtIndex:(NSUInteger)index; // May be implemented
|
|
- (NSUInteger)indexOfChildAboveChildAtIndex:(NSUInteger)index; // May be implemented
|
|
- (NSIndexSet *)indexesOfRemainingChildren; // May be implemented
|
|
|
|
@end |