Sophie

Sophie

distrib > * > 2010.0 > * > by-pkgid > 82bf76c75b44c3e54c5dc9d8c4b11ab5 > files > 57

cgicc-3.2.8-1mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
   "http://www.w3.org/TR/REC-html40/loose.dtd">

<html lang="en" dir="LTR">

<head>
  <!-- $Id: header.html,v 1.5 2004/06/12 01:58:25 sbooth Exp $ -->
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>cgicc: HTMLElement.h Source File</title>
  <link rev="made" href="mailto:bug-cgicc@gnu.org" />
  <link href="doxygen.css" rel="stylesheet" type="text/css" />
  <link href="cgicc-doc.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>HTMLElement.h</h1><a href="HTMLElement_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*-mode:c++; c-file-style: "gnu";-*- */</span>
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> *  $Id: HTMLElement.h,v 1.8 2007/07/02 18:48:18 sebdiaz Exp $</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> *  Copyright (C) 1996 - 2004 Stephen F. Booth &lt;sbooth@gnu.org&gt;</span>
<a name="l00006"></a>00006 <span class="comment"> *                       2007 Sebastien DIAZ &lt;sebastien.diaz@gmail.com&gt;</span>
<a name="l00007"></a>00007 <span class="comment"> *  Part of the GNU cgicc library, http://www.gnu.org/software/cgicc</span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> *  This library is free software; you can redistribute it and/or</span>
<a name="l00010"></a>00010 <span class="comment"> *  modify it under the terms of the GNU Lesser General Public</span>
<a name="l00011"></a>00011 <span class="comment"> *  License as published by the Free Software Foundation; either</span>
<a name="l00012"></a>00012 <span class="comment"> *  version 3 of the License, or (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> *  This library is distributed in the hope that it will be useful,</span>
<a name="l00015"></a>00015 <span class="comment"> *  but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00016"></a>00016 <span class="comment"> *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00017"></a>00017 <span class="comment"> *  Lesser General Public License for more details.</span>
<a name="l00018"></a>00018 <span class="comment"> *</span>
<a name="l00019"></a>00019 <span class="comment"> *  You should have received a copy of the GNU Lesser General Public</span>
<a name="l00020"></a>00020 <span class="comment"> *  License along with this library; if not, write to the Free Software</span>
<a name="l00021"></a>00021 <span class="comment"> *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA </span>
<a name="l00022"></a>00022 <span class="comment"> */</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef _HTMLELEMENT_H_</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define _HTMLELEMENT_H_ 1</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="preprocessor">#ifdef __GNUG__</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#  pragma interface</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00037"></a>00037 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="preprocessor">#include "<a class="code" href="CgiDefs_8h.html" title="Platform and operating system specific macro definitions.">cgicc/CgiDefs.h</a>"</span>
<a name="l00040"></a>00040 <span class="preprocessor">#include "<a class="code" href="MStreamable_8h.html" title="Abstract base class for all streamable objects.">cgicc/MStreamable.h</a>"</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include "<a class="code" href="HTMLAttributeList_8h.html" title="Class containing a list of HTMLAttribute objects.">cgicc/HTMLAttributeList.h</a>"</span>
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 <span class="keyword">namespace </span>cgicc {
<a name="l00044"></a>00044 
<a name="l00045"></a>00045   <span class="keyword">class </span>HTMLElementList;
<a name="l00046"></a>00046   
<a name="l00047"></a>00047   <span class="comment">// ============================================================</span>
<a name="l00048"></a>00048   <span class="comment">// Class HTMLElement</span>
<a name="l00049"></a>00049   <span class="comment">// ============================================================</span>
<a name="l00050"></a>00050   
<a name="l00060"></a><a class="code" href="classcgicc_1_1HTMLElement.html">00060</a>   <span class="keyword">class </span>CGICC_API <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a> : <span class="keyword">public</span> <a class="code" href="classcgicc_1_1MStreamable.html" title="Mix-in streamable interface.">MStreamable</a> 
<a name="l00061"></a>00061   {
<a name="l00062"></a>00062   <span class="keyword">public</span>:
<a name="l00063"></a>00063     
<a name="l00071"></a><a class="code" href="classcgicc_1_1HTMLElement.html#2956e51b12617b7fbc415c6c4c1d2fdc">00071</a>     <span class="keyword">enum</span> <a class="code" href="classcgicc_1_1HTMLElement.html#2956e51b12617b7fbc415c6c4c1d2fdc" title="Possible types of HTMLElements.">EElementType</a> {
<a name="l00073"></a><a class="code" href="classcgicc_1_1HTMLElement.html#2956e51b12617b7fbc415c6c4c1d2fdc8822d05e004c169a5ee0bb93d306a6f8">00073</a>       eAtomic,
<a name="l00075"></a><a class="code" href="classcgicc_1_1HTMLElement.html#2956e51b12617b7fbc415c6c4c1d2fdcb84e58cad176683095b9a453bb29090d">00075</a>       eBoolean
<a name="l00076"></a>00076     };
<a name="l00077"></a>00077     
<a name="l00078"></a>00078     <span class="comment">// ============================================================</span>
<a name="l00079"></a>00079     
<a name="l00082"></a>00082     
<a name="l00089"></a>00089     <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>(<span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp; element);
<a name="l00090"></a>00090     
<a name="l00096"></a>00096     <span class="keyword">virtual</span> ~<a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>();
<a name="l00098"></a>00098     
<a name="l00099"></a>00099     <span class="comment">// ============================================================</span>
<a name="l00100"></a>00100     
<a name="l00103"></a>00103     
<a name="l00111"></a>00111     <span class="keywordtype">bool</span> 
<a name="l00112"></a>00112     operator== (<span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp; element)             <span class="keyword">const</span>;
<a name="l00113"></a>00113     
<a name="l00121"></a>00121     <span class="keyword">inline</span> <span class="keywordtype">bool</span> 
<a name="l00122"></a><a class="code" href="classcgicc_1_1HTMLElement.html#9045dbbda7e20ae0fb1fdfbdc6a54921">00122</a>     operator!= (<span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp; element)<span class="keyword">             const</span>
<a name="l00123"></a>00123 <span class="keyword">    </span>{ <span class="keywordflow">return</span> ! operator==(element); }
<a name="l00124"></a>00124     
<a name="l00125"></a>00125 <span class="preprocessor">#ifdef WIN32</span>
<a name="l00126"></a>00126 <span class="preprocessor"></span>    <span class="comment">/* Dummy operator for MSVC++ */</span>
<a name="l00127"></a>00127     <span class="keyword">inline</span> <span class="keywordtype">bool</span>
<a name="l00128"></a>00128     operator&lt; (<span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp; element)<span class="keyword">              const</span>
<a name="l00129"></a>00129 <span class="keyword">    </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00130"></a>00130 <span class="preprocessor">#endif</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span>    
<a name="l00139"></a>00139     HTMLElement&amp;
<a name="l00140"></a>00140     operator= (<span class="keyword">const</span> HTMLElement&amp; element);
<a name="l00142"></a>00142     
<a name="l00143"></a>00143     <span class="comment">// ============================================================</span>
<a name="l00144"></a>00144     
<a name="l00149"></a>00149     
<a name="l00156"></a>00156     <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*
<a name="l00157"></a>00157     getName()                                   <span class="keyword">const</span> = 0;
<a name="l00158"></a>00158     
<a name="l00165"></a>00165     <span class="keyword">inline</span> std::string
<a name="l00166"></a><a class="code" href="classcgicc_1_1HTMLElement.html#ca7872f9a0af5d68b3f291864d170c6f">00166</a>     getData()<span class="keyword">                                   const</span>
<a name="l00167"></a>00167 <span class="keyword">    </span>{ <span class="keywordflow">return</span> fData; }
<a name="l00168"></a>00168     
<a name="l00175"></a>00175     <span class="keyword">inline</span> EElementType
<a name="l00176"></a><a class="code" href="classcgicc_1_1HTMLElement.html#59839d795931f744b1c1081b09ac1455">00176</a>     getType()<span class="keyword">                                   const</span>
<a name="l00177"></a>00177 <span class="keyword">    </span>{ <span class="keywordflow">return</span> fType; }
<a name="l00179"></a>00179     
<a name="l00180"></a>00180     <span class="comment">// ============================================================</span>
<a name="l00181"></a>00181     
<a name="l00186"></a>00186     
<a name="l00193"></a>00193     <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l00194"></a><a class="code" href="classcgicc_1_1HTMLElement.html#67b10a4236c30b0dd9d377894d2a1592">00194</a>     setData(<span class="keyword">const</span> std::string&amp; data)
<a name="l00195"></a>00195     { fData = data; }
<a name="l00197"></a>00197     
<a name="l00198"></a>00198     <span class="comment">// ============================================================</span>
<a name="l00199"></a>00199     
<a name="l00206"></a>00206     <span class="keyword">virtual</span> <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>*
<a name="l00207"></a>00207     clone()                                     <span class="keyword">const</span> = 0;
<a name="l00208"></a>00208     
<a name="l00209"></a>00209     <span class="comment">// ============================================================</span>
<a name="l00210"></a>00210     
<a name="l00215"></a>00215     
<a name="l00222"></a>00222     <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLElementList.html" title="An expandable list of HTMLElement objects.">HTMLElementList</a>*
<a name="l00223"></a><a class="code" href="classcgicc_1_1HTMLElement.html#8ce9f5d9d8fc44d86f1ac9e6e3b98966">00223</a>     getEmbedded()<span class="keyword">                               const</span>
<a name="l00224"></a>00224 <span class="keyword">    </span>{ <span class="keywordflow">return</span> fEmbedded; }
<a name="l00225"></a>00225     
<a name="l00233"></a>00233     <span class="keywordtype">void</span> 
<a name="l00234"></a>00234     setEmbedded(<span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLElementList.html" title="An expandable list of HTMLElement objects.">HTMLElementList</a>&amp; embedded);
<a name="l00235"></a>00235     
<a name="l00243"></a>00243     <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp;
<a name="l00244"></a>00244     add(<span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp; element);
<a name="l00245"></a>00245     
<a name="l00253"></a>00253     <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp;
<a name="l00254"></a>00254     add(<a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a> *element);
<a name="l00256"></a>00256     
<a name="l00257"></a>00257     <span class="comment">// ============================================================</span>
<a name="l00258"></a>00258     
<a name="l00263"></a>00263     
<a name="l00270"></a>00270     <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLAttributeList.html" title="An expandable list of HTMLAttribute objects.">HTMLAttributeList</a>*
<a name="l00271"></a><a class="code" href="classcgicc_1_1HTMLElement.html#d30265702bd576bb53ae024372f9ab06">00271</a>     getAttributes()<span class="keyword">                             const</span>
<a name="l00272"></a>00272 <span class="keyword">    </span>{ <span class="keywordflow">return</span> fAttributes; }
<a name="l00273"></a>00273     
<a name="l00281"></a>00281     <span class="keywordtype">void</span> 
<a name="l00282"></a>00282     setAttributes(<span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLAttributeList.html" title="An expandable list of HTMLAttribute objects.">HTMLAttributeList</a>&amp; attributes);
<a name="l00283"></a>00283     
<a name="l00291"></a>00291     <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp;
<a name="l00292"></a>00292     <span class="keyword">set</span>(<span class="keyword">const</span> std::string&amp; name);
<a name="l00293"></a>00293     
<a name="l00302"></a>00302     <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>&amp;
<a name="l00303"></a>00303     <span class="keyword">set</span>(<span class="keyword">const</span> std::string&amp; name,
<a name="l00304"></a>00304         <span class="keyword">const</span> std::string&amp; value);
<a name="l00306"></a>00306     
<a name="l00307"></a>00307     <span class="comment">// ============================================================</span>
<a name="l00308"></a>00308     
<a name="l00313"></a>00313     
<a name="l00319"></a>00319     <span class="keyword">virtual</span> <span class="keywordtype">void</span> 
<a name="l00320"></a><a class="code" href="classcgicc_1_1HTMLElement.html#5ce5bbf51b630b1073e359dbac58ea03">00320</a>     swapState()<span class="keyword">                                 const</span>
<a name="l00321"></a>00321 <span class="keyword">    </span>{}
<a name="l00322"></a>00322     
<a name="l00329"></a>00329     <span class="keyword">virtual</span> <span class="keywordtype">bool</span> 
<a name="l00330"></a><a class="code" href="classcgicc_1_1HTMLElement.html#9640e8bb7736f30acb95b00567ec66fb">00330</a>     getState()<span class="keyword">                                  const</span>
<a name="l00331"></a>00331 <span class="keyword">    </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; }
<a name="l00333"></a>00333     
<a name="l00340"></a>00340     <span class="keyword">virtual</span> <span class="keywordtype">void</span> 
<a name="l00341"></a>00341     render(std::ostream&amp; out)                   <span class="keyword">const</span>;
<a name="l00342"></a>00342     
<a name="l00343"></a>00343   <span class="keyword">protected</span>:
<a name="l00344"></a>00344     
<a name="l00355"></a>00355     <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>(<span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLAttributeList.html" title="An expandable list of HTMLAttribute objects.">HTMLAttributeList</a> *attributes,
<a name="l00356"></a>00356                 <span class="keyword">const</span> <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a> *embedded,
<a name="l00357"></a>00357                 <span class="keyword">const</span> std::string *data,
<a name="l00358"></a>00358                 EElementType type);
<a name="l00359"></a>00359     
<a name="l00366"></a>00366     <span class="keyword">inline</span> <span class="keywordtype">bool</span>
<a name="l00367"></a><a class="code" href="classcgicc_1_1HTMLElement.html#d48bd23233ed9ec4178ef97112523cf9">00367</a>     dataSpecified()<span class="keyword">                             const</span>
<a name="l00368"></a>00368 <span class="keyword">    </span>{ <span class="keywordflow">return</span> fDataSpecified; }
<a name="l00369"></a>00369     
<a name="l00370"></a>00370   <span class="keyword">private</span>:
<a name="l00371"></a>00371     <a class="code" href="classcgicc_1_1HTMLElement.html" title="Class representing an HTML element.">HTMLElement</a>() {}
<a name="l00372"></a>00372     
<a name="l00373"></a>00373     HTMLAttributeList   *fAttributes;
<a name="l00374"></a>00374     HTMLElementList     *fEmbedded;
<a name="l00375"></a>00375     std::string         fData;
<a name="l00376"></a>00376     EElementType        fType;
<a name="l00377"></a>00377     <span class="keywordtype">bool</span>                fDataSpecified;
<a name="l00378"></a>00378   };
<a name="l00379"></a>00379   
<a name="l00380"></a>00380 } <span class="comment">// namespace cgicc</span>
<a name="l00381"></a>00381 
<a name="l00382"></a>00382 <span class="preprocessor">#endif </span><span class="comment">/* ! _HTMLELEMENT_H_ */</span>
</pre></div></div>
<!-- $Id: footer.html,v 1.7 2004/06/12 01:58:25 sbooth Exp $ -->

<hr>

<address><small>
<a href="http://www.cgicc.org">GNU cgicc</a> - A C++ class library for
writing CGI applications<br />
Copyright &copy; 1996 - 2004 
<a href="mailto:sboothATgnuDOTorg">Stephen F. Booth</a><br />
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front Cover Texts, and with no Back-Cover
Texts.<br />
Documentation generated Tue Jun 9 15:03:49 2009 for cgicc by
<a HREF="http://www.doxygen.org/index.html">doxygen</a> 1.5.9
</small></address>

</body>

</html>