1/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */ 2 3/* 4 * This file is part of The Croco Library 5 * 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 General Public 8 * License as published by the Free Software Foundation. 9 * 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. 14 * 15 * You should have received a copy of the GNU 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 18 * USA 19 * 20 * see COPYRIGHTS file for copyright information. 21 */ 22 23 24#ifndef __CR_STYLESHEET_H__ 25#define __CR_STYLESHEET_H__ 26 27#include "cr-utils.h" 28#include "cr-statement.h" 29 30G_BEGIN_DECLS 31 32/** 33 *@file 34 *The declaration of the #CRStyleSheet class. 35 */ 36 37 38enum CRStyleOrigin 39{ 40 /*Please don't change the order of 41 *the values enumerated here ... 42 *New values should be added at the end, 43 *just before ORIGIN_END. 44 */ 45 ORIGIN_UA = 0, 46 ORIGIN_USER, 47 ORIGIN_AUTHOR, 48 49 /*must always be the last one*/ 50 NB_ORIGINS 51} ; 52 53/** 54 *An abstraction of a css stylesheet as defined 55 *by the css2 spec in chapter 4. 56 */ 57struct _CRStyleSheet 58{ 59 /**The css statements list*/ 60 CRStatement *statements ; 61 62 enum CRStyleOrigin origin ; 63 64 /*the parent import rule, if any.*/ 65 CRStatement *parent_import_rule ; 66 67 /**custom data used by libcroco*/ 68 gpointer croco_data ; 69 70 /** 71 *custom application data pointer 72 *Can be used by applications. 73 */ 74 gpointer app_data ; 75 76 /** 77 *the reference count of this insance 78 *Please, don't never ever modify it 79 *directly. Use cr_stylesheet_ref() 80 *and cr_stylesheet_unref() instead. 81 */ 82 gulong ref_count ; 83} ; 84 85CRStyleSheet * cr_stylesheet_new (CRStatement *a_stmts) ; 86 87gchar * cr_stylesheet_to_string (CRStyleSheet *a_this) ; 88void cr_stylesheet_dump (CRStyleSheet *a_this, FILE *a_fp) ; 89 90gint cr_stylesheet_nr_rules (CRStyleSheet *a_this) ; 91 92CRStatement * cr_stylesheet_statement_get_from_list (CRStyleSheet *a_this, int itemnr) ; 93 94void cr_stylesheet_ref (CRStyleSheet *a_this) ; 95 96gboolean cr_stylesheet_unref (CRStyleSheet *a_this) ; 97 98void cr_stylesheet_destroy (CRStyleSheet *a_this) ; 99 100G_END_DECLS 101 102#endif /*__CR_STYLESHEET_H__*/ 103