SkyEpub SDK for iOS 7
 All Classes Functions Variables Properties
Book.h
1 //
2 // Book.h
3 // eBook
4 //
5 // Created by 허지웅 on 10. 5. 11..
6 // Copyright 2010 Techdigm Corporation. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 #import "SearchResult.h"
11 
12 #define SpreadAuto 0
13 #define SpreadLandscape 1
14 #define SpreadPortrait 2
15 #define SpreadBoth 4
16 #define SpreadNone 8
17 
18 
19 #define DevicePhone 0
20 #define DeviceTablet 1
21 #define DeviceDesktop 2
22 #define DeviceConsole 3
23 #define DeviceWeb 4
24 
25 #define RightRead 0
26 #define RightExtract 1
27 #define RightPrint 2
28 
29 @class Encryption;
30 
31 
32 @interface Item : NSObject
33 {
34  NSString *href;
35  NSString *identifier;
36  NSString *mediaType;
37  NSString *mediaOverlayIdentifier;
38  NSString *properties;
39  BOOL hasMediaOverlay;
40 }
41 
42 @property (nonatomic,retain) NSString *href;
43 @property (nonatomic,retain) NSString *identifier;
44 @property (nonatomic,retain) NSString *mediaType;
45 @property (nonatomic,retain) NSString *mediaOverlayIdentifier;
46 @property (nonatomic,retain) NSString *properties;
47 @property BOOL hasMediaOverlay;
48 
49 @end
50 
51 @interface ItemRef : NSObject
52 {
53  NSString *idref;
54  NSString *linear;
55  NSString *fullPath;
56  NSString *href;
57  NSString *mediaOverlayPath;
58  BOOL hasMediaOverlay;
59 }
60 
61 @property (nonatomic,retain) NSString *idref;
62 @property (nonatomic,retain) NSString *linear;
63 @property (nonatomic,retain) NSString *fullPath;
64 @property (nonatomic,retain) NSString *href;
65 @property (nonatomic,retain) NSString *mediaOverlayPath;
66 @property BOOL hasMediaOverlay;
67 @end
68 
69 
70 @interface Reference : NSObject
71 {
72  NSString *href;
73  NSString *type;
74  NSString *title;
75 }
76 
77 @property (nonatomic,retain) NSString *href;
78 @property (nonatomic,retain) NSString *type;
79 @property (nonatomic,retain) NSString *title;
80 
81 @end
82 
86 @interface NavPoint : NSObject
87 {
91  NSString *hashLocation;
93  NSString *identifier;
95  int playOrder;
97  NSString *text;
99  NSString *content;
100  NSString *originalContent;
102  int depth;
103 }
104 
105 @property (nonatomic,retain) NSString *identifier,*text,*content,*originalContent,*hashLocation; //버그픽스
106 @property int chapterIndex,playOrder,depth; // 버그픽스
107 
108 @end
109 
110 
111 @interface PlatformOption :NSObject {
112  NSString *name;
113  NSString *value;
114 }
115 @property (nonatomic,retain) NSString *name,*value;
116 @end
117 
118 @interface Platform :NSObject {
119  NSString *name;
120  NSMutableArray *platformOptions;
121 }
122 @property (nonatomic,retain) NSString *name;
123 @property (nonatomic,retain) NSMutableArray *platformOptions;
124 
125 @end
126 
127 @interface DisplayOptions : NSObject {
128  NSMutableArray *platforms;
129 }
130 @property (nonatomic,retain) NSMutableArray *platforms;
131 @end
132 
133 @interface MediaOverlayObject : NSObject {
134  Byte kind;
135 }
136 @property Byte kind;
137 
138 @end
139 
140 
142  NSMutableArray *mos;
143  NSString *identifier;
144  NSString *textReference;
145  NSString *type;
146 }
147 @property (nonatomic,retain) NSMutableArray *mos;
148 @property (nonatomic,retain) NSString* identifier;
149 @property (nonatomic,retain) NSString* textReference;
150 @property (nonatomic,retain) NSString* type;
151 -(void)print;
152 -(NSMutableArray*)getParallelsByPageIndex:(int)pageIndex;
153 -(NSMutableArray*)getParallels;
154 @end
155 
157  NSString *identifier;
158  NSString *source;
159  NSString *clipBegin;
160  NSString *clipEnd;
161  NSTimeInterval intervalBegin;
162  NSTimeInterval intervalEnd;
163  NSString *fullPath;
164 }
165 @property (nonatomic,retain) NSString* identifier;
166 @property (nonatomic,retain) NSString* source;
167 @property (nonatomic,retain) NSString* fullPath;
168 @property (nonatomic,retain) NSString* clipBegin;
169 @property (nonatomic,retain) NSString* clipEnd;
170 @property NSTimeInterval intervalBegin;
171 @property NSTimeInterval intervalEnd;
172 -(void)calc;
173 -(void)print;
174 @end
175 
176 
178  NSString *identifier;
179  NSString *source;
180 
181  NSString* content;
182  int startOffset;
183  int endOffset;
184 }
185 @property (nonatomic,retain) NSString* identifier;
186 @property (nonatomic,retain) NSString* source;
187 
188 @property (nonatomic,retain) NSString* content;
189 @property int startOffset;
190 @property int endOffset;
191 
192 -(void)print;
193 @end
194 
196  NSString* hash;
197  int parallelIndex;
198  int pageIndex;
199  NSString *identifier;
200  NSString *type;
201  Audio *audio;
202  Text *text;
203 }
204 @property (nonatomic,retain) NSString* identifier;
205 @property (nonatomic,retain) NSString* type;
206 @property (nonatomic,retain) Audio* audio;
207 @property (nonatomic,retain) Text* text;
208 @property (nonatomic,retain) NSString* hash;
209 @property int pageIndex,parallelIndex;
210 -(void)print;
211 @end
212 
213 
214 @class SkyPlayer;
215 @protocol SkyPlayerDelegate <NSObject>
216 -(void)didComplete:(SkyPlayer*)skyPlayer;
217 @end
218 
219 
220 @class AVPlayer;
221 @interface SkyPlayer:NSObject {
222  AVPlayer* player;
223  NSURL* mediaURL;
224  NSTimeInterval clipBegin,clipEnd;
225  NSTimeInterval currentTime;
226  NSTimeInterval oldTime;
227  double delta;
228  BOOL isPaused;
229  NSTimer *timer;
230  id <SkyPlayerDelegate>delegate;
231 }
232 @property (nonatomic,retain) AVPlayer* player;
233 @property (nonatomic,retain) NSURL *mediaURL;
234 @property (nonatomic,retain) id delegate;
235 @property BOOL isPaused;
236 -(void)play:(NSURL*)url clipBegin:(NSTimeInterval)begin clipEnd:(NSTimeInterval)end;
237 -(void)pause;
238 -(void)stop;
239 -(void)resume;
240 @end
241 
242 
243 @class MediaOverlay;
244 @protocol MediaOverlayDataSource <NSObject>
245 -(void)makeParallels:(NSMutableArray*)parallels forMediaOverlay:(MediaOverlay*)mediaOverlay;
246 -(int)pageIndexForMediaOverlay:(MediaOverlay*)mediaOverlay;
247 @end
248 
249 @protocol MediaOverlayDelegate <NSObject>
250 -(void)mediaOverlay:(MediaOverlay*)mediaOverlay didParallelStart:(Parallel*)parallel;
251 -(void)mediaOverlay:(MediaOverlay*)mediaOverlay didParallelComplete:(Parallel*)parallel;
252 -(void)parallelsDidComplete:(MediaOverlay*)mediaOverlay;
253 @end
254 
255 @interface MediaOverlay:NSObject <SkyPlayerDelegate> {
256  SkyPlayer* player;
257  Parallel *currentParallel;
258  NSMutableArray* parallels;
259  int parallelIndex;
260  BOOL isStarted;
261  __weak id <MediaOverlayDataSource> dataSource;
262  __weak id <MediaOverlayDelegate> delegate;
263 }
264 @property (nonatomic,weak) id delegate;
265 @property (nonatomic,weak) id dataSource;
266 @property BOOL isStarted;
267 -(void)playParallel:(Parallel*)parallel;
268 -(void)playParallels;
269 -(void)playParallelByIndex:(int)pi;
270 -(Parallel*)getParallel:(int)pi;
271 -(int)parallelCount;
272 -(void)playNext;
273 -(void)playPrev;
274 -(void)play;
275 -(void)pause;
276 -(BOOL)isStarted;
277 -(BOOL)isPaused;
278 -(void)clear;
279 -(void)reset;
280 -(void)stop;
281 -(void)resume;
282 @end
283 
284 
285 @interface TTS:NSObject <SkyPlayerDelegate> {
286  NSMutableArray* parallels;
287  int parallelIndex;
288 
289  int bookCode;
290  int chapterIndex;
291  int firstCharacterOffsetInPage;
292 
293  NSString* text;
294 
295 
296  __weak id <MediaOverlayDataSource> dataSource;
297  __weak id <MediaOverlayDelegate> delegate;
298 }
299 @property (nonatomic,weak) id delegate;
300 @property (nonatomic,weak) id dataSource;
301 @property BOOL isStarted;
302 @property int bookCode;
303 @property int chapterIndex;
304 @property int firstCharacterOffsetInPage;
305 @property (nonatomic,retain) NSString* text;
306 
307 -(void)setLanguage:(NSString*)language;
308 
309 -(void)setPitch:(float)pitch;
310 -(void)setRate:(float)rate;
311 -(void)setText:(NSString*)text bookCode:(int)bookCode chapterIndex:(int)chapterIndex firstCharacterOffsetInPage:(int)firstCharacterOffsetInPage;
312 -(void)playParallel:(Parallel*)parallel;
313 -(void)playParallels;
314 -(void)playParallelByIndex:(int)pi;
315 -(Parallel*)getParallel:(int)pi;
316 -(int)parallelCount;
317 -(void)playNext;
318 -(void)playPrev;
319 -(void)play;
320 -(void)pause;
321 -(BOOL)isStarted;
322 -(BOOL)isPaused;
323 -(void)clear;
324 -(void)reset;
325 -(void)stop;
326 -(void)resume;
327 @end
328 
329 
330 
331 
332 @interface Device:NSObject {
333  int deviceId;
334  BOOL isAvailable;
335 }
336 @property int deviceId;
337 @property BOOL isAvailable;
338 @end
339 
340 @interface Contents:NSObject {
341  BOOL displayAllChapters;
342  BOOL watermarkAllChapters;
343  BOOL isWatermarked;
344  int startChapterIndex;
345  int endChapterIndex;
346  int startChapterIndexForWatermark;
347  int endChapterIndexForWatermark;
348  NSString* watermarkText;
349 }
350 @property BOOL displayAllChapters;
351 @property BOOL watermarkAllChapters;
352 @property BOOL isWatermarked;
353 @property int startChapterIndex;
354 @property int endChapterIndex;
355 @property int startChapterIndexForWatermark;
356 @property int endChapterIndexForWatermark;
357 @property (nonatomic,copy) NSString* watermarkText;
358 @end;
359 
360 @interface Lend :NSObject {
361  BOOL isLendable;
362  long lendSeconds;
363  NSDate *expireDate;
364  NSDate *expireDateTime;
365 }
366 @property BOOL isLendable;
367 @property long lendSeconds;
368 @property (nonatomic,retain) NSDate *expireDate;
369 @property (nonatomic,retain) NSDate *expireDateTime;
370 @end;
371 
372 
373 @interface Right :NSObject {
374  int rightId;
375  NSMutableArray* devices;
376  BOOL forAllDevices;
377 }
378 @property int rightId;
379 @property (nonatomic,retain) NSMutableArray* devices;
380 @property BOOL forAllDevices;
381 -(id)initWithRightId:(int)rightId;
382 -(Device*)getDevice:(int)deviceId;
383 -(BOOL)supportsAllDevices;
384 -(BOOL)supportsNoneDevice;
385 -(void)excludeAllDevices;
386 -(void)includeAllDevices;
387 @end;
388 
389 
390 @interface ReadRight :Right {
391  Lend *lend;
392  Contents* contents;
393 }
394 @property (nonatomic,retain) Lend *lend;
395 @property (nonatomic,retain) Contents *contents;
396 @end;
397 
398 @interface PrintRight :Right {
399  int countMax;
400  Lend *lend;
401  Contents* contents;
402  int resolutionMin;
403  int resolutionMax;
404 }
405 @property int resolutionMin;
406 @property int resolutionMax;
407 @property int countMax;
408 @property (nonatomic,retain) Lend *lend;
409 @property (nonatomic,retain) Contents *contents;
410 @end;
411 
412 @interface ExtractRight :Right {
413  int countMax;
414  Lend *lend;
415  BOOL allAvailable;
416  BOOL highlightAvailable;
417  BOOL noteAvailable;
418  BOOL bookmarkAvailable;
419  BOOL excerptAvailable;
420  BOOL screenshotAvailable;
421 }
422 @property int countMax;
423 @property (nonatomic,retain) Lend *lend;
424 @property BOOL allAvailable;
425 @property BOOL highlightAvailable;
426 @property BOOL noteAvailable;
427 @property BOOL bookmarkAvailable;
428 @property BOOL excerptAvailable;
429 @property BOOL screenshotAvailable;
430 -(BOOL)supportsAllExtracts;
431 -(void)excludeAllExtracts;
432 -(void)includeAllExtracts;
433 @end;
434 
435 
436 @interface Rights : NSObject {
437  ReadRight* readRight;
438  ExtractRight* extractRight;
439  PrintRight* printRight;
440 }
441 @property (nonatomic,retain) ReadRight* readRight;
442 @property (nonatomic,retain) ExtractRight* extractRight;
443 @property (nonatomic,retain) PrintRight* printRight;
444 @end
445 
446 @interface Book : NSObject <NSXMLParserDelegate> {
448  int bookCode;
450  int fontSize;
452  NSString *fontName;
453  NSString *bookCover;
455  NSString *fileName;
456  NSString *ePubPath;
457  NSString *opfPath;
458  NSString *opfDir;
459  NSString *ncxPath;
460  NSString *ncxName;
461  NSString *imagePath;
462  int parserType;
463  int ncxType;
464  NSMutableString *currentElementValue;
465 
467  NSString *title;
469  NSString *creator;
471  NSString *publisher;
473  NSString *subject;
475  NSString *source;
479  NSString *right;
481  NSString *identifier;
483  NSString *language;
485  NSString *date;
487  NSString *type;
489  NSString* description;
490 
491  NSString* stackNo;
492 
493  int chapterIndex;
494  int readCount;
495  double pagePercent;
496  BOOL isRent;
497  BOOL isSerial;
498  BOOL isDeleted;
499  NSDate* dueDate;
500  NSString* downloadDate;
501  NSString* lastReadDate;
502 
503  NSMutableArray *Manifest;
504  NSMutableArray *Spine;
505  NSMutableArray *SpineForLinearNo;
506  NSMutableArray *Guide;
508  NSMutableArray *NavMap;
509 
510  NSString *currentImagePath;
511  BOOL isCartoon;
512  BOOL isFixedLayout;
513  int fixedWidth;
514  int fixedHeight;
515  float fixedAspectRatio;
516 
517  int pTagCount;
518  int imgTagCount;
519 
520  NSXMLParser *containerXMLParser;
521  NSXMLParser *opfParser;
522  NSXMLParser *ncxParser;
523  NSXMLParser *chapterParser;
524  NavPoint *currentNavPoint;
525 
526  NSString *ncxId;
529  int depth; // 버그픽스
530 
531  DisplayOptions *displayOptions;
532  NSString *displayOptionsXMLPath;
533  NSString *baseDirectory;
534 
535  BOOL isRTL;
536  BOOL isVerticalWriting;
537 
538  BOOL isPubCoder;
539  Item* coverItem;
540 
541  int spread;
542 
543  BOOL isEncrypted;
544  Encryption* encryption;
545  BOOL hasRights;
546 }
547 
549 -(BOOL)parseXML:(NSString*)fileName;
550 -(BOOL)parseChapter:(NSString*)path;
551 -(BOOL)parseNcx;
552 -(BOOL)parseOpf;
553 -(Sequence*)parseMediaOverlay:(ItemRef *)itemRef;
554 -(BOOL)parseContainerXML;
555 -(NSString *)getChapterTitle:(int)chapterIndex;
556 -(BOOL)parseOpfSampleBook;
557 -(BOOL)parseXMLSampleBook:(NSString *)name;
558 -(int)getChapterIndexByNCXIndex:(int)ni;
559 -(int)getChapterIndexByNavPoint:(NavPoint*)navPoint;
560 -(NSString*)getOriginalContentByNCXIndex:(int)ni; // 버그픽스
561 -(NSString *)getChapterTitle:(int)ci;
562 -(NSString *)getCoverURL;
563 -(BOOL)parseDisplayOptions;
564 -(void)domTest;
565 -(void)destroy;
566 
567 @property (nonatomic,copy) NSString *fileName,*fontName;
568 @property (nonatomic,copy) NSString *ePubPath;
569 @property (nonatomic,copy) NSString *opfPath,*opfDir,*ncxPath,*ncxName,*ncxId,*imagePath;
570 @property int parserType;
571 @property (nonatomic,retain) NSMutableArray *Manifest;
572 @property (nonatomic,retain) NSMutableArray *Spine;
573 @property (nonatomic,retain) NSMutableArray *SpineForLinearNo;
574 @property (nonatomic,retain) NSMutableArray *Guide;
575 @property (nonatomic,retain) NSMutableArray *NavMap;
576 @property (nonatomic,copy) NSString *currentImagePath;
577 @property (nonatomic,copy) NSString *title,*creator,*publisher,*subject,*source,*identifier,*language,*date,*type,*bookCover,*description;
578 @property (nonatomic,retain) Rights* rights;
579 @property (nonatomic,copy) NSString* right;
580 @property BOOL isCartoon,isRent,isSerial;
581 @property int bookCode,fontSize,chapterIndex,pTagCount,imgTagCount,readCount;
582 @property double pagePercent;
583 @property (nonatomic,retain) NSDate *dueDate;
584 @property (nonatomic,retain) NSString*lastReadDate;
585 @property (nonatomic,retain) NSString*downloadDate;
586 @property (nonatomic,copy) NSString* stackNo;
587 @property BOOL isFixedLayout,isRTL,isVerticalWriting;
588 @property int fixedWidth;
589 @property int fixedHeight;
590 @property float fixedAspectRatio;
591 @property int lineSpacing;
592 @property (nonatomic,retain) DisplayOptions* displayOptions;
593 @property (nonatomic,retain) NSString *displayOptionsXMLPath;
594 @property (nonatomic,retain) NSString *baseDirectory;
595 @property (nonatomic,retain) Item *coverItem;
596 @property (nonatomic,retain) Encryption *encryption;
597 @property int spread;
598 @property BOOL isPubCoder;
599 @property BOOL isEncrypted;
600 @property BOOL hasRights;
601 
602 @end