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

cr-additional-sel.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  * Copyright (C) 2002-2003 Dodji Seketeli <dodji at seketeli.org>
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of version 2.1 of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00020  * USA
00021  */
00022 
00023 /*
00024  *$Id: cr-additional-sel.h,v 1.6 2004/01/24 19:24:01 dodji Exp $
00025  */
00026 
00027 /**
00028  *@file
00029  *This file holds the declaration of the
00030  *#CRAddSel class. 
00031  */
00032 #ifndef __CR_ADD_SEL_H__
00033 #define __CR_ADD_SEL_H__
00034 
00035 #include <stdio.h>
00036 #include <glib.h>
00037 #include "cr-utils.h"
00038 #include "cr-attr-sel.h"
00039 #include "cr-pseudo.h"
00040 
00041 G_BEGIN_DECLS
00042 
00043 enum AddSelectorType
00044 {
00045         NO_ADD_SELECTOR = 0 ,
00046         CLASS_ADD_SELECTOR = 1 ,
00047         PSEUDO_CLASS_ADD_SELECTOR = 1 << 1,
00048         ID_ADD_SELECTOR = 1 << 3,
00049         ATTRIBUTE_ADD_SELECTOR = 1 << 4
00050 } ;
00051 
00052 union CRAdditionalSelectorContent
00053 {
00054         GString *class_name ;
00055         GString *id_name ;
00056         CRPseudo *pseudo ;
00057         CRAttrSel *attr_sel ;
00058 } ;
00059 
00060 typedef struct _CRAdditionalSel CRAdditionalSel ;
00061 
00062 /**
00063  *#CRAdditionalSel abstracts
00064  *an additionnal selector.
00065  *An additional selector is the selector part
00066  *that comes after the combination of type selectors.
00067  *It can be either "a class selector (the .class part),
00068  *a pseudo class selector, an attribute selector 
00069  *or an id selector.
00070  */
00071 struct _CRAdditionalSel
00072 {
00073         enum AddSelectorType type ;
00074         union CRAdditionalSelectorContent content ;
00075 
00076         CRAdditionalSel * next ;
00077         CRAdditionalSel * prev ;
00078 } ;
00079 
00080 CRAdditionalSel * cr_additional_sel_new (void) ;
00081 
00082 CRAdditionalSel * cr_additional_sel_new_with_type  (enum AddSelectorType a_sel_type) ;
00083 
00084 CRAdditionalSel * cr_additional_sel_append (CRAdditionalSel *a_this, 
00085                                             CRAdditionalSel *a_sel) ;
00086 
00087 void cr_additional_sel_set_class_name (CRAdditionalSel *a_this,
00088                                        GString *a_class_name) ;
00089 
00090 void cr_additional_sel_set_id_name (CRAdditionalSel *a_this,
00091                                     GString *a_id) ;
00092 
00093 void cr_additional_sel_set_pseudo (CRAdditionalSel *a_this,
00094                                    CRPseudo *a_pseudo) ;
00095 
00096 void cr_additional_sel_set_attr_sel (CRAdditionalSel *a_this,
00097                                      CRAttrSel *a_sel) ;
00098 
00099 CRAdditionalSel * cr_additional_sel_prepend (CRAdditionalSel *a_this, 
00100                                              CRAdditionalSel *a_sel) ;
00101 
00102 guchar * cr_additional_sel_to_string (CRAdditionalSel *a_this) ;
00103 
00104 void cr_additional_sel_dump (CRAdditionalSel *a_this, FILE *a_fp) ;
00105 
00106 void cr_additional_sel_destroy (CRAdditionalSel *a_this) ;
00107 
00108 G_END_DECLS
00109 
00110 #endif /*__CR_ADD_SEL_H*/

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