cr-sel-eng.h

Go to the documentation of this file.
00001 /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
00002 
00003 /*
00004  * This file is part of The Croco Library
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of version 2.1 of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00018  * USA
00019  *
00020  * Author: Dodji Seketeli
00021  * See COPYRIGHTS file for copyrights information.
00022  */
00023 
00024 #ifndef __CR_SEL_ENG_H__
00025 #define __CR_SEL_ENG_H__
00026 
00027 #include "cr-utils.h"
00028 #include "cr-stylesheet.h"
00029 #include "cr-cascade.h"
00030 #include "cr-style.h"
00031 #include "cr-prop-list.h"
00032 
00033 #ifdef CROCO_HAVE_LIBXML2
00034  #include <libxml/tree.h>
00035 #endif
00036 
00037 
00038 
00039 /**
00040  *@file:
00041  *The declaration of the  #CRSelEng class.
00042  *The #CRSelEng is actually the "Selection Engine"
00043  *class.
00044  */
00045 
00046 G_BEGIN_DECLS
00047 
00048 typedef struct _CRSelEng CRSelEng ;
00049 typedef struct _CRSelEngPriv CRSelEngPriv ;
00050 
00051 /**
00052  *The Selection engine class.
00053  *The main service provided by this class, is
00054  *the ability to interpret a libcroco implementation
00055  *of css2 selectors, and given an xml node, say if
00056  *the selector matches the node or not.
00057  */
00058 struct _CRSelEng
00059 {
00060         CRSelEngPriv *priv ;
00061 } ;
00062 
00063 
00064 typedef gboolean (*CRPseudoClassSelectorHandler) (CRSelEng* a_this,
00065                                                   CRAdditionalSel *a_add_sel,
00066                                                   xmlNode *a_node) ;
00067 CRSelEng * cr_sel_eng_new (void) ;
00068 
00069 enum CRStatus cr_sel_eng_register_pseudo_class_sel_handler (CRSelEng *a_this,
00070                                                             guchar *a_pseudo_class_sel_name,
00071                                                             enum CRPseudoType a_pseudo_class_type,
00072                                                             CRPseudoClassSelectorHandler a_handler) ;
00073 
00074 enum CRStatus cr_sel_eng_unregister_pseudo_class_sel_handler (CRSelEng *a_this,
00075                                                               guchar *a_pseudo_class_sel_name,
00076                                                               enum CRPseudoType a_pseudo_class_type) ;
00077 
00078 enum CRStatus cr_sel_eng_unregister_all_pseudo_class_sel_handlers (CRSelEng *a_this) ;
00079 
00080 enum CRStatus cr_sel_eng_get_pseudo_class_selector_handler (CRSelEng *a_this,
00081                                                             guchar *a_pseudo_class_sel_name,
00082                                                             enum CRPseudoType a_pseudo_class_type,
00083                                                             CRPseudoClassSelectorHandler *a_handler) ;
00084 
00085 enum CRStatus cr_sel_eng_matches_node (CRSelEng *a_this, 
00086                                        CRSimpleSel *a_sel,
00087                                        xmlNode *a_node, 
00088                                        gboolean *a_result) ;
00089 
00090 enum CRStatus cr_sel_eng_get_matched_rulesets (CRSelEng *a_this,
00091                                                CRStyleSheet *a_sheet,
00092                                                xmlNode *a_node,
00093                                                CRStatement ***a_rulesets,
00094                                                gulong *a_len) ;
00095 
00096 enum CRStatus
00097 cr_sel_eng_get_matched_properties_from_cascade  (CRSelEng *a_this,
00098                                                  CRCascade *a_cascade,
00099                                                  xmlNode *a_node,
00100                                                  CRPropList **a_props) ;
00101 
00102 enum CRStatus cr_sel_eng_get_matched_style (CRSelEng *a_this,
00103                                             CRCascade *a_cascade,
00104                                             xmlNode *a_node,
00105                                             CRStyle *a_parent_style,
00106                                             CRStyle **a_style,
00107                                             gboolean a_set_props_to_initial_values) ;
00108 
00109 void cr_sel_eng_destroy (CRSelEng *a_this) ;
00110 
00111 G_END_DECLS
00112 
00113 
00114 #endif/*__CR_SEL_ENG_H__*/

Generated on Wed Mar 15 18:23:54 2006 for Libcroco by  doxygen 1.4.6