1 /*
    2  * << Haru Free PDF Library >> -- hpdf_pages.c
    3  *
    4  * URL: http://libharu.org
    5  *
    6  * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
    7  * Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
    8  *
    9  * Permission to use, copy, modify, distribute and sell this software
   10  * and its documentation for any purpose is hereby granted without fee,
   11  * provided that the above copyright notice appear in all copies and
   12  * that both that copyright notice and this permission notice appear
   13  * in supporting documentation.
   14  * It is provided "as is" without express or implied warranty.
   15  *
   16  */
   17 
   18 #ifndef _HPDF_PAGES_H
   19 #define _HPDF_PAGES_H
   20 
   21 #include "hpdf_gstate.h"
   22 #include "hpdf_ext_gstate.h"
   23 
   24 #ifdef __cplusplus
   25 extern "C" {
   26 #endif
   27 
   28 /*----------------------------------------------------------------------------*/
   29 /*----- HPDF_Pages -----------------------------------------------------------*/
   30 
   31 HPDF_Pages
   32 HPDF_Pages_New  (HPDF_MMgr   mmgr,
   33                  HPDF_Pages  parent,
   34                  HPDF_Xref   xref);
   35 
   36 
   37 HPDF_BOOL
   38 HPDF_Pages_Validate  (HPDF_Pages  pages);
   39 
   40 
   41 HPDF_STATUS
   42 HPDF_Pages_AddKids  (HPDF_Pages  parent,
   43                       HPDF_Dict   kid);
   44 
   45 
   46 HPDF_STATUS
   47 HPDF_Page_InsertBefore  (HPDF_Page   page,
   48                          HPDF_Page   target);
   49 
   50 
   51 typedef struct _HPDF_PageAttr_Rec  *HPDF_PageAttr;
   52 
   53 typedef struct _HPDF_PageAttr_Rec {
   54     HPDF_Pages         parent;
   55     HPDF_Dict          fonts;
   56     HPDF_Dict          xobjects;
   57     HPDF_Dict          ext_gstates;
   58     HPDF_GState        gstate;
   59     HPDF_Point         str_pos;
   60     HPDF_Point         cur_pos;
   61     HPDF_Point         text_pos;
   62     HPDF_TransMatrix   text_matrix;
   63     HPDF_UINT16        gmode;
   64     HPDF_Dict          contents;
   65     HPDF_Stream        stream;
   66     HPDF_Xref          xref;
   67     HPDF_UINT          compression_mode;
   68 	HPDF_PDFVer       *ver; 
   69 } HPDF_PageAttr_Rec;
   70 
   71 
   72 /*----------------------------------------------------------------------------*/
   73 /*----- HPDF_Page ------------------------------------------------------------*/
   74 
   75 HPDF_BOOL
   76 HPDF_Page_Validate  (HPDF_Page  page);
   77 
   78 
   79 HPDF_Page
   80 HPDF_Page_New  (HPDF_MMgr   mmgr,
   81                 HPDF_Xref   xref);
   82 
   83 
   84 void*
   85 HPDF_Page_GetInheritableItem  (HPDF_Page      page,
   86                                const char    *key,
   87                                HPDF_UINT16    obj_class);
   88 
   89 
   90 const char*
   91 HPDF_Page_GetXObjectName  (HPDF_Page     page,
   92                            HPDF_XObject  xobj);
   93 
   94 
   95 const char*
   96 HPDF_Page_GetLocalFontName  (HPDF_Page  page,
   97                              HPDF_Font  font);
   98 
   99 
  100 const char*
  101 HPDF_Page_GetExtGStateName  (HPDF_Page       page,
  102                              HPDF_ExtGState  gstate);
  103 
  104 
  105 HPDF_Box
  106 HPDF_Page_GetMediaBox  (HPDF_Page    page);
  107 
  108 
  109 HPDF_STATUS
  110 HPDF_Page_SetBoxValue (HPDF_Page     page,
  111                        const char   *name,
  112                        HPDF_UINT     index,
  113                        HPDF_REAL     value);
  114 
  115 
  116 void
  117 HPDF_Page_SetFilter  (HPDF_Page    page,
  118                       HPDF_UINT    filter);
  119 
  120 
  121 HPDF_STATUS
  122 HPDF_Page_CheckState  (HPDF_Page  page,
  123                        HPDF_UINT  mode);
  124 
  125 
  126 #ifdef __cplusplus
  127 }
  128 #endif /* __cplusplus */
  129 
  130 #endif /* _HPDF_PAGES_H */
  131