libspectre/spectre-document.h

Go to the documentation of this file.
00001 /* This file is part of Libspectre.
00002  * 
00003  * Copyright (C) 2007 Albert Astals Cid <aacid@kde.org>
00004  * Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
00005  *
00006  * Libspectre is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * Libspectre is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 #ifndef SPECTRE_DOCUMENT_H
00022 #define SPECTRE_DOCUMENT_H
00023 
00024 #include <libspectre/spectre-macros.h>
00025 #include <libspectre/spectre-status.h>
00026 #include <libspectre/spectre-page.h>
00027 
00028 SPECTRE_BEGIN_DECLS
00029 
00031 typedef struct SpectreDocument SpectreDocument;
00032 
00034 SpectreDocument   *spectre_document_new                (void);
00035 
00041 void               spectre_document_load               (SpectreDocument *document,
00042                                                         const char      *filename);
00043 
00047 SpectreStatus      spectre_document_status             (SpectreDocument *document);
00048 
00052 void               spectre_document_free               (SpectreDocument *document);
00053 
00058 unsigned int       spectre_document_get_n_pages        (SpectreDocument *document);
00059 
00064 SpectreOrientation spectre_document_get_orientation    (SpectreDocument *document);
00065 
00071 const char        *spectre_document_get_title          (SpectreDocument *document);
00072 
00078 const char        *spectre_document_get_creator        (SpectreDocument *document);
00079 
00085 const char        *spectre_document_get_for            (SpectreDocument *document);
00086 
00093 const char        *spectre_document_get_creation_date  (SpectreDocument *document);
00094 
00099 const char        *spectre_document_get_format         (SpectreDocument *document);
00100 
00105 int                spectre_document_is_eps             (SpectreDocument *document);
00106 
00112 unsigned int       spectre_document_get_language_level (SpectreDocument *document);
00113 
00119 SpectrePage       *spectre_document_get_page           (SpectreDocument *document,
00120                                                         unsigned int     page_index);
00121 
00127 SpectrePage       *spectre_document_get_page_by_label  (SpectreDocument *document,
00128                                                         const char      *label);
00129 
00140 void               spectre_document_render_full        (SpectreDocument      *document,
00141                                                         SpectreRenderContext *rc,
00142                                                         unsigned char       **page_data,
00143                                                         int                  *row_length);
00144 
00156 void               spectre_document_render             (SpectreDocument      *document,
00157                                                         unsigned char       **page_data,
00158                                                         int                  *row_length);
00159 
00160 /*  Convenient function for getting the page size of documents with no pages, tipically eps.
00161     When used with multi-page documents the size of the first page will be returned.
00162     @param document the document whose page will be returned
00163     @width the page width will be returned here, or NULL
00164     @height the page height will be returned here, or NULL
00165 */
00166 void               spectre_document_get_page_size      (SpectreDocument      *document,
00167                                                         int                  *width,
00168                                                         int                  *height);
00169 
00175 void               spectre_document_save               (SpectreDocument *document,
00176                                                         const char      *filename);
00177 /* Save document as a pdf document. This function can fail
00178    @param document the document that will be saved
00179    @param filename the path where document will be saved as pdf
00180    @see spectre_document_status
00181 */
00182 void               spectre_document_save_to_pdf        (SpectreDocument *document,
00183                                                         const char      *filename);
00184 SPECTRE_END_DECLS
00185 
00186 #endif /* SPECTRE_DOCUMENT_H */

Generated on Thu Jan 3 17:29:34 2008 for libspectre by  doxygen 1.5.3