1 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */ 2 3 /* 4 * This file is part of The Croco Library 5 * 6 * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org> 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of version 2.1 of the GNU Lesser General Public 10 * License as published by the Free Software Foundation. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the 18 * GNU Lesser General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 21 * USA 22 */ 23 24 /* 25 *$Id: cr-om-parser.h,v 1.3 2005/02/20 19:00:04 iagorubio Exp $ 26 */ 27 28 #ifndef __CR_OM_PARSER_H__ 29 #define __CR_OM_PARSER_H__ 30 31 #include "cr-parser.h" 32 #include "cr-cascade.h" 33 34 35 /** 36 *@file 37 *The definition of the CSS Object Model Parser. 38 *This parser uses (and sits) the SAC api of libcroco defined 39 *in cr-parser.h and cr-doc-handler.h 40 */ 41 42 G_BEGIN_DECLS 43 44 typedef struct _CROMParser CROMParser ; 45 typedef struct _CROMParserPriv CROMParserPriv ; 46 47 /** 48 *The Object model parser. 49 *Can parse a css file and build a css object model. 50 *This parser uses an instance of #CRParser and defines 51 *a set of SAC callbacks to build the Object Model. 52 */ 53 struct _CROMParser 54 { 55 CROMParserPriv *priv ; 56 } ; 57 58 CROMParser * cr_om_parser_new (CRInput *a_input) ; 59 60 61 enum CRStatus cr_om_parser_simply_parse_file (const guchar *a_file_path, 62 enum CREncoding a_enc, 63 CRStyleSheet **a_result) ; 64 65 enum CRStatus cr_om_parser_parse_file (CROMParser *a_this, 66 const guchar *a_file_uri, 67 enum CREncoding a_enc, 68 CRStyleSheet **a_result) ; 69 70 enum CRStatus cr_om_parser_simply_parse_buf (const guchar *a_buf, 71 gulong a_len, 72 enum CREncoding a_enc, 73 CRStyleSheet **a_result) ; 74 75 enum CRStatus cr_om_parser_parse_buf (CROMParser *a_this, 76 const guchar *a_buf, 77 gulong a_len, 78 enum CREncoding a_enc, 79 CRStyleSheet **a_result) ; 80 81 enum CRStatus cr_om_parser_parse_paths_to_cascade (CROMParser *a_this, 82 const guchar *a_author_path, 83 const guchar *a_user_path, 84 const guchar *a_ua_path, 85 enum CREncoding a_encoding, 86 CRCascade ** a_result) ; 87 88 enum CRStatus cr_om_parser_simply_parse_paths_to_cascade (const guchar *a_author_path, 89 const guchar *a_user_path, 90 const guchar *a_ua_path, 91 enum CREncoding a_encoding, 92 CRCascade ** a_result) ; 93 94 void cr_om_parser_destroy (CROMParser *a_this) ; 95 96 G_END_DECLS 97 98 #endif /*__CR_OM_PARSER_H__*/ 99