//
//  tSeriesObject.h
//  Hootenanny
//
//  Created by Noah Sorscher on Tue Oct 29 2002.
//  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MHUtil.h"
#import "MHEPGTVT.h"
#import "tController.h"
#import "NSStringWebAdditions.h"


@interface tSeriesObject : NSObject {
    // series stuff
    NSMutableArray *children;
    NSString *regulars;
    NSString *seriesName;
    NSString *coverImage;
    
    // episode stuff
    NSMutableDictionary *metadata;
    
    // shared stuff
    BOOL isLeaf, dl;
    NSString *webAddress;
    NSString *displayString;
    tSeriesObject *parent;
    id epg;
}

+ (id)rootNode;
+ (void)setDownloadsImages:(BOOL)flag;
+ (void)setTextField:(NSTextField *)field;
- (id)initWithTitle:(NSString *)title address:(NSString *)address;
- (id)childAtIndex:(int)index;
- (BOOL)isLeafNode;
- (int)numberOfChildren;
- (BOOL)removeChildren;
- (NSString *)title;
- (NSString *)address;
- (BOOL)addSeries:(tSeriesObject *)item;
- (BOOL)expand;
- (NSString *)regulars;
- (id)initLeafWithTitle:(NSString *)title address:(NSString *)address parent:(tSeriesObject *)aParent;
- (BOOL)addMetadata:(NSDictionary *)input;
- (NSMutableDictionary *)readTVTURL:(NSString *)inAddress;
- (NSMutableDictionary *)readTVTURLguide:(NSString *)inAddress;
- (NSString *)summary;
- (BOOL)isImage:(NSString *)input;
- (NSString *)getCoverPic;
- (NSDictionary *)metadata;
- (NSMutableDictionary *)parseTVTEpisodes:(NSString *)htmlString baseAddress:(NSString *)baseAddress;
- (NSMutableString *)parseTVTRegulars:(NSString *)htmlString;
- (NSMutableDictionary *)parseEPGEpisodes:(NSString *)htmlString baseAddress:(NSString *)baseAddress;
- (NSMutableDictionary *)parseEPGGuide:(NSString *)input baseAddress:(NSString *)baseAddress;
- (NSString *)epgGuideRegulars:(NSString *)input;
- (NSArray *)epgGuideSeasons:(NSString *)input;
- (NSMutableDictionary *)epgGuideEpisode:(NSString *)input;
@end
