HTMLAtomicElement.h
Go to the documentation of this file.
1/* -*-mode:c++; c-file-style: "gnu";-*- */
2/*
3 * $Id: HTMLAtomicElement.h,v 1.7 2007/07/02 18:48:18 sebdiaz Exp $
4 *
5 * Copyright (C) 1996 - 2004 Stephen F. Booth <sbooth@gnu.org>
6 * 2007 Sebastien DIAZ <sebastien.diaz@gmail.com>
7 * Part of the GNU cgicc library, http://www.gnu.org/software/cgicc
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 3 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
22 */
23
24#ifndef _HTMLATOMICELEMENT_H_
25#define _HTMLATOMICELEMENT_H_ 1
26
32#include <new>
33
34#include "cgicc/HTMLElement.h"
35
36 namespace cgicc {
37
38 // ============================================================
39 // Template for concrete atomic HTML element classes
40 // ============================================================
41
55 template<class Tag>
56 class HTMLAtomicElement : public HTMLElement
57 {
58 public:
59
60 // ============================================================
61
64
69 HTMLAtomicElement()
70 : HTMLElement(0, 0, 0, eAtomic)
71 {}
72
78 HTMLAtomicElement(const HTMLAttributeList& attributes)
79 : HTMLElement(&attributes, 0, 0, eAtomic)
80 {}
81
82
87 virtual ~HTMLAtomicElement()
88 {}
90
96 virtual inline HTMLElement*
97 clone() const
98 { return new HTMLAtomicElement<Tag>(*this); }
99
100
107 virtual inline const char*
108 getName() const
109 { return Tag::getName(); }
110 };
111
112} // namespace cgicc
113
114#endif /* ! _HTMLATOMICELEMENT_H_ */
HTMLElement.h
Class dealing with HTML elements.
cgicc::HTMLAtomicElement
Template for concrete atomic HTMLElement subclasses.
Definition: HTMLAtomicElement.h:57
cgicc::HTMLAtomicElement::~HTMLAtomicElement
virtual ~HTMLAtomicElement()
Destructor.
Definition: HTMLAtomicElement.h:87
cgicc::HTMLAtomicElement::HTMLAtomicElement
HTMLAtomicElement()
Create a new empty atomic element.
Definition: HTMLAtomicElement.h:69
cgicc::HTMLAtomicElement::getName
virtual const char * getName() const
Get the name of this element.
Definition: HTMLAtomicElement.h:108
cgicc::HTMLAtomicElement::HTMLAtomicElement
HTMLAtomicElement(const HTMLAttributeList &attributes)
Create a new element, specifying the HTMLAttributes.
Definition: HTMLAtomicElement.h:78
cgicc::HTMLAtomicElement::clone
virtual HTMLElement * clone() const
Clone this element.
Definition: HTMLAtomicElement.h:97
cgicc::HTMLAttributeList
An expandable list of HTMLAttribute objects.
Definition: HTMLAttributeList.h:70
cgicc::HTMLElement
Class representing an HTML element.
Definition: HTMLElement.h:61
cgicc::HTMLElement::eAtomic
@ eAtomic
Definition: HTMLElement.h:73
cgicc
The namespace containing the cgicc library.
Definition: Cgicc.h:52