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

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  * See COPYRIGHTS file for copyrights information.
00021  */
00022 
00023 #ifndef __CR_SEL_ENG_H__
00024 #define __CR_SEL_ENG_H__
00025 
00026 #define NEW_PROPERTIES_GETTER 1
00027 
00028 #include "cr-utils.h"
00029 #include "cr-stylesheet.h"
00030 #include "cr-cascade.h"
00031 #include "cr-style.h"
00032 #ifdef NEW_PROPERTIES_GETTER
00033 #include "cr-prop-list.h"
00034 #endif
00035 
00036 #ifdef CROCO_HAVE_LIBXML2
00037  #include <libxml/tree.h>
00038 #endif
00039 
00040 
00041 
00042 /**
00043  *@file:
00044  *The declaration of the  #CRSelEng class.
00045  *The #CRSelEng is actually the "Selection Engine"
00046  *class.
00047  */
00048 
00049 G_BEGIN_DECLS
00050 
00051 typedef struct _CRSelEng CRSelEng ;
00052 typedef struct _CRSelEngPriv CRSelEngPriv ;
00053 
00054 /**
00055  *The Selection engine class.
00056  *The main service provided by this class, is
00057  *the ability to interpret a libcroco implementation
00058  *of css2 selectors, and given an xml node, say if
00059  *the selector matches the node or not.
00060  */
00061 struct _CRSelEng
00062 {
00063         CRSelEngPriv *priv ;
00064 } ;
00065 
00066 
00067 typedef gboolean (*CRPseudoClassSelectorHandler) (CRSelEng* a_this,
00068                                                   CRAdditionalSel *a_add_sel,
00069                                                   xmlNode *a_node) ;
00070 CRSelEng * cr_sel_eng_new (void) ;
00071 
00072 enum CRStatus cr_sel_eng_register_pseudo_class_sel_handler (CRSelEng *a_this,
00073                                                             guchar *a_pseudo_class_sel_name,
00074                                                             enum CRPseudoType a_pseudo_class_type,
00075                                                             CRPseudoClassSelectorHandler a_handler) ;
00076 
00077 enum CRStatus cr_sel_eng_unregister_pseudo_class_sel_handler (CRSelEng *a_this,
00078                                                               guchar *a_pseudo_class_sel_name,
00079                                                               enum CRPseudoType a_pseudo_class_type) ;
00080 
00081 enum CRStatus cr_sel_eng_unregister_all_pseudo_class_sel_handlers (CRSelEng *a_this) ;
00082 
00083 enum CRStatus cr_sel_eng_get_pseudo_class_selector_handler (CRSelEng *a_this,
00084                                                             guchar *a_pseudo_class_sel_name,
00085                                                             enum CRPseudoType a_pseudo_class_type,
00086                                                             CRPseudoClassSelectorHandler *a_handler) ;
00087 
00088 enum CRStatus cr_sel_eng_matches_node (CRSelEng *a_this, 
00089                                        CRSimpleSel *a_sel,
00090                                        xmlNode *a_node, 
00091                                        gboolean *a_result) ;
00092 
00093 enum CRStatus cr_sel_eng_get_matched_rulesets (CRSelEng *a_this,
00094                                                CRStyleSheet *a_sheet,
00095                                                xmlNode *a_node,
00096                                                CRStatement ***a_rulesets,
00097                                                gulong *a_len) ;
00098 
00099 #ifndef NEW_PROPERTIES_GETTER
00100 enum CRStatus cr_sel_eng_get_matched_properties_from_cascade  (CRSelEng *a_this,
00101                                                                CRCascade *a_cascade,
00102                                                                xmlNode *a_node,
00103                                                                GHashTable **props_decls_dict) ;
00104 #else
00105 enum CRStatus
00106 cr_sel_eng_get_matched_properties_from_cascade  (CRSelEng *a_this,
00107                                                  CRCascade *a_cascade,
00108                                                  xmlNode *a_node,
00109                                                  CRPropList **a_props) ;
00110 #endif
00111 
00112 enum CRStatus cr_sel_eng_get_matched_style (CRSelEng *a_this,
00113                                             CRCascade *a_cascade,
00114                                             xmlNode *a_node,
00115                                             CRStyle *a_parent_style,
00116                                             CRStyle **a_style) ;
00117 
00118 void cr_sel_eng_destroy (CRSelEng *a_this) ;
00119 
00120 G_END_DECLS
00121 
00122 
00123 #endif/*__CR_SEL_ENG_H__*/

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