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@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.1 2003/04/12 16:50:30 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 *
00081 cr_additional_sel_new (void) ;
00082 
00083 CRAdditionalSel *
00084 cr_additional_sel_new_with_type 
00085 (enum AddSelectorType a_sel_type) ;
00086 
00087 CRAdditionalSel *
00088 cr_additional_sel_append (CRAdditionalSel *a_this, 
00089                           CRAdditionalSel *a_sel) ;
00090 void
00091 cr_additional_sel_set_class_name (CRAdditionalSel *a_this,
00092                                   GString *a_class_name) ;
00093 void
00094 cr_additional_sel_set_id_name (CRAdditionalSel *a_this,
00095                                GString *a_id) ;
00096 
00097 void
00098 cr_additional_sel_set_pseudo (CRAdditionalSel *a_this,
00099                               CRPseudo *a_pseudo) ;
00100 
00101 void
00102 cr_additional_sel_set_attr_sel (CRAdditionalSel *a_this,
00103                                 CRAttrSel *a_sel) ;
00104 
00105 CRAdditionalSel *
00106 cr_additional_sel_prepend (CRAdditionalSel *a_this, 
00107                            CRAdditionalSel *a_sel) ;
00108 
00109 guchar *
00110 cr_additional_sel_to_string (CRAdditionalSel *a_this) ;
00111 
00112 void
00113 cr_additional_sel_dump (CRAdditionalSel *a_this, FILE *a_fp) ;
00114 
00115 void
00116 cr_additional_sel_destroy (CRAdditionalSel *a_this) ;
00117 
00118 G_END_DECLS
00119 
00120 #endif /*__CR_ADD_SEL_H*/

Generated on Wed Oct 1 01:36:44 2003 for Libcroco by doxygen 1.3.3