Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

cr-declaration.h

Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode: ni; 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 GNU Lesser General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00020  * USA
00021  */
00022 
00023 /*
00024  *$Id: cr-declaration.h,v 1.10 2004/03/06 19:04:47 dodji Exp $
00025  */
00026 
00027 #ifndef __CR_DECLARATION_H__
00028 #define __CR_DECLARATION_H__
00029 
00030 #include <stdio.h>
00031 #include "cr-utils.h"
00032 #include "cr-term.h"
00033 
00034 G_BEGIN_DECLS
00035 
00036 /**
00037  *@file
00038  *The declaration of the #CRDeclaration class.
00039  */
00040 
00041 /*forward declaration of what is defined in cr-statement.h*/
00042 typedef struct _CRStatement CRStatement ;
00043 
00044 /**
00045  *The abstraction of a css declaration defined by the
00046  *css2 spec in chapter 4.
00047  *It is actually a chained list of property/value pairs.
00048  */
00049 typedef struct _CRDeclaration CRDeclaration ;
00050 struct _CRDeclaration
00051 {
00052         /**The property.*/
00053         GString *property ;
00054 
00055         /**The value of the property.*/
00056         CRTerm *value ;
00057         
00058         /*the ruleset that contains this declaration*/
00059         CRStatement *parent_statement ;
00060 
00061         /*the next declaration*/
00062         CRDeclaration *next ;
00063 
00064         /*the previous one declaration*/
00065         CRDeclaration *prev ;
00066 
00067         /*does the declaration have the important keyword ?*/
00068         gboolean important ;
00069 
00070         glong ref_count ;
00071 
00072         /*reserved for future usage*/
00073         gpointer rfu0 ; 
00074         gpointer rfu1 ;
00075         gpointer rfu2 ;
00076         gpointer rfu3 ;
00077 } ;
00078 
00079 
00080 CRDeclaration * cr_declaration_new (CRStatement *a_statement,
00081                                     GString *a_property, 
00082                                     CRTerm *a_value) ;
00083 
00084 
00085 CRDeclaration * cr_declaration_parse_from_buf (CRStatement *a_statement,
00086                                                const guchar *a_str,
00087                                                enum CREncoding a_enc) ;
00088 
00089 CRDeclaration * cr_declaration_parse_list_from_buf (const guchar *a_str, 
00090                                                     enum CREncoding a_enc) ;
00091 
00092 CRDeclaration * cr_declaration_append (CRDeclaration *a_this, CRDeclaration *a_new) ;
00093 
00094 CRDeclaration * cr_declaration_append2 (CRDeclaration *a_this, GString *a_prop,
00095                                         CRTerm *a_value) ;
00096 
00097 CRDeclaration * cr_declaration_prepend (CRDeclaration *a_this, CRDeclaration *a_new) ;
00098 
00099 CRDeclaration * cr_declaration_unlink (CRDeclaration * a_decl) ;
00100 
00101 void
00102 cr_declaration_dump (CRDeclaration *a_this, FILE *a_fp, glong a_indent,
00103                      gboolean a_one_per_line) ;
00104 
00105 void cr_declaration_dump_one (CRDeclaration *a_this, 
00106                               FILE *a_fp, glong a_indent) ;
00107 
00108 gint cr_declaration_nr_props (CRDeclaration *a_this) ;
00109 
00110 CRDeclaration * cr_declaration_get_from_list (CRDeclaration *a_this, int itemnr) ;
00111 
00112 CRDeclaration * cr_declaration_get_by_prop_name (CRDeclaration *a_this, const guchar *a_str) ;
00113 
00114 gchar * cr_declaration_to_string (CRDeclaration *a_this,
00115                                   gulong a_indent) ;
00116 guchar * cr_declaration_list_to_string (CRDeclaration *a_this,
00117                                         gulong a_indent) ;
00118 guchar * cr_declaration_list_to_string2 (CRDeclaration *a_this,
00119                                          gulong a_indent,
00120                                          gboolean a_one_decl_per_line) ;
00121 void  cr_declaration_ref (CRDeclaration *a_this) ;
00122 
00123 gboolean cr_declaration_unref (CRDeclaration *a_this) ;
00124 
00125 void cr_declaration_destroy (CRDeclaration *a_this) ;
00126 
00127 G_END_DECLS
00128 
00129 #endif /*__CR_DECLARATION_H__*/

Generated on Sat Mar 20 02:38:42 2004 for Libcroco by doxygen 1.3.5