view src/doctree.hh @ 1214:e9729d5a1416

support multiple classes per doctree node
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sat, 11 Jul 2009 10:54:22 +0200
parents a913df1621ac
children 9225a90ad7dd
line wrap: on
line source
#ifndef __DOCTREE_HH__
#define __DOCTREE_HH__

#include "lout/misc.hh"

class DoctreeNode {
   public:
      int num; // unique ascending id
      int depth;
      int element;
      lout::misc::SimpleVector<char*> *klass;
      const char *pseudo;
      const char *id;
};

/**
 * \brief HTML document tree interface.
 *
 * The Doctree class defines the interface to the parsed HTML document tree
 * as it is used for CSS selector matching.
 * Currently the Doctree can be represented as stack, however to support
 * CSS adjacent siblings or for future JavaScript support it may have to
 * be extended to a real tree.
 */
class Doctree {
   public:
      virtual ~Doctree () {};
      virtual const DoctreeNode *top () = 0;
      virtual const DoctreeNode *parent (const DoctreeNode *node) = 0;
};

#endif