Files
MP42Foundation/MP42/MP42HtmlParser.h
T

52 lines
1.2 KiB
Objective-C

//
// SBHtmlParser.h
// Subler
//
// Created by Damiano Galassi on 13/06/13.
//
//
#import <Foundation/Foundation.h>
#define kStyleBold 1
#define kStyleItalic 2
#define kStyleUnderlined 4
#define kStyleColor 8
#define kTagOpen 1
#define kTagClose 2
typedef struct rgba_color {
u_int8_t r;
u_int8_t g;
u_int8_t b;
u_int8_t a;
} rgba_color;
rgba_color make_color(u_int8_t r, u_int8_t g, u_int8_t b, u_int8_t a);
int compare_color(rgba_color c1, rgba_color c2);
@interface MP42Style : NSObject
- (instancetype)initWithStyle:(NSInteger)style type:(NSInteger)type location:(NSUInteger) location color:(rgba_color) color;
@property (nonatomic, readwrite) NSInteger style;
@property (nonatomic, readwrite) rgba_color color;
@property (nonatomic, readwrite) NSInteger type;
@property (nonatomic, readwrite) NSUInteger location;
@property (nonatomic, readwrite) NSUInteger length;
@end
@interface MP42HtmlParser : NSObject
@property (nonatomic, readonly) NSString *text;
@property (nonatomic, readonly) NSArray *styles;
@property (nonatomic, readwrite) rgba_color defaultColor;
- (instancetype)initWithString:(NSString *)string;
- (NSInteger) parseNextTag;
- (void)serializeStyles;
@end