aboutsummaryrefslogtreecommitdiff
path: root/src/styleengine.hh
blob: 94792250202f459d738efd392daa0b17b21ebbfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef __STYLEENGINE_HH__
#define __STYLEENGINE_HH__

#include "dw/core.hh"
#include "doctree.hh"

class StyleEngine : public Doctree {
   private:
      class Node : public DoctreeNode {
         public:
            dw::core::style::Style *style;


      };

      lout::misc::SimpleVector <Node> *stack;

   public:
      StyleEngine ();
      ~StyleEngine ();
   
      /* Doctree interface */
      const DoctreeNode *top () {
         return stack->getRef (stack->size () - 1);
      };
      const DoctreeNode *parent (const DoctreeNode *n) {
         if (n->depth > 0)
            return stack->getRef (n->depth - 1);
         else
            return NULL;
      };

      void startElement (int tag, const char *id, const char *klass, const char *style);
      void endElement (int tag);

      inline dw::core::style::Style *style () {
         return stack->getRef (stack->size () - 1)->style;
      };
};

#endif