Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gnulib-local / lib / libcroco / cr-stylesheet.h
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 Lesser 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 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
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
30 G_BEGIN_DECLS
31
32 /**
33  *@file
34  *The declaration of the #CRStyleSheet class.
35  */
36
37
38 enum 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  */
57 struct _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
85 CRStyleSheet * cr_stylesheet_new (CRStatement *a_stmts) ;
86
87 gchar * cr_stylesheet_to_string (CRStyleSheet *a_this) ;
88 void cr_stylesheet_dump (CRStyleSheet *a_this, FILE *a_fp) ;
89
90 gint cr_stylesheet_nr_rules (CRStyleSheet *a_this) ;
91
92 CRStatement * cr_stylesheet_statement_get_from_list (CRStyleSheet *a_this, int itemnr) ;
93
94 void cr_stylesheet_ref (CRStyleSheet *a_this) ;
95
96 gboolean cr_stylesheet_unref (CRStyleSheet *a_this) ;
97
98 void cr_stylesheet_destroy (CRStyleSheet *a_this) ;
99
100 G_END_DECLS
101
102 #endif /*__CR_STYLESHEET_H__*/