EBOOKHTMLToken.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /*
00003  * This file is part of the libe-book project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  */
00009 
00010 #ifndef EBOOKHTMLTOKEN_H_INCLUDED
00011 #define EBOOKHTMLTOKEN_H_INCLUDED
00012 
00013 #include <boost/static_assert.hpp>
00014 
00015 #include "EBOOKToken.h"
00016 
00017 namespace libebook
00018 {
00019 
00020 namespace EBOOKHTMLToken
00021 {
00022 
00023 enum
00024 {
00025   INVALID_TOKEN = 0,
00026   FIRST_TOKEN = EBOOKToken<EBOOKHTMLParser>::FIRST_TOKEN,
00027 
00028   // namespace prefixes
00029   xlink,
00030   xml,
00031   xmlns,
00032 
00033   // elements
00034   a,
00035   abbr,
00036   acronym,
00037   address,
00038   applet,
00039   area,
00040   article,
00041   aside,
00042   b,
00043   base,
00044   basefont,
00045   bdi,
00046   bdo,
00047   big,
00048   blink,
00049   blockquote,
00050   body,
00051   br,
00052   button,
00053   caption,
00054   center,
00055   cite,
00056   code,
00057   col,
00058   colgroup,
00059   datalist,
00060   dd,
00061   del,
00062   details,
00063   dfn,
00064   dialog,
00065   dir,
00066   div,
00067   dl,
00068   dt,
00069   em,
00070   embed,
00071   fieldset,
00072   figcaption,
00073   figure,
00074   font,
00075   footer,
00076   form,
00077   h1,
00078   h2,
00079   h3,
00080   h4,
00081   h5,
00082   h6,
00083   head,
00084   header,
00085   hgroup,
00086   hr,
00087   html,
00088   i,
00089   iframe,
00090   img,
00091   input,
00092   ins,
00093   isindex,
00094   kbd,
00095   keygen,
00096   label,
00097   legend,
00098   li,
00099   link,
00100   listing,
00101   main,
00102   map,
00103   mark,
00104   marquee,
00105   menu,
00106   meta,
00107   meter,
00108   nav,
00109   nobr,
00110   noembed,
00111   noframes,
00112   noscript,
00113   object,
00114   ol,
00115   optgroup,
00116   option,
00117   output,
00118   p,
00119   param,
00120   plaintext,
00121   pre,
00122   progress,
00123   q,
00124   rp,
00125   rt,
00126   ruby,
00127   s,
00128   samp,
00129   script,
00130   section,
00131   select,
00132   small,
00133   source,
00134   span,
00135   strike,
00136   strong,
00137   style,
00138   sub,
00139   sup,
00140   table,
00141   tbody,
00142   td,
00143   template_,
00144   textarea,
00145   tfoot,
00146   th,
00147   thead,
00148   title,
00149   tr,
00150   track,
00151   tt,
00152   u,
00153   ul,
00154   var,
00155   video,
00156   wbr,
00157   xmp,
00158 
00159   // attributes
00160   accept,
00161   accept_charset,
00162   accesskey,
00163   action,
00164   align,
00165   alink,
00166   alt,
00167   archive,
00168   axis,
00169   background,
00170   bgcolor,
00171   border,
00172   cellpadding,
00173   cellspacing,
00174   char_,
00175   charoff,
00176   charset,
00177   checked,
00178   class_,
00179   classid,
00180   clear,
00181   codebase,
00182   codetype,
00183   color,
00184   cols,
00185   colspan,
00186   compact,
00187   content,
00188   coords,
00189   data,
00190   datetime,
00191   declare,
00192   defer,
00193   disabled,
00194   enctype,
00195   face,
00196   for_,
00197   frame,
00198   frameborder,
00199   headers,
00200   height,
00201   href,
00202   hreflang,
00203   hspace,
00204   http_equiv,
00205   id,
00206   ismap,
00207   lang,
00208   language,
00209   longdesc,
00210   marginheight,
00211   marginwidth,
00212   maxlength,
00213   media,
00214   method,
00215   multiple,
00216   name,
00217   nohref,
00218   noshade,
00219   nowrap,
00220   onblur,
00221   onchange,
00222   onclick,
00223   ondblclick,
00224   onfocus,
00225   onkeydown,
00226   onkeypress,
00227   onkeyup,
00228   onload,
00229   onmousedown,
00230   onmousemove,
00231   onmouseout,
00232   onmouseover,
00233   onmouseup,
00234   onreset,
00235   onselect,
00236   onsubmit,
00237   onunload,
00238   profile,
00239   prompt,
00240   readonly,
00241   rel,
00242   rev,
00243   rows,
00244   rowspan,
00245   rules,
00246   scheme,
00247   scope,
00248   scrolling,
00249   selected,
00250   shape,
00251   size,
00252   space,
00253   src,
00254   standby,
00255   start,
00256   summary,
00257   tabindex,
00258   target,
00259   text,
00260   type,
00261   usemap,
00262   valign,
00263   value,
00264   valuetype,
00265   vlink,
00266   vspace,
00267   width,
00268 
00269   // attribute values
00270   above,
00271   all,
00272   aqua,
00273   auto_,
00274   baseline,
00275   below,
00276   black,
00277   blue,
00278   bottom,
00279   box,
00280   checkbox,
00281   circle,
00282   default_,
00283   disc,
00284   fuchsia,
00285   get,
00286   gray,
00287   green,
00288   groups,
00289   hsides,
00290   justify,
00291   left,
00292   lhs,
00293   lime,
00294   ltr,
00295   maroon,
00296   middle,
00297   navy,
00298   no,
00299   none,
00300   numbered,
00301   olive,
00302   password,
00303   poly,
00304   post,
00305   preserve,
00306   purple,
00307   rect,
00308   red,
00309   ref,
00310   reset,
00311   rhs,
00312   right,
00313   row,
00314   rowgroup,
00315   rtl,
00316   silver,
00317   square,
00318   submit,
00319   teal,
00320   top,
00321   void_,
00322   vsides,
00323   white,
00324   yellow,
00325   yes,
00326 
00327   LAST_TOKEN
00328 };
00329 
00330 BOOST_STATIC_ASSERT(EBOOKToken<EBOOKHTMLParser>::LAST_TOKEN >= LAST_TOKEN);
00331 
00332 enum Namespace
00333 {
00334   NS_html = html << 16,
00335   NS_xlink = xlink << 16,
00336   NS_xml = xml << 16,
00337   NS_xmlns = xmlns << 16
00338 };
00339 
00340 }
00341 
00342 int getHTMLTokenId(const char *name, const char *ns = 0);
00343 int getHTMLTokenId(const char *name, std::size_t nameLen, const char *ns, std::size_t nsLen);
00344 int getHTMLTokenId(const char *name, std::size_t nameLen);
00345 
00346 }
00347 
00348 #endif // EBOOKHTMLTOKEN_H_INCLUDED
00349 
00350 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */