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 * Author: Dodji Seketeli
21 * See COPYRIGHTS file for copyrights information.
24 #ifndef __CR_SEL_ENG_H__
25 #define __CR_SEL_ENG_H__
28 #include "cr-stylesheet.h"
29 #include "cr-cascade.h"
31 #include "cr-prop-list.h"
33 #ifdef CROCO_HAVE_LIBXML2
34 #include <libxml/tree.h>
41 *The declaration of the #CRSelEng class.
42 *The #CRSelEng is actually the "Selection Engine"
48 typedef struct _CRSelEng CRSelEng ;
49 typedef struct _CRSelEngPriv CRSelEngPriv ;
52 *The Selection engine class.
53 *The main service provided by this class, is
54 *the ability to interpret a libcroco implementation
55 *of css2 selectors, and given an xml node, say if
56 *the selector matches the node or not.
64 typedef gboolean (*CRPseudoClassSelectorHandler) (CRSelEng* a_this,
65 CRAdditionalSel *a_add_sel,
67 CRSelEng * cr_sel_eng_new (void) ;
69 enum CRStatus cr_sel_eng_register_pseudo_class_sel_handler (CRSelEng *a_this,
70 guchar *a_pseudo_class_sel_name,
71 enum CRPseudoType a_pseudo_class_type,
72 CRPseudoClassSelectorHandler a_handler) ;
74 enum CRStatus cr_sel_eng_unregister_pseudo_class_sel_handler (CRSelEng *a_this,
75 guchar *a_pseudo_class_sel_name,
76 enum CRPseudoType a_pseudo_class_type) ;
78 enum CRStatus cr_sel_eng_unregister_all_pseudo_class_sel_handlers (CRSelEng *a_this) ;
80 enum CRStatus cr_sel_eng_get_pseudo_class_selector_handler (CRSelEng *a_this,
81 guchar *a_pseudo_class_sel_name,
82 enum CRPseudoType a_pseudo_class_type,
83 CRPseudoClassSelectorHandler *a_handler) ;
85 enum CRStatus cr_sel_eng_matches_node (CRSelEng *a_this,
90 enum CRStatus cr_sel_eng_get_matched_rulesets (CRSelEng *a_this,
91 CRStyleSheet *a_sheet,
93 CRStatement ***a_rulesets,
97 cr_sel_eng_get_matched_properties_from_cascade (CRSelEng *a_this,
100 CRPropList **a_props) ;
102 enum CRStatus cr_sel_eng_get_matched_style (CRSelEng *a_this,
103 CRCascade *a_cascade,
105 CRStyle *a_parent_style,
107 gboolean a_set_props_to_initial_values) ;
109 void cr_sel_eng_destroy (CRSelEng *a_this) ;
114 #endif/*__CR_SEL_ENG_H__*/