include/HTMLRenderer/BoxHierarchy.hpp

Go to the documentation of this file.
00001 #ifndef hpp_CPP_BoxHierarchy_CPP_hpp
00002 #define hpp_CPP_BoxHierarchy_CPP_hpp
00003 
00004 // We need DOM declaration, as we will render a DOM
00005 #include "../HTMLParser/DOM.hpp"
00006 // We need container classes (to be confirmed if it is really needed)
00007 #include "../Containers/Container.hpp"
00008 // We need CSS units for the box model
00009 #include "../CSS/CSSUnit.hpp"
00010 
00011 namespace Tests
00012 {
00013     struct RendererTest;
00014 }
00015 
00016 namespace HTML
00017 {
00019     namespace Renderer
00020     {
00021         // Forward declare the mapper class
00022         class Mapper;
00023 
00034         class BoxHierarchy
00035         {
00036         public:
00038             typedef DOM::DOMString  String;
00039 
00040             // Members
00041         private:
00043             const BoxHierarchy    *   parent;
00045             const BoxHierarchy    *   previous; 
00046             // The current hierarchy information 
00048             HTML::GenericElement::ElementID     tagType;
00050             String                              IDAttribute;
00052             String                              ClassAttribute;
00053 
00055             mutable const BoxHierarchy    *   child;
00057             mutable const BoxHierarchy    *   next; 
00058 
00060             const DOM::Element *       element;
00061 
00062             // Interface
00063         public:
00070             BoxHierarchy * enterChild(Mapper & mapper, const HTML::GenericElement::ElementID tagID, const String & ID = String(), const String & Class = String()) const;
00071 
00078             BoxHierarchy * nextChild(Mapper & mapper, const HTML::GenericElement::ElementID tagID, const String & ID = String(), const String & Class = String()) const;
00079 
00082             inline const DOM::Element * getElement() const { return element; }
00083 
00087             inline bool isTaggedAs(const HTML::GenericElement::ElementID tagID) const { return tagType == tagID; }
00088 
00089             // Member access
00090         public:
00092             friend class Mapper;
00094             friend struct ::Tests::RendererTest;
00095 
00096             // Construction and destruction
00097         public:
00099             BoxHierarchy(const HTML::GenericElement::ElementID tagID, const String & ID = String(), const String & Class = String()) : tagType(tagID), IDAttribute(ID), ClassAttribute(Class), parent(0), previous(0), child(0), next(0), element(0) {}
00100         };
00101     }
00102 }
00103 
00104 #endif

(C) An X-Ryl669 project 2007

This document describes Unlimited Zooming Interface source code. UZI stands for Unlimited Zooming Interface, and source code license is