Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 86 lines (71 sloc) 2.75 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
//
// DTHTMLElement.h
// CoreTextExtensions
//
// Created by Oliver Drobnik on 4/14/11.
// Copyright 2011 Drobnik.com. All rights reserved.
//

@class DTCoreTextParagraphStyle;
@class DTCoreTextFontDescriptor;
@class DTTextAttachment;
@class DTCSSListStyle;
@class DTColor;

typedef enum
{
DTHTMLElementDisplayStyleInline = 0, // default
DTHTMLElementDisplayStyleNone,
DTHTMLElementDisplayStyleBlock,
DTHTMLElementDisplayStyleListItem,
DTHTMLElementDisplayStyleTable,
} DTHTMLElementDisplayStyle;

typedef enum
{
DTHTMLElementFloatStyleNone = 0,
DTHTMLElementFloatStyleLeft,
DTHTMLElementFloatStyleRight
} DTHTMLElementFloatStyle;

typedef enum
{
DTHTMLElementFontVariantInherit = 0,
DTHTMLElementFontVariantNormal,
DTHTMLElementFontVariantSmallCaps
} DTHTMLElementFontVariant;

@interface DTHTMLElement : NSObject <NSCopying>

@property (nonatomic, strong) DTHTMLElement *parent;
@property (nonatomic, copy) DTCoreTextFontDescriptor *fontDescriptor;
@property (nonatomic, copy) DTCoreTextParagraphStyle *paragraphStyle;
@property (nonatomic, strong) DTTextAttachment *textAttachment;
@property (nonatomic, copy) NSURL *link;
@property (nonatomic, copy) NSString *anchorName;
@property (nonatomic, strong) DTColor *textColor;
@property (nonatomic, strong) DTColor *backgroundColor;
@property (nonatomic, copy) NSString *tagName;
@property (nonatomic, copy) NSString *beforeContent;
@property (nonatomic, copy) NSString *text;
@property (nonatomic, copy) NSArray *shadows;
@property (nonatomic, assign) CTUnderlineStyle underlineStyle;
@property (nonatomic, assign) BOOL tagContentInvisible;
@property (nonatomic, assign) BOOL strikeOut;
@property (nonatomic, assign) NSInteger superscriptStyle;
@property (nonatomic, assign) NSInteger headerLevel;
@property (nonatomic, assign) DTHTMLElementDisplayStyle displayStyle;
@property (nonatomic, readonly) DTHTMLElementFloatStyle floatStyle;
@property (nonatomic, assign) BOOL isColorInherited;
@property (nonatomic, assign) BOOL preserveNewlines;
@property (nonatomic, assign) DTHTMLElementFontVariant fontVariant;
@property (nonatomic, assign) CGFloat textScale;
@property (nonatomic, assign) CGSize size;
@property (nonatomic, strong) NSDictionary *attributes;

- (NSAttributedString *)attributedString;
- (NSDictionary *)attributesDictionary;

- (void)parseStyleString:(NSString *)styleString;
- (void)applyStyleDictionary:(NSDictionary *)styles;
- (NSDictionary *)styles;

- (void)addAdditionalAttribute:(id)attribute forKey:(id)key;

- (NSString *)path;

- (NSString *)attributeForKey:(NSString *)key;

- (void)addChild:(DTHTMLElement *)child;
- (void)removeChild:(DTHTMLElement *)child;

- (DTHTMLElement *)parentWithTagName:(NSString *)name;
- (BOOL)isContainedInBlockElement;

@end
Something went wrong with that request. Please try again.