//
//  commonInterface.h
//  keyiDownloadFramework
//
//  Created by moyanjwb on 14-1-16.
//  Copyright (c) 2014年 moyanjwb. All rights reserved.
//

#import <Foundation/Foundation.h>
#ifndef KEYIDOWNLOAD_IOS
#import <WebKit/WebKit.h>
#define sh_webview WebView
#else
#import <UIKit/UIWebView.h>
#define sh_webview UIWebView
#endif

enum DNetStatus
{
	DNetStatus_No = 0,
	DNetStatus_Waiting,
	DNetStatus_Downloading,
	DNetStatus_Error,
	DNetStatus_Stop,
	DNetStatus_Merging,
	DNetStatus_Completed
};

enum EVideoType
{
	EVideoType_Normal = 0,
	EVideoType_High,
	EVideoType_Supper,
	EVideoType_Original
};
//
@interface dNetBaseSec : NSObject
@property (assign) int64_t size;
@property (assign) long    duration;
@property (assign) long    msz;
@property (retain) NSString*    key1;
@property (retain) NSString*    key2;
@property (retain) NSString*    key3;
@property (retain) NSString*    url;
@end

@interface dNetSBaseVideo : NSObject
@property (assign) int64_t size;
@property (assign) long    duration;
@property (retain) NSMutableArray* secs;
@property (retain) NSString*    fid;
@property (retain) NSString*    realFid;
@end

@interface dNetBaseVideo : NSObject
@property (assign) long        vid;
@property (assign) long        aid;
@property (retain) NSString*   encodeVid;
@property (retain) NSString*   name;
@property (retain) NSString*   oname;
@property (retain) NSString*   uid;
@property (retain) NSString*   cid;
@property (retain) NSString*   picUrl;
@property (retain) NSString*   ch;
@property (retain) NSString*   catcode;
@property (retain) NSString*   allot;
@property (assign) long        seed;
@property (assign) long        source;
@property (assign) BOOL        vip;
@property (assign) long        idc;
@property (assign) BOOL        isMy;
@property (retain) NSMutableDictionary*   videos;
@property (assign) enum EVideoType        currentType;
@end
//
@protocol dNetBase;
//
@protocol dNetNotify <NSObject>
@required
-(BOOL) notifyGetVideoInfo:(id<dNetBase>) d;
-(void) notifyGetVideoList:(id<dNetBase>) d;
-(void) notifyStatusChanged:(id<dNetBase>)d;
-(void) notifyGetPicUrl:(id<dNetBase>)d;
-(void) notifyRecvData:(id<dNetBase>) d len:(int64_t)len;
@end
//
@interface PlayInfo : NSObject
@property (retain) NSString* name;     //名字
@property (retain) NSString* key;      //现在存的是路径
@property (assign) long      duration; //毫秒
@property (retain) NSArray*  paths;    //每一段的路径
@property (retain) NSArray*  durations;//每一段的时常 毫秒
@end
//
@protocol dNetBase <NSObject>
@required
-(void)start;
-(void)startOrWiat;
-(void)stop;
-(NSString*)        getVideoName;
-(int64_t)          getVideoSize;
-(double)           getVideoDuration;
-(int64_t)          getPos;
-(enum DNetStatus)  getStatus;
-(NSString*)        getFilePath;
-(NSString*)        getUrl;
-(NSString*)        getErrorDesc;
-(enum EVideoType)  getVersion;
-(NSString*)        getEnvodeVid;
-(NSString*)        getSource;
-(NSString*)        getPicUrl;
-(long)             getVideoSecNum;
-(long)             getUseTime;
-(BOOL)             isCompleted;
-(BOOL)             isVip;
-(BOOL)             isSupport:(enum EVideoType) vType;
-(BOOL)             isNew;
#ifdef KEYIDOWNLOAD_IOS
-(PlayInfo*)        getPlayInfo;
#endif
@end
