Libcroco
cr-om-parser.h
Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
00002 
00003 /*
00004  * This file is part of The Croco Library
00005  *
00006  * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of version 2.1 of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the 
00018  * GNU Lesser General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  */
00023 
00024 /*
00025  *$Id$
00026  */
00027 
00028 #ifndef __CR_OM_PARSER_H__
00029 #define __CR_OM_PARSER_H__
00030 
00031 #include "cr-parser.h"
00032 #include "cr-cascade.h"
00033 
00034 
00035 /**
00036  *@file
00037  *The definition of the CSS Object Model Parser.
00038  *This parser uses (and sits) the SAC api of libcroco defined
00039  *in cr-parser.h and cr-doc-handler.h
00040  */
00041 
00042 G_BEGIN_DECLS
00043 
00044 typedef struct _CROMParser CROMParser ;
00045 typedef struct _CROMParserPriv CROMParserPriv ;
00046 
00047 /**
00048  *The Object model parser.
00049  *Can parse a css file and build a css object model.
00050  *This parser uses an instance of #CRParser and defines
00051  *a set of SAC callbacks to build the Object Model.
00052  */
00053 struct _CROMParser
00054 {
00055         CROMParserPriv *priv ;
00056 } ;
00057 
00058 CROMParser * cr_om_parser_new (CRInput *a_input) ;
00059 
00060 
00061 enum CRStatus cr_om_parser_simply_parse_file (const guchar *a_file_path,
00062                                               enum CREncoding a_enc,
00063                                               CRStyleSheet **a_result) ;
00064 
00065 enum CRStatus cr_om_parser_parse_file (CROMParser *a_this,
00066                                        const guchar *a_file_uri,
00067                                        enum CREncoding a_enc,
00068                                        CRStyleSheet **a_result) ;
00069 
00070 enum CRStatus cr_om_parser_simply_parse_buf (const guchar *a_buf,
00071                                              gulong a_len,
00072                                              enum CREncoding a_enc,
00073                                              CRStyleSheet **a_result) ;
00074 
00075 enum CRStatus cr_om_parser_parse_buf (CROMParser *a_this,
00076                                       const guchar *a_buf,
00077                                       gulong a_len,
00078                                       enum CREncoding a_enc,
00079                                       CRStyleSheet **a_result) ;
00080 
00081 enum CRStatus cr_om_parser_parse_paths_to_cascade (CROMParser *a_this,
00082                                                    const guchar *a_author_path,
00083                                                    const guchar *a_user_path,
00084                                                    const guchar *a_ua_path,
00085                                                    enum CREncoding a_encoding,
00086                                                    CRCascade ** a_result) ;
00087 
00088 enum CRStatus cr_om_parser_simply_parse_paths_to_cascade (const guchar *a_author_path,
00089                                                           const guchar *a_user_path,
00090                                                           const guchar *a_ua_path,
00091                                                           enum CREncoding a_encoding,
00092                                                           CRCascade ** a_result) ;
00093 
00094 void cr_om_parser_destroy (CROMParser *a_this) ;
00095 
00096 G_END_DECLS
00097 
00098 #endif /*__CR_OM_PARSER_H__*/