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