1 /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
4 * This file is part of The Croco Library
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2.1 of the GNU Lesser General Public
8 * License as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 * See the COPYRIGHTS file for copyright information.
23 #ifndef __CR_DECLARATION_H__
24 #define __CR_DECLARATION_H__
29 #include "cr-parsing-location.h"
35 *The declaration of the #CRDeclaration class.
38 /*forward declaration of what is defined in cr-statement.h*/
39 typedef struct _CRStatement CRStatement ;
42 *The abstraction of a css declaration defined by the
43 *css2 spec in chapter 4.
44 *It is actually a chained list of property/value pairs.
46 typedef struct _CRDeclaration CRDeclaration ;
52 /**The value of the property.*/
55 /*the ruleset that contains this declaration*/
56 CRStatement *parent_statement ;
58 /*the next declaration*/
61 /*the previous one declaration*/
64 /*does the declaration have the important keyword ?*/
69 CRParsingLocation location ;
70 /*reserved for future usage*/
78 CRDeclaration * cr_declaration_new (CRStatement *a_statement,
83 CRDeclaration * cr_declaration_parse_from_buf (CRStatement *a_statement,
85 enum CREncoding a_enc) ;
87 CRDeclaration * cr_declaration_parse_list_from_buf (const guchar *a_str,
88 enum CREncoding a_enc) ;
90 CRDeclaration * cr_declaration_append (CRDeclaration *a_this,
91 CRDeclaration *a_new) ;
93 CRDeclaration * cr_declaration_append2 (CRDeclaration *a_this,
97 CRDeclaration * cr_declaration_prepend (CRDeclaration *a_this,
98 CRDeclaration *a_new) ;
100 CRDeclaration * cr_declaration_unlink (CRDeclaration * a_decl) ;
103 cr_declaration_dump (CRDeclaration const *a_this,
104 FILE *a_fp, glong a_indent,
105 gboolean a_one_per_line) ;
107 void cr_declaration_dump_one (CRDeclaration const *a_this,
108 FILE *a_fp, glong a_indent) ;
110 gint cr_declaration_nr_props (CRDeclaration const *a_this) ;
112 CRDeclaration * cr_declaration_get_from_list (CRDeclaration *a_this,
115 CRDeclaration * cr_declaration_get_by_prop_name (CRDeclaration *a_this,
116 const guchar *a_str) ;
118 gchar * cr_declaration_to_string (CRDeclaration const *a_this,
121 guchar * cr_declaration_list_to_string (CRDeclaration const *a_this,
124 guchar * cr_declaration_list_to_string2 (CRDeclaration const *a_this,
126 gboolean a_one_decl_per_line) ;
128 void cr_declaration_ref (CRDeclaration *a_this) ;
130 gboolean cr_declaration_unref (CRDeclaration *a_this) ;
132 void cr_declaration_destroy (CRDeclaration *a_this) ;
136 #endif /*__CR_DECLARATION_H__*/