Libcroco
|
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 the COPYRIGHTS file for copyright information. 00022 */ 00023 00024 00025 #ifndef __CR_ADD_SEL_H__ 00026 #define __CR_ADD_SEL_H__ 00027 00028 #include <stdio.h> 00029 #include <glib.h> 00030 #include "cr-utils.h" 00031 #include "cr-attr-sel.h" 00032 #include "cr-pseudo.h" 00033 #include "cr-additional-sel.h" 00034 00035 G_BEGIN_DECLS 00036 00037 enum AddSelectorType 00038 { 00039 NO_ADD_SELECTOR = 0 , 00040 CLASS_ADD_SELECTOR = 1 , 00041 PSEUDO_CLASS_ADD_SELECTOR = 1 << 1, 00042 ID_ADD_SELECTOR = 1 << 3, 00043 ATTRIBUTE_ADD_SELECTOR = 1 << 4 00044 } ; 00045 00046 union CRAdditionalSelectorContent 00047 { 00048 CRString *class_name ; 00049 CRString *id_name ; 00050 CRPseudo *pseudo ; 00051 CRAttrSel *attr_sel ; 00052 } ; 00053 00054 typedef struct _CRAdditionalSel CRAdditionalSel ; 00055 00056 struct _CRAdditionalSel 00057 { 00058 enum AddSelectorType type ; 00059 union CRAdditionalSelectorContent content ; 00060 00061 CRAdditionalSel * next ; 00062 CRAdditionalSel * prev ; 00063 CRParsingLocation location ; 00064 } ; 00065 00066 CRAdditionalSel * cr_additional_sel_new (void) ; 00067 00068 CRAdditionalSel * cr_additional_sel_new_with_type (enum AddSelectorType a_sel_type) ; 00069 00070 CRAdditionalSel * cr_additional_sel_append (CRAdditionalSel *a_this, 00071 CRAdditionalSel *a_sel) ; 00072 00073 void cr_additional_sel_set_class_name (CRAdditionalSel *a_this, 00074 CRString *a_class_name) ; 00075 00076 void cr_additional_sel_set_id_name (CRAdditionalSel *a_this, 00077 CRString *a_id) ; 00078 00079 void cr_additional_sel_set_pseudo (CRAdditionalSel *a_this, 00080 CRPseudo *a_pseudo) ; 00081 00082 void cr_additional_sel_set_attr_sel (CRAdditionalSel *a_this, 00083 CRAttrSel *a_sel) ; 00084 00085 CRAdditionalSel * cr_additional_sel_prepend (CRAdditionalSel *a_this, 00086 CRAdditionalSel *a_sel) ; 00087 00088 guchar * cr_additional_sel_to_string (CRAdditionalSel const *a_this) ; 00089 00090 guchar * cr_additional_sel_one_to_string (CRAdditionalSel const *a_this) ; 00091 00092 void cr_additional_sel_dump (CRAdditionalSel const *a_this, FILE *a_fp) ; 00093 00094 void cr_additional_sel_destroy (CRAdditionalSel *a_this) ; 00095 00096 G_END_DECLS 00097 00098 #endif /*__CR_ADD_SEL_H*/