NCBI C++ ToolKit
html.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef HTML___HTML__HPP
2 #define HTML___HTML__HPP
3 
4 /* $Id: html.hpp 77708 2017-05-03 12:47:52Z ivanov $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Lewis Geer, Eugene Vasilchenko, Vladimir Ivanov
30  *
31  */
32 
33 /// @file html.hpp
34 /// HTML classes.
35 ///
36 /// Defines classes to generate HTML code.
37 
38 
39 #include <corelib/ncbiobj.hpp>
40 #include <html/node.hpp>
41 #include <html/htmlhelper.hpp>
42 
43 
44 /** @addtogroup HTMLcomp
45  *
46  * @{
47  */
48 
49 
51 
52 
53 /// Macro for declare html elements.
54 #define CHTML_NAME(Tag) NCBI_NAME2(CHTML_, Tag)
55 
56 
57 #define DECLARE_HTML_ELEMENT_CONSTRUCTORS(Tag, Parent) \
58  CHTML_NAME(Tag)(void) \
59  : CParent(sm_TagName) \
60  { } \
61  CHTML_NAME(Tag)(const char* text) \
62  : CParent(sm_TagName, text) \
63  { } \
64  CHTML_NAME(Tag)(const string& text) \
65  : CParent(sm_TagName, text) \
66  { } \
67  CHTML_NAME(Tag)(CNCBINode* node) \
68  : CParent(sm_TagName, node) \
69  { } \
70  ~CHTML_NAME(Tag)(void)
71 
72 
73 #define DECLARE_HTML_ELEMENT_CONSTRUCTORS_WITH_INIT(Tag, Parent) \
74  CHTML_NAME(Tag)(void) \
75  : CParent(sm_TagName) \
76  { Init(); } \
77  CHTML_NAME(Tag)(const char* text) \
78  : CParent(sm_TagName, text) \
79  { Init(); } \
80  CHTML_NAME(Tag)(const string& text) \
81  : CParent(sm_TagName, text) \
82  { Init(); } \
83  CHTML_NAME(Tag)(CNCBINode* node) \
84  : CParent(sm_TagName, node) \
85  { Init(); } \
86  ~CHTML_NAME(Tag)(void)
87 
88 
89 #define DECLARE_HTML_ELEMENT_TYPES(Parent) \
90  typedef Parent CParent; \
91  static const char sm_TagName[]
92 
93 
94 #define DECLARE_HTML_ELEMENT_COMMON(Tag, Parent) \
95  DECLARE_HTML_ELEMENT_TYPES(Parent); \
96 public: \
97  DECLARE_HTML_ELEMENT_CONSTRUCTORS(Tag, Parent)
98 
99 
100 #define DECLARE_HTML_ELEMENT_COMMON_WITH_INIT(Tag, Parent) \
101  DECLARE_HTML_ELEMENT_TYPES(Parent); \
102 public: \
103  DECLARE_HTML_ELEMENT_CONSTRUCTORS_WITH_INIT(Tag, Parent)
104 
105 
106 #define DECLARE_HTML_ELEMENT(Tag, Parent) \
107 class NCBI_XHTML_EXPORT CHTML_NAME(Tag) : public Parent \
108 { \
109  DECLARE_HTML_ELEMENT_COMMON(Tag, Parent); \
110 }
111 
112 
113 // Macro for declare special chars.
114 
115 #define DECLARE_HTML_SPECIAL_CHAR(Tag, plain) \
116 class NCBI_XHTML_EXPORT CHTML_NAME(Tag) : public CHTMLSpecialChar \
117 { \
118  typedef CHTMLSpecialChar CParent; \
119 public: \
120  CHTML_NAME(Tag)(int count = 1) \
121  : CParent(#Tag, plain, count) \
122  { } \
123  ~CHTML_NAME(Tag)(void) { }; \
124 }
125 
126 
127 // Event tag handler type.
128 //
129 // NOTE: Availability of realization event-handlers for some tags
130 // stand on from browser's type! Set of event-handlers for tags can
131 // fluctuate in different browsers.
132 
134  // work with next HTML-tags (tag's group):
135  eHTML_EH_Blur, // select, text, textarea
136  eHTML_EH_Change, // select, text, textarea
137  eHTML_EH_Click, // button, checkbox, radio, link, reset, submit
139  eHTML_EH_Focus, // select, text, textarea
140  eHTML_EH_Load, // body, frameset
141  eHTML_EH_Unload, // body, frameset
147  eHTML_EH_Select, // text, textarea
148  eHTML_EH_Submit, // form
151  eHTML_EH_KeyUp //
152 };
153 
154 
155 // Base class for html node.
157 {
159 public:
160  CHTMLNode(void)
161  { }
162  CHTMLNode(const char* tagname)
163  : CParent(tagname)
164  { }
165  CHTMLNode(const char* tagname, const char* text)
166  : CParent(tagname)
167  {
168  AppendPlainText(text);
169  }
170  CHTMLNode(const char* tagname, const string& text)
171  : CParent(tagname)
172  {
173  AppendPlainText(text);
174  }
175  CHTMLNode(const char* tagname, CNCBINode* node)
176  : CParent(tagname)
177  {
178  AppendChild(node);
179  }
180  CHTMLNode(const string& tagname)
181  : CParent(tagname)
182  { }
183  CHTMLNode(const string& tagname, const char* text)
184  : CParent(tagname)
185  {
186  AppendPlainText(text);
187  }
188  CHTMLNode(const string& tagname, const string& text)
189  : CParent(tagname)
190  {
191  AppendPlainText(text);
192  }
193  CHTMLNode(const string& tagname, CNCBINode* node)
194  : CParent(tagname)
195  {
196  AppendChild(node);
197  }
198  ~CHTMLNode(void);
199 
200  // Convenient way to set some common attributes.
201  CHTMLNode* SetClass(const string& class_name);
202  CHTMLNode* SetStyle(const string& style);
203  CHTMLNode* SetId(const string& id);
204  CHTMLNode* SetWidth(int width);
205  CHTMLNode* SetWidth(const string& width);
206  CHTMLNode* SetHeight(int height);
207  CHTMLNode* SetHeight(const string& width);
209  CHTMLNode* SetAlign(const string& align);
210  CHTMLNode* SetVAlign(const string& align);
211  CHTMLNode* SetBgColor(const string& color);
212  CHTMLNode* SetColor(const string& color);
213  CHTMLNode* SetNameAttribute(const string& name);
214  const string& GetNameAttribute(void) const;
215  CHTMLNode* SetTitle(const string& title);
217 
218  // Convenient way to add CHTMLPlainText or CHTMLText.
219  CHTMLNode* AppendPlainText(const char* text, bool noEncode = false);
220  CHTMLNode* AppendPlainText(const string& text, bool noEncode = false);
221  CHTMLNode* AppendHTMLText (const char* text);
222  CHTMLNode* AppendHTMLText (const string& text);
223 
224  // Get event handler name.
225  string GetEventHandlerName(const EHTML_EH_Attribute event) const;
226  // Set tag event handler.
227  void SetEventHandler(const EHTML_EH_Attribute event, const string& value);
228 };
229 
230 
231 // <@XXX@> mapping node.
233 {
235 public:
236  CHTMLTagNode(const char* tag);
237  CHTMLTagNode(const string& tag);
238  ~CHTMLTagNode(void);
239 
241 };
242 
243 
244 // Dual print node.
246 {
248 public:
249  CHTMLDualNode(const char* html, const char* plain);
250  CHTMLDualNode(CNCBINode* child, const char* plain);
251  ~CHTMLDualNode(void);
252 
254 
255 protected:
256  string m_Plain;
257 };
258 
259 
260 // A text node that contains plain text.
262 {
264 public:
265  enum EEncodeMode {
266  eNoEncode = 0, ///< Do not encode prior to printing
267  eHTMLEncode = 1 << 0, ///< Encode for HTML output
268  eJSONEncode = 1 << 1, ///< Encode for JSON output
269  };
270 
271  CHTMLPlainText(EEncodeMode encode_mode, const string& text);
272  CHTMLPlainText(const char* text, bool noEncode = false);
273  CHTMLPlainText(const string& text, bool noEncode = false);
274  ~CHTMLPlainText(void);
275 
276  const string& GetText(void) const;
277  void SetText(const string& text);
278 
279  bool NoEncode(void) const
280  {
281  return m_EncodeMode == eHTMLEncode;
282  }
283  void SetNoEncode(bool noEncode = true)
284  {
285  m_EncodeMode = noEncode ? eNoEncode : eHTMLEncode;
286  }
287  void SetEncodeMode(EEncodeMode encode_mode)
288  {
289  m_EncodeMode = encode_mode;
290  }
292  {
293  return m_EncodeMode;
294  }
295 
296  virtual CNcbiOstream& PrintBegin(CNcbiOstream& out, TMode mode);
297 
298 private:
299  string m_Text;
301 };
302 
303 
304 // A text node that contains html text with tags and possibly <@TAG@>.
306 {
308 
309 public:
310  /// Conversions to make before printing out the stored text.
311  ///
312  /// NOTE: fDisableBuffering flag can slightly improve output speed,
313  /// but it disables some functionality. In particular, tag mapping
314  /// doesn't work in ePlainText mode, and tag stripping works incorrectly
315  /// if other HTML/XML or similar tags present inside HTML tags.
316  /// By default, this flag is enabled for compatibility with old code
317  /// that uses the CHTMLText class.
318  enum EFlags {
319  fStripHtmlMode = 1 << 1, ///< Strip text in html mode
320  fStripTextMode = 1 << 2, ///< Strip text in plain text mode
321  fStrip = fStripHtmlMode | fStripTextMode,
322  fNoStrip = 0,
323  fEncodeHtmlMode = 1 << 3, ///< Encode text in html mode
324  fEncodeTextMode = 1 << 4, ///< Encode text in plain text mode
325  fEncode = fEncodeHtmlMode | fEncodeTextMode,
326  fNoEncode = 0,
327  fEnableBuffering = 0, ///< Enable printout buffering
328  fDisableBuffering = 1 << 5, ///< Disable printout buffering
329 
330  // Presets
331  fCode = fStripTextMode | fNoEncode,
332  fCodeCompatible = fStripTextMode | fNoEncode | fDisableBuffering,
333  fExample = fNoStrip | fEncodeHtmlMode,
334  fDefault = fCodeCompatible ///< Default value
335  };
336  typedef int TFlags; ///< Bitwise OR of "EFlags"
337 
338  CHTMLText(const char* text, TFlags flags = fDefault);
339  CHTMLText(const string& text, TFlags flags = fDefault);
340  ~CHTMLText(void);
341 
342  const string& GetText(void) const;
343  void SetText(const string& text);
344 
346 
347 protected:
348  // Print HTML string (with encoding/stripping HTML entities)
349  CNcbiOstream& PrintString(CNcbiOstream& out, TMode mode,
350  const string& s) const;
351 private:
352  string m_Text;
354 };
355 
356 
357 // HTML tag base class.
359 {
361 public:
362  CHTMLOpenElement(const char* tagname)
363  : CParent(tagname)
364  { }
365  CHTMLOpenElement(const char* tagname, const char* text)
366  : CParent(tagname, text)
367  { }
368  CHTMLOpenElement(const char* tagname, const string& text)
369  : CParent(tagname, text)
370  { }
371  CHTMLOpenElement(const char* tagname, CNCBINode* node)
372  : CParent(tagname, node)
373  { }
374  CHTMLOpenElement(const string& tagname)
375  : CParent(tagname)
376  { }
377  CHTMLOpenElement(const string& tagname, const char* text)
378  : CParent(tagname, text)
379  { }
380  CHTMLOpenElement(const string& tagname, const string& text)
381  : CParent(tagname, text)
382  { }
383  CHTMLOpenElement(const string& tagname, CNCBINode* node)
384  : CParent(tagname, node)
385  { }
386  ~CHTMLOpenElement(void);
387 
388  // Print tag itself.
389  virtual CNcbiOstream& PrintBegin(CNcbiOstream &, TMode mode);
390 
391  // Set NOWRAP attribute
392  void SetNoWrap(void)
393  { SetAttribute("nowrap"); }
394 
395 protected:
396  CNcbiOstream& x_PrintBegin(CNcbiOstream &, TMode mode);
397 };
398 
399 
400 // HTML single tag (without closing tag)
402 {
404 public:
405  CHTMLSingleElement(const char* tagname)
406  : CParent(tagname)
407  { }
408  CHTMLSingleElement(const char* tagname, const char* text)
409  : CParent(tagname, text)
410  { }
411  CHTMLSingleElement(const char* tagname, const string& text)
412  : CParent(tagname, text)
413  { }
414  CHTMLSingleElement(const char* tagname, CNCBINode* node)
415  : CParent(tagname, node)
416  { }
417  CHTMLSingleElement(const string& tagname)
418  : CParent(tagname)
419  { }
420  CHTMLSingleElement(const string& tagname, const char* text)
421  : CParent(tagname, text)
422  { }
423  CHTMLSingleElement(const string& tagname, const string& text)
424  : CParent(tagname, text)
425  { }
426  CHTMLSingleElement(const string& tagname, CNCBINode* node)
427  : CParent(tagname, node)
428  { }
429  ~CHTMLSingleElement(void);
430 
431  // Print tag itself.
432  virtual CNcbiOstream& PrintBegin(CNcbiOstream &, TMode mode);
433 };
434 
435 
436 // HTML inline tag
438 {
440 public:
441  CHTMLInlineElement(const char* tagname)
442  : CParent(tagname)
443  { }
444  CHTMLInlineElement(const char* tagname, const char* text)
445  : CParent(tagname, text)
446  { }
447  CHTMLInlineElement(const char* tagname, const string& text)
448  : CParent(tagname, text)
449  { }
450  CHTMLInlineElement(const char* tagname, CNCBINode* node)
451  : CParent(tagname, node)
452  { }
453  CHTMLInlineElement(const string& tagname)
454  : CParent(tagname)
455  { }
456  CHTMLInlineElement(const string& tagname, const char* text)
457  : CParent(tagname, text)
458  { }
459  CHTMLInlineElement(const string& tagname, const string& text)
460  : CParent(tagname, text)
461  { }
462  CHTMLInlineElement(const string& tagname, CNCBINode* node)
463  : CParent(tagname, node)
464  { }
465  ~CHTMLInlineElement(void);
466 
467  // Print tag close.
468  virtual CNcbiOstream& PrintEnd(CNcbiOstream &, TMode mode);
469 };
470 
471 
472 // HTML tag
474 {
476 public:
477  CHTMLElement(const char* tagname)
478  : CParent(tagname)
479  { }
480  CHTMLElement(const char* tagname, const char* text)
481  : CParent(tagname, text)
482  { }
483  CHTMLElement(const char* tagname, const string& text)
484  : CParent(tagname, text)
485  { }
486  CHTMLElement(const char* tagname, CNCBINode* node)
487  : CParent(tagname, node)
488  { }
489  CHTMLElement(const string& tagname)
490  : CParent(tagname)
491  { }
492  CHTMLElement(const string& tagname, const char* text)
493  : CParent(tagname, text)
494  { }
495  CHTMLElement(const string& tagname, const string& text)
496  : CParent(tagname, text)
497  { }
498  CHTMLElement(const string& tagname, CNCBINode* node)
499  : CParent(tagname, node)
500  { }
501  ~CHTMLElement(void);
502 
503  // Print tag close.
504  virtual CNcbiOstream& PrintEnd(CNcbiOstream &, TMode mode);
505 };
506 
507 
508 // HTML block element.
510 {
512 public:
513  CHTMLBlockElement(const char* tagname)
514  : CParent(tagname)
515  { }
516  CHTMLBlockElement(const char* tagname, const char* text)
517  : CParent(tagname, text)
518  { }
519  CHTMLBlockElement(const char* tagname, const string& text)
520  : CParent(tagname, text)
521  { }
522  CHTMLBlockElement(const char* tagname, CNCBINode* node)
523  : CParent(tagname, node)
524  { }
525  CHTMLBlockElement(const string& tagname)
526  : CParent(tagname)
527  { }
528  CHTMLBlockElement(const string& tagname, const char* text)
529  : CParent(tagname, text)
530  { }
531  CHTMLBlockElement(const string& tagname, const string& text)
532  : CParent(tagname, text)
533  { }
534  CHTMLBlockElement(const string& tagname, CNCBINode* node)
535  : CParent(tagname, node)
536  { }
537  ~CHTMLBlockElement(void);
538 
539  // Close tag.
540  virtual CNcbiOstream& PrintEnd(CNcbiOstream &, TMode mode);
541 };
542 
543 
544 // HTML comment.
545 
547 {
549  static const char sm_TagName[];
550 public:
552  : CParent(sm_TagName)
553  { }
554  CHTMLComment(const char* text)
555  : CParent(sm_TagName)
556  {
557  AppendPlainText(text);
558  }
559  CHTMLComment(const string& text)
560  : CParent(sm_TagName)
561  {
562  AppendPlainText(text);
563  }
565  : CParent(sm_TagName)
566  {
567  AppendChild(node);
568  }
569  ~CHTMLComment(void);
570 
571  virtual CNcbiOstream& Print(CNcbiOstream& out, TMode mode = eHTML);
572  virtual CNcbiOstream& PrintBegin(CNcbiOstream &, TMode mode);
573  virtual CNcbiOstream& PrintEnd(CNcbiOstream &, TMode mode);
574 };
575 
576 
577 // <list> tag.
579 {
581 public:
582  CHTMLListElement(const char* tagname, bool compact = false)
583  : CParent(tagname)
584  {
585  if ( compact ) {
586  SetCompact();
587  }
588  }
589  CHTMLListElement(const char* tagname, const char* type,
590  bool compact = false)
591  : CParent(tagname)
592  {
593  SetType(type);
594  if ( compact ) {
595  SetCompact();
596  }
597  }
598  CHTMLListElement(const char* tagname, const string& type,
599  bool compact = false)
600  : CParent(tagname)
601  {
602  SetType(type);
603  if ( compact ) {
604  SetCompact();
605  }
606  }
607  ~CHTMLListElement(void);
608 
612 
613  CHTMLListElement* SetType(const char* type);
614  CHTMLListElement* SetType(const string& type);
615  CHTMLListElement* SetCompact(void);
616 
618 };
619 
620 
621 // HTML special char.
623 {
625 public:
626  // The "html" argument will be automagically wrapped into '&...;',
627  // e.g. 'amp' --> '&amp;'
628  CHTMLSpecialChar(const char* html, const char* plain, int count = 1);
629  ~CHTMLSpecialChar(void);
630 
632 private:
633  string m_Html;
634  int m_Count;
635 };
636 
637 
638 // <html> tag
640 {
641  // CParent, constructors, destructor.
643 private:
644  // Init members.
645  void Init(void);
646 };
647 
648 
649 
650 // Table classes.
651 
652 class CHTML_table; // Table
653 class CHTML_tr; // Row
654 class CHTML_tc; // Any cell
655 class CHTML_th; // Header cell
656 class CHTML_td; // Data cell
657 class CHTML_tc_Cache;
658 class CHTML_tr_Cache;
659 class CHTML_table_Cache;
660 
661 
663 {
665 public:
666  typedef unsigned TIndex;
667  CHTML_tc(const char* tagname)
668  : CParent(tagname), m_Parent(0)
669  { }
670  CHTML_tc(const char* tagname, const char* text)
671  : CParent(tagname, text), m_Parent(0)
672  { }
673  CHTML_tc(const char* tagname, const string& text)
674  : CParent(tagname, text), m_Parent(0)
675  { }
676  CHTML_tc(const char* tagname, CNCBINode* node)
677  : CParent(tagname, node), m_Parent(0)
678  { }
679  ~CHTML_tc(void);
680 
681  // Type for row and column indexing.
682  CHTML_tc* SetRowSpan(TIndex span);
683  CHTML_tc* SetColSpan(TIndex span);
684 
685  void ResetTableCache(void);
686 
687 protected:
688  virtual void DoSetAttribute(const string& name,
689  const string& value, bool optional);
690  friend class CHTML_tr;
691  friend class CHTML_tc_Cache;
692 
694 };
695 
696 
698 {
700 public:
701  typedef unsigned TIndex;
702 
703  CHTML_tr(void);
704  CHTML_tr(CNCBINode* node);
705  CHTML_tr(const string& text);
706 
707  void ResetTableCache(void);
708 
711 
712 protected:
713  virtual void DoAppendChild(CNCBINode* node);
714  void AppendCell(CHTML_tc* cell);
715  size_t GetTextLength(TMode mode);
716 
717  friend class CHTML_table;
718  friend class CHTML_tr_Cache;
719 
721 };
722 
723 
724 // <table> tag.
725 
727 {
729 public:
730  // Type for row and column indexing.
731  typedef unsigned TIndex;
732  enum ECellType {
735  eHeaderCell
736  };
737 
738  CHTML_table(void);
739  ~CHTML_table(void);
740 
741  // Return row, will add rows if needed.
742  // Throws exception if it is not left upper corner of cell.
743  CHTML_tr* Row(TIndex row);
744 
745  // Get/set current insertion point.
747  { m_CurrentRow = row; m_CurrentCol = col; }
748  TIndex GetCurrentRow(void) const
749  { return (m_CurrentRow == TIndex(-1)) ? 0 : m_CurrentRow; }
750  TIndex GetCurrentCol(void) const
751  { return (m_CurrentCol == TIndex(-1)) ? 0 : m_CurrentCol; }
752 
753  class CTableInfo;
754 
755  // Return cell, will add rows/columns if needed.
756  // Throws exception if it is not left upper corner of cell
757  // also sets current insertion point.
758  CHTML_tc* Cell(TIndex row, TIndex column, ECellType type = eAnyCell);
759  CHTML_tc* Cell(TIndex row, TIndex column, ECellType type,
760  TIndex rowSpan, TIndex colSpan);
762  { return Cell(row, column, eHeaderCell); }
764  { return Cell(row, column, eDataCell); }
765 
768  { return NextCell(eHeaderCell); }
770  { return NextCell(eDataCell); }
771 
774  { return NextRowCell(eHeaderCell); }
776  { return NextRowCell(eDataCell); }
777 
778  // Check table contents for validaty, throws exception if invalid.
779  void CheckTable(void) const;
780  // Return width of table in columns. Should call CheckTable before.
781  TIndex CalculateNumberOfColumns(void) const;
782  TIndex CalculateNumberOfRows(void) const;
783 
784  // Return cell of insertion.
788 
790  CHTML_tc* InsertNextCell(const string& text);
791 
793  CHTML_tc* InsertNextRowCell(const string& text);
794 
797 
799  CHTML_table* SetColumnWidth(TIndex column, const string& width);
800 
801  void ResetTableCache(void);
802 
804 
805  // If to print horizontal row separator (affects ePlainText mode only).
807  ePrintRowSep, // print
808  eSkipRowSep // do not print
809  };
810  // Set rows and cols separators (affects ePlainText mode only).
811  void SetPlainSeparators(const string& col_left = kEmptyStr,
812  const string& col_middle = " ",
813  const string& col_right = kEmptyStr,
814  const char row_sep_char = '-',
815  ERowPlainSep is_row_sep = eSkipRowSep);
816 
817 protected:
818  TIndex m_CurrentRow, m_CurrentCol;
819  mutable unique_ptr<CHTML_table_Cache> m_Cache;
820  CHTML_table_Cache& GetCache(void) const;
821  friend class CHTML_table_Cache;
822  friend class CHTML_tr;
823 
824  virtual void DoAppendChild(CNCBINode* node);
825  void AppendRow(CHTML_tr* row);
826 
827  string m_ColSepL, m_ColSepM, m_ColSepR;
830 
833 };
834 
835 
837 {
838 public:
840  : m_Used(false), m_Node(0)
841  {
842  return;
843  }
844 
845  bool IsUsed(void) const
846  {
847  return m_Used;
848  }
849 
850  bool IsNode(void) const
851  {
852  return m_Node != 0;
853  }
854  CHTML_tc* GetCellNode(void) const
855  {
856  return m_Node;
857  }
858 
859  void SetUsed(void);
860  void SetCellNode(CHTML_tc* node);
861 
862 private:
863  bool m_Used;
865 };
866 
867 
869 {
870 public:
872 
874  : m_Node(0),
875  m_CellCount(0), m_CellsSize(0), m_Cells(0), m_FilledCellCount(0)
876  {
877  return;
878  }
879 
881  {
882  delete[] m_Cells;
883  }
884 
885  CHTML_tr* GetRowNode(void) const
886  {
887  return m_Node;
888  }
889 
890  void SetRowNode(CHTML_tr* rowNode)
891  {
892  _ASSERT(!m_Node && rowNode);
893  m_Node = rowNode;
894  }
895 
896  TIndex GetCellCount(void) const
897  {
898  return m_CellCount;
899  }
900 
901  CHTML_tc_Cache& GetCellCache(TIndex col);
902 
903  void AppendCell(CHTML_tr* rowNode, TIndex col,
904  CHTML_tc* cellNode, TIndex colSpan);
905  void SetUsedCells(TIndex colBegin, TIndex colEnd);
906  void SetUsedCells(CHTML_tc* cellNode, TIndex colBegin, TIndex colEnd);
907 
908 private:
911 
917 };
918 
919 
921 {
922 public:
924 
926  ~CHTML_table_Cache(void);
927 
928  TIndex GetRowCount(void) const
929  {
930  return m_RowCount;
931  }
932 
933  CHTML_tr_Cache& GetRowCache(TIndex row);
934  CHTML_tr* GetRowNode(TIndex row);
935  CHTML_tc* GetCellNode(TIndex row, TIndex col,
937  CHTML_tc* GetCellNode(TIndex row, TIndex col,
939  TIndex rowSpan, TIndex colSpan);
940 
941  void InitRow(TIndex row, CHTML_tr* rowNode);
942  void SetUsedCells(TIndex rowBegin, TIndex rowEnd,
943  TIndex colBegin, TIndex colEnd);
944 private:
950 
953 };
954 
955 
956 // <form> tag
958 {
960 public:
961  enum EMethod {
964  ePostData
965  };
966 
967  CHTML_form(void);
968  CHTML_form(const string& url, EMethod method = eGet);
969  CHTML_form(const string& url, CNCBINode* node, EMethod method = eGet);
970  ~CHTML_form(void);
971 
972  void Init(const string& url, EMethod method = eGet);
973 
974  void AddHidden(const string& name, const string& value);
975  void AddHidden(const string& name, int value);
976 };
977 
978 
979 // <legend> tag.
981 {
983 public:
984  CHTML_legend(const string& legend);
985  CHTML_legend(CHTMLNode* legend);
986  ~CHTML_legend(void);
987 };
988 
989 
990 // <fieldset> tag.
992 {
994 public:
995  CHTML_fieldset(void);
996  CHTML_fieldset(const string& legend);
997  CHTML_fieldset(CHTML_legend* legend);
998  ~CHTML_fieldset(void);
999 };
1000 
1001 
1002 // <label> tag.
1004 {
1006 public:
1007  CHTML_label(const string& text);
1008  CHTML_label(const string& text, const string& idRef);
1009  ~CHTML_label(void);
1010 
1011  void SetFor(const string& idRef);
1012 };
1013 
1014 
1015 // <textarea> tag.
1017 {
1019 public:
1020  CHTML_textarea(const string& name, int cols, int rows);
1021  CHTML_textarea(const string& name, int cols, int rows,
1022  const string& value);
1023  ~CHTML_textarea(void);
1024 };
1025 
1026 
1027 // <input> tag.
1029 {
1031 public:
1032  CHTML_input(const char* type, const string& name = kEmptyStr);
1033  ~CHTML_input(void);
1034 };
1035 
1036 
1037 // <input type=checkbox> tag.
1039 {
1041  static const char sm_InputType[];
1042 public:
1043  CHTML_checkbox(const string& name);
1044  CHTML_checkbox(const string& name, bool checked,
1045  const string& description = kEmptyStr);
1046  CHTML_checkbox(const string& name, const string& value);
1047  CHTML_checkbox(const string& name, const string& value,
1048  bool checked, const string& description = kEmptyStr);
1049  ~CHTML_checkbox(void);
1050 };
1051 
1052 
1053 // <input type=hidden> tag.
1055 {
1057  static const char sm_InputType[];
1058 public:
1059  CHTML_hidden(const string& name, const string& value);
1060  CHTML_hidden(const string& name, int value);
1061  ~CHTML_hidden(void);
1062 };
1063 
1064 
1065 // <input type=image> tag.
1067 {
1069  static const char sm_InputType[];
1070 public:
1071  CHTML_image(const string& name, const string& src,
1072  const string& alt = kEmptyStr);
1073  CHTML_image(const string& name, const string& src, int border,
1074  const string& alt = kEmptyStr);
1075  ~CHTML_image(void);
1076 };
1077 
1078 
1079 // <input type=password> tag.
1081 {
1083  static const char sm_InputType[];
1084 public:
1085  CHTML_password(const string& name,
1086  const string& value = kEmptyStr);
1087  CHTML_password(const string& name, int size,
1088  const string& value = kEmptyStr);
1089  CHTML_password(const string& name, int size, int maxlength,
1090  const string& value = kEmptyStr);
1091  ~CHTML_password(void);
1092 };
1093 
1094 
1095 // <input type=radio> tag.
1097 {
1099  static const char sm_InputType[];
1100 public:
1101  CHTML_radio(const string& name, const string& value);
1102  CHTML_radio(const string& name, const string& value,
1103  bool checked, const string& description = kEmptyStr);
1104  ~CHTML_radio(void);
1105 };
1106 
1107 
1108 // <input type=reset> tag.
1110 {
1112  static const char sm_InputType[];
1113 public:
1114  CHTML_reset(const string& label = kEmptyStr);
1115  ~CHTML_reset(void);
1116 };
1117 
1118 
1119 // <input type=submit> tag.
1121 {
1123  static const char sm_InputType[];
1124 public:
1125  CHTML_submit(const string& label);
1126  CHTML_submit(const string& name, const string& label);
1127  ~CHTML_submit(void);
1128 };
1129 
1130 
1131 // <input type=button> tag.
1133 {
1135  static const char sm_InputType[];
1136 public:
1137  CHTML_input_button(const string& label);
1138  CHTML_input_button(const string& name, const string& label);
1139  ~CHTML_input_button(void);
1140 };
1141 
1142 
1143 // <input type=text> tag.
1145 {
1147  static const char sm_InputType[];
1148 public:
1149  CHTML_text(const string& name,
1150  const string& value = kEmptyStr);
1151  CHTML_text(const string& name, int size,
1152  const string& value = kEmptyStr);
1153  CHTML_text(const string& name, int size, int maxlength,
1154  const string& value = kEmptyStr);
1155  ~CHTML_text(void);
1156 };
1157 
1158 
1159 // <input type=file> tag.
1161 {
1163  static const char sm_InputType[];
1164 public:
1165  CHTML_file(const string& name, const string& value = kEmptyStr);
1166  ~CHTML_file(void);
1167 };
1168 
1169 
1170 // <button> tag ( added in HTML 4.0)
1172 {
1174  static const char sm_TagName[];
1175 public:
1177  eSubmit, // submits the form
1178  eReset, // reset the form
1179  eButton // doesn't do anything
1180  };
1181 
1182  CHTML_button(const string& text, EButtonType type = eSubmit,
1183  const string& name = kEmptyStr,
1184  const string& value = kEmptyStr);
1185  CHTML_button(CNCBINode* contents, EButtonType type = eSubmit,
1186  const string& name = kEmptyStr,
1187  const string& value = kEmptyStr);
1188  ~CHTML_button(void);
1189 
1190  CHTML_button* SetType(EButtonType type);
1191  CHTML_button* SetSubmitData(const string& name,
1192  const string& value = kEmptyStr);
1193 };
1194 
1195 
1196 // <optgroup> tag. Rarely used alone. See <select> tag.
1198 {
1200  static const char sm_TagName[];
1201 public:
1202  CHTML_optgroup(const string& label, bool disabled = false);
1203  ~CHTML_optgroup(void);
1204 
1205  // Return 'this' to allow chained AppendOption().
1207  bool selected = false, bool disabled =false);
1208  CHTML_optgroup* AppendOption(const string& value, const char* label,
1209  bool selected = false, bool disabled =false);
1210  CHTML_optgroup* AppendOption(const string& value, const string& label,
1211  bool selected = false, bool disabled =false);
1213 };
1214 
1215 
1216 // <option> tag. Rarely used alone. See <select> tag.
1218 {
1220  static const char sm_TagName[];
1221 public:
1222  CHTML_option(const string& value,
1223  bool selected = false, bool disabled = false);
1224  CHTML_option(const string& value, const char* label,
1225  bool selected = false, bool disabled = false);
1226  CHTML_option(const string& value, const string& label,
1227  bool selected = false, bool disabled = false);
1228  ~CHTML_option(void);
1229 
1230  CHTML_option* SetValue(const string& value);
1233 };
1234 
1235 
1236 // <select> tag.
1238 {
1240  static const char sm_TagName[];
1241 public:
1242  CHTML_select(const string& name, bool multiple = false);
1243  CHTML_select(const string& name, int size, bool multiple = false);
1244  ~CHTML_select(void);
1245 
1246  // Return 'this' to allow chained AppendOption().
1248  bool selected = false, bool disabled = false);
1249  CHTML_select* AppendOption(const string& value, const char* label,
1250  bool selected = false, bool disabled = false);
1251  CHTML_select* AppendOption(const string& value, const string& label,
1252  bool selected = false, bool disabled = false);
1255 };
1256 
1257 
1258 // <a> tag.
1260 {
1262  static const char sm_TagName[];
1263 public:
1264  CHTML_a(void);
1265  CHTML_a(const string& href);
1266  CHTML_a(const string& href, const char* text);
1267  CHTML_a(const string& href, const string& text);
1268  CHTML_a(const string& href, CNCBINode* node);
1269  ~CHTML_a(void);
1270 
1271  CHTML_a* SetHref(const string& href);
1272 };
1273 
1274 
1275 // <br> tag (break).
1277 {
1279  static const char sm_TagName[];
1280 public:
1281  CHTML_br(void);
1282  // create "number" of <br> tags
1283  CHTML_br(int number);
1284  ~CHTML_br(void);
1285 
1287 };
1288 
1289 
1290 // <area> tag.
1292 {
1294  static const char sm_TagName[];
1295 public:
1296  // Shape of area region
1297  enum EShape {
1298  eRect, // rectangular region
1299  eCircle, // circular region
1300  ePoly // polygonal region
1301  };
1302 
1303  CHTML_area(void);
1304  CHTML_area(const string& href, int x1, int y1, int x2, int y2,
1305  const string& alt = kEmptyStr);
1306  CHTML_area(const string& href, int x, int y, int radius,
1307  const string& alt = kEmptyStr);
1308  CHTML_area(const string& href, int coords[], int count,
1309  const string& alt = kEmptyStr);
1310  CHTML_area(const string& href, vector<int> coords,
1311  const string& alt = kEmptyStr);
1312  CHTML_area(const string& href, list<int> coords,
1313  const string& alt = kEmptyStr);
1314 
1315  // Destructor
1316  ~CHTML_area(void);
1317 
1318  CHTML_area* SetHref(const string& href);
1319 
1320  // Define a rectangular region
1321  CHTML_area* DefineRect(int x1, int y1, int x2, int y2);
1322  // Define a circular region
1323  CHTML_area* DefineCircle(int x, int y, int radius);
1324  // Define a polygonal region
1325  // Array should contains pairs x1,y1,x2,y2,...
1326  CHTML_area* DefinePolygon(int coords[], int count);
1327  CHTML_area* DefinePolygon(vector<int> coords);
1328  CHTML_area* DefinePolygon(list<int> coords);
1329 };
1330 
1331 
1332 // <map> tag.
1334 {
1336 public:
1337  CHTML_map(const string& name);
1338  ~CHTML_map(void);
1339 
1340  CHTML_map* AddRect (const string& href, int x1, int y1, int x2, int y2,
1341  const string& alt = kEmptyStr);
1342  CHTML_map* AddCircle (const string& href, int x, int y, int radius,
1343  const string& alt = kEmptyStr);
1344  CHTML_map* AddPolygon(const string& href, int coords[], int count,
1345  const string& alt = kEmptyStr);
1346  CHTML_map* AddPolygon(const string& href, vector<int> coords,
1347  const string& alt = kEmptyStr);
1348  CHTML_map* AddPolygon(const string& href, list<int> coords,
1349  const string& alt = kEmptyStr);
1350 
1351  // Add area
1354 };
1355 
1356 
1357 // <img> tag.
1359 {
1361 public:
1362  CHTML_img(const string& url, const string& alt = kEmptyStr);
1363  CHTML_img(const string& url, int width, int height,
1364  const string& alt = kEmptyStr);
1365  ~CHTML_img(void);
1366  void UseMap(const string& mapname);
1367  void UseMap(const CHTML_map* const mapnode);
1368 };
1369 
1370 
1371 // <dl> tag.
1373 {
1375  static const char sm_TagName[];
1376 public:
1377  CHTML_dl(bool compact = false);
1378  ~CHTML_dl(void);
1379 
1380  // Return 'this' to allow chained AppendTerm().
1381  CHTML_dl* AppendTerm(const string& term, CNCBINode* definition = 0);
1382  CHTML_dl* AppendTerm(const string& term, const string& definition);
1383  CHTML_dl* AppendTerm(CNCBINode* term, CNCBINode* definition = 0);
1384  CHTML_dl* AppendTerm(CNCBINode* term, const string& definition);
1385 
1386  CHTML_dl* SetCompact(void);
1387 };
1388 
1389 
1390 // <ol> tag.
1392 {
1394  static const char sm_TagName[];
1395 public:
1396  CHTML_ol(bool compact = false);
1397  CHTML_ol(const char* type, bool compact = false);
1398  CHTML_ol(const string& type, bool compact = false);
1399  CHTML_ol(int start, bool compact = false);
1400  CHTML_ol(int start, const char* type, bool compact = false);
1401  CHTML_ol(int start, const string& type, bool compact = false);
1402  ~CHTML_ol(void);
1403 
1404  CHTML_ol* SetStart(int start);
1405 };
1406 
1407 
1408 // <ul> tag.
1410 {
1412  static const char sm_TagName[];
1413 public:
1414  CHTML_ul(bool compact = false);
1415  CHTML_ul(const char* type, bool compact = false);
1416  CHTML_ul(const string& type, bool compact = false);
1417  ~CHTML_ul(void);
1418 };
1419 
1420 
1421 // <dir> tag.
1423 {
1425  static const char sm_TagName[];
1426 public:
1427  CHTML_dir(bool compact = false);
1428  CHTML_dir(const char* type, bool compact = false);
1429  CHTML_dir(const string& type, bool compact = false);
1430  ~CHTML_dir(void);
1431 };
1432 
1433 
1434 // <menu> tag.
1436 {
1438  static const char sm_TagName[];
1439 public:
1440  CHTML_menu(bool compact = false);
1441  CHTML_menu(const char* type, bool compact = false);
1442  CHTML_menu(const string& type, bool compact = false);
1443  ~CHTML_menu(void);
1444 };
1445 
1446 
1447 // <font> tag.
1449 {
1451  static const char sm_TagName[];
1452 public:
1453  CHTML_font(void);
1455  CNCBINode* node = 0);
1457  const char* text);
1459  const string& text);
1460  CHTML_font(int size, bool absolute,
1461  CNCBINode* node = 0);
1462  CHTML_font(int size, bool absolute,
1463  const string& text);
1464  CHTML_font(int size, bool absolute,
1465  const char* text);
1466  CHTML_font(const string& typeface,
1467  CNCBINode* node = 0);
1468  CHTML_font(const string& typeface,
1469  const string& text);
1470  CHTML_font(const string& typeface,
1471  const char* text);
1472  CHTML_font(const string& typeface, int size,
1473  CNCBINode* node = 0);
1474  CHTML_font(const string& typeface, int size,
1475  const string& text);
1476  CHTML_font(const string& typeface, int size,
1477  const char* text);
1478  CHTML_font(const string& typeface, int size, bool absolute,
1479  CNCBINode* node = 0);
1480  CHTML_font(const string& typeface, int size, bool absolute,
1481  const string& text);
1482  CHTML_font(const string& typeface, int size, bool absolute,
1483  const char* text);
1484  ~CHTML_font(void);
1485 
1486  CHTML_font* SetTypeFace(const string& typeface);
1487  CHTML_font* SetFontSize(int size, bool absolute);
1488  CHTML_font* SetRelativeSize(int size);
1489 };
1490 
1491 
1493 {
1495  static const char sm_TagName[];
1496 public:
1498  CHTML_basefont(const string& typeface);
1499  CHTML_basefont(const string& typeface, int size);
1500  ~CHTML_basefont(void);
1501 
1502  CHTML_basefont* SetTypeFace(const string& typeface);
1503 };
1504 
1505 
1507 {
1509 public:
1510  CHTML_color(const string& color, CNCBINode* node = 0);
1511  CHTML_color(const string& color, const string& text);
1512  ~CHTML_color(void);
1513 };
1514 
1515 
1516 // <hr> tag.
1518 {
1520  static const char sm_TagName[];
1521 public:
1522  CHTML_hr(bool noShade = false);
1523  CHTML_hr(int size, bool noShade = false);
1524  CHTML_hr(int size, int width, bool noShade = false);
1525  CHTML_hr(int size, const string& width, bool noShade = false);
1526  ~CHTML_hr(void);
1527 
1528  CHTML_hr* SetNoShade(void);
1529  CHTML_hr* SetNoShade(bool noShade);
1530 
1532 };
1533 
1534 
1535 // <meta> tag.
1537 {
1539  static const char sm_TagName[];
1540 public:
1541  enum EType {
1543  eHttpEquiv
1544  };
1545  CHTML_meta(EType mtype, const string& var, const string& content);
1546  ~CHTML_meta(void);
1547 };
1548 
1549 
1550 // <scrpt> tag.
1552 {
1554  static const char sm_TagName[];
1555 public:
1556  CHTML_script(const string& stype);
1557  CHTML_script(const string& stype, const string& url);
1558  ~CHTML_script(void);
1559 
1560  CHTML_script* AppendScript(const string& script);
1561 };
1562 
1563 
1564 // Other tags (default implementation).
1565 
1620 
1621 DECLARE_HTML_SPECIAL_CHAR( nbsp, " ");
1624 DECLARE_HTML_SPECIAL_CHAR( quot, "\"");
1625 DECLARE_HTML_SPECIAL_CHAR( amp, "&");
1627 DECLARE_HTML_SPECIAL_CHAR( reg, "(r)");
1628 
1629 
1630 #include <html/html.inl>
1631 
1632 
1634 
1635 
1636 /* @} */
1637 
1638 
1639 #endif /* HTML___HTML__HPP */
struct zzzz Cell
#define head
Definition: ct_nlmzip_i.h:138
static Uint4 border[]
static uch flags
std::ofstream out("events_result.xml")
main entry point for tests
#define false
Definition: bool.h:36
static void Init(void)
Definition: cursor6.c:76
static const char * column
Definition: stats.c:23
CHTML_tc * NextRowDataCell(void)
Definition: html.hpp:775
CHTMLElement(const char *tagname)
Definition: html.hpp:477
CHTML_menu(const char *type, bool compact=false)
CHTML_input CParent
Definition: html.hpp:1098
CHTMLNode * SetHeight(const string &width)
CHTMLInlineElement CParent
Definition: html.hpp:1005
CHTML_table * SetColumnWidth(TIndex column, const string &width)
CHTMLElement CParent
Definition: html.hpp:1199
unsigned TIndex
Definition: html.hpp:731
CHTML_ol(int start, const string &type, bool compact=false)
CHTMLNode * SetStyle(const string &style)
CHTML_optgroup * AppendOption(const string &value, const string &label, bool selected=false, bool disabled=false)
CHTMLComment(const char *text)
Definition: html.hpp:554
CHTML_select * AppendOption(const string &value, const char *label, bool selected=false, bool disabled=false)
CHTMLNode(const char *tagname)
Definition: html.hpp:162
#define DECLARE_HTML_ELEMENT_COMMON_WITH_INIT(Tag, Parent)
Definition: html.hpp:100
CHTML_tc * NextCell(ECellType type=eAnyCell)
CHTMLNode * AppendHTMLText(const string &text)
const string & GetText(void) const
#define DECLARE_HTML_ELEMENT(Tag, Parent)
Definition: html.hpp:106
CHTMLNode * SetId(const string &id)
CHTMLNode(const string &tagname, const string &text)
Definition: html.hpp:188
TIndex GetCurrentRow(void) const
Definition: html.hpp:748
TIndex m_RowCount
Definition: html.hpp:946
bool NoEncode(void) const
Definition: html.hpp:279
CHTML_font(int size, bool absolute, CNCBINode *node=0)
CHTMLSingleElement CParent
Definition: html.hpp:1360
const string & GetText(void) const
CHTML_table * m_Parent
Definition: html.hpp:720
CHTMLNode(const char *tagname, const string &text)
Definition: html.hpp:170
CHTMLElement CParent
Definition: html.hpp:1374
CHTML_tc * InsertNextRowCell(CNCBINode *node)
virtual void DoAppendChild(CNCBINode *child)
Definition: node.cpp:100
bool IsNode(void) const
Definition: html.hpp:850
unsigned TIndex
Definition: html.hpp:666
CHTMLOpenElement(const char *tagname, CNCBINode *node)
Definition: html.hpp:371
CHTML_select(const string &name, int size, bool multiple=false)
CHTML_ol(int start, const char *type, bool compact=false)
CHTML_tc * HeaderCell(TIndex row, TIndex column)
Definition: html.hpp:761
CHTMLNode(const char *tagname, CNCBINode *node)
Definition: html.hpp:175
CHTMLNode(const string &tagname, const char *text)
Definition: html.hpp:183
CHTMLListElement CParent
Definition: html.hpp:1393
CHTMLSingleElement CParent
Definition: html.hpp:1494
CHTMLNode * SetNameAttribute(const string &name)
CHTML_tc * InsertTextAt(TIndex row, TIndex column, const string &text)
CHTMLSingleElement(const char *tagname, const char *text)
Definition: html.hpp:408
#define DECLARE_HTML_SPECIAL_CHAR(Tag, plain)
Definition: html.hpp:115
CHTML_tc * InsertNextRowCell(const string &text)
CHTMLBlockElement(const string &tagname)
Definition: html.hpp:525
unique_ptr< CHTML_table_Cache > m_Cache
Definition: html.hpp:819
CHTMLOpenElement(const char *tagname, const string &text)
Definition: html.hpp:368
CHTMLElement CParent
Definition: html.hpp:728
CHTMLBlockElement(const char *tagname, const string &text)
Definition: html.hpp:519
CHTML_tr * m_Parent
Definition: html.hpp:693
string m_Text
Definition: html.hpp:352
CHTML_area * SetHref(const string &href)
CHTML_ol(const string &type, bool compact=false)
TIndex GetCurrentCol(void) const
Definition: html.hpp:750
CHTMLNode * SetWidth(const string &width)
EHTML_EH_Attribute
Definition: html.hpp:133
CHTML_font(int size, const char *text)
CHTMLElement(const char *tagname, CNCBINode *node)
Definition: html.hpp:486
CHTML_input CParent
Definition: html.hpp:1056
CHTML_tc * NextDataCell(void)
Definition: html.hpp:769
CHTMLElement(const char *tagname, const string &text)
Definition: html.hpp:483
CHTML_tr * m_Node
Definition: html.hpp:912
CHTML_a(void)
CHTMLNode * SetClass(const string &class_name)
CHTMLElement(const string &tagname, const char *text)
Definition: html.hpp:492
CHTML_option(const string &value, const string &label, bool selected=false, bool disabled=false)
CHTML_input CParent
Definition: html.hpp:1111
CHTML_a * SetHref(const string &href)
TIndex m_FilledCellCount
Definition: html.hpp:916
CHTMLElement CParent
Definition: html.hpp:580
CHTML_tc * InsertAt(TIndex row, TIndex column, const string &text)
CHTMLElement CParent
Definition: html.hpp:993
CHTML_menu(const string &type, bool compact=false)
CHTML_a(const string &href, const string &text)
string m_Plain
Definition: html.hpp:256
CNCBINode CParent
Definition: html.hpp:263
CHTMLSingleElement CParent
Definition: html.hpp:1278
CHTML_map * AddArea(CHTML_area *area)
CHTML_option(const string &value, const char *label, bool selected=false, bool disabled=false)
CHTML_input CParent
Definition: html.hpp:1162
CHTMLNode * SetWidth(int width)
EEncodeMode GetEncodeMode() const
Definition: html.hpp:291
CHTMLComment(const string &text)
Definition: html.hpp:559
CHTML_font(const string &typeface, int size, const string &text)
TFlags m_Flags
Definition: html.hpp:353
CHTML_font(int size, const string &text)
CHTMLSingleElement(const string &tagname, CNCBINode *node)
Definition: html.hpp:426
CHTMLElement CParent
Definition: html.hpp:1553
map< size_t, string > TColWidths
Definition: html.hpp:831
CHTML_area(const string &href, vector< int > coords, const string &alt=kEmptyStr)
CHTMLInlineElement CParent
Definition: html.hpp:475
CHTML_input CParent
Definition: html.hpp:1146
CHTML_map * AddArea(CNodeRef &area)
CHTML_a(const string &href)
CHTML_option * SetValue(const string &value)
CHTML_tc(const char *tagname, CNCBINode *node)
Definition: html.hpp:676
CHTMLSingleElement(const string &tagname, const string &text)
Definition: html.hpp:423
CHTML_table * m_Node
Definition: html.hpp:945
CHTMLInlineElement(const char *tagname)
Definition: html.hpp:441
CHTMLNode CParent
Definition: html.hpp:360
CHTMLOpenElement(const char *tagname, const char *text)
Definition: html.hpp:365
CHTMLOpenElement(const string &tagname, CNCBINode *node)
Definition: html.hpp:383
CNCBINode CParent
Definition: html.hpp:307
CHTMLListElement * AppendItem(CNCBINode *node)
void SetEncodeMode(EEncodeMode encode_mode)
Definition: html.hpp:287
CHTML_option * SetDisabled(void)
CHTMLElement CParent
Definition: html.hpp:699
CHTMLSingleElement(const char *tagname, const string &text)
Definition: html.hpp:411
CHTML_tr_Cache(void)
Definition: html.hpp:873
CHTMLOpenElement(const string &tagname, const char *text)
Definition: html.hpp:377
CHTML_select * AppendOption(const string &value, const string &label, bool selected=false, bool disabled=false)
TIndex m_CellCount
Definition: html.hpp:913
CHTML_hr * SetNoShade(bool noShade)
CHTMLNode * SetColor(const string &color)
CHTML_tc * GetCellNode(void) const
Definition: html.hpp:854
CHTML_tc * m_Node
Definition: html.hpp:864
CHTML_ul(bool compact=false)
CHTML_optgroup(const string &label, bool disabled=false)
CHTMLElement CParent
Definition: html.hpp:511
CHTML_tc(const char *tagname)
Definition: html.hpp:667
CHTML_tc * NextHeaderCell(void)
Definition: html.hpp:767
virtual CNcbiOstream & PrintChildren(CNcbiOstream &out, TMode mode)
Definition: node.cpp:362
EFlags
Conversions to make before printing out the stored text.
Definition: html.hpp:318
TIndex GetRowCount(void) const
Definition: html.hpp:928
CHTML_font(const string &typeface, CNCBINode *node=0)
CHTML_font(const string &typeface, const char *text)
CHTML_optgroup * AppendOption(const string &value, const char *label, bool selected=false, bool disabled=false)
CHTML_hr(int size, bool noShade=false)
EEncodeMode m_EncodeMode
Definition: html.hpp:300
CHTMLInlineElement CParent
Definition: html.hpp:1450
TIndex GetCellCount(void) const
Definition: html.hpp:896
CHTML_tr * GetRowNode(void) const
Definition: html.hpp:885
CHTML_font(const string &typeface, int size, CNCBINode *node=0)
CHTMLNode * SetAlign(const string &align)
CNCBINode CParent
Definition: html.hpp:234
int TFlags
Bitwise OR of "EFlags".
Definition: html.hpp:336
CHTMLNode(const string &tagname, CNCBINode *node)
Definition: html.hpp:193
CHTMLOpenElement(const char *tagname)
Definition: html.hpp:362
CHTMLElement CParent
Definition: html.hpp:1173
CHTML_font(const string &typeface, const string &text)
CHTMLNode * AppendHTMLText(const char *text)
CHTMLNode * SetTitle(const string &title)
string m_ColSepR
Definition: html.hpp:827
CHTML_hr(bool noShade=false)
CHTML_table * SetCellSpacing(int spacing)
CHTML_tr_Cache(const CHTML_tr_Cache &)
CHTML_area(void)
~CHTML_tr_Cache(void)
Definition: html.hpp:880
string m_Html
Definition: html.hpp:633
CHTMLDualNode CParent
Definition: html.hpp:624
CHTML_tc * InsertNextCell(const string &text)
CHTMLNode * SetVAlign(const string &align)
CHTML_tc(const char *tagname, const char *text)
Definition: html.hpp:670
CHTMLInlineElement(const string &tagname)
Definition: html.hpp:453
CHTML_font(int size, bool absolute, const string &text)
CHTMLSingleElement CParent
Definition: html.hpp:1538
CNCBINode CParent
Definition: html.hpp:247
void SetText(const string &text)
CNCBINode CParent
Definition: html.hpp:158
CHTML_font(const string &typeface, int size, const char *text)
CHTML_input CParent
Definition: html.hpp:1082
CHTMLNode * AppendPlainText(const char *text, bool noEncode=false)
virtual void DoSetAttribute(const string &name, const string &value, bool optional)
Definition: node.cpp:243
CHTML_basefont(const string &typeface)
TIndex m_FilledRowCount
Definition: html.hpp:949
CHTML_tc * InsertNextCell(CNCBINode *node)
CHTMLBlockElement(const string &tagname, const string &text)
Definition: html.hpp:531
CHTMLBlockElement(const char *tagname, const char *text)
Definition: html.hpp:516
CHTML_area(const string &href, int x, int y, int radius, const string &alt=kEmptyStr)
CHTMLOpenElement CParent
Definition: html.hpp:439
CHTML_table::TIndex TIndex
Definition: html.hpp:871
CHTMLListElement * AppendItem(const char *text)
CHTML_input CParent
Definition: html.hpp:1040
CHTML_optgroup * AppendOption(const string &value, bool selected=false, bool disabled=false)
CHTML_hr(int size, const string &width, bool noShade=false)
CHTMLNode(const string &tagname)
Definition: html.hpp:180
CHTML_a(const string &href, const char *text)
CHTML_ol(int start, bool compact=false)
CHTML_select * SetMultiple(void)
CHTML_tc * NextRowCell(ECellType type=eAnyCell)
CNCBINode * AppendChild(CNCBINode *child)
CHTMLElement(const string &tagname, CNCBINode *node)
Definition: html.hpp:498
CHTMLInlineElement CParent
Definition: html.hpp:1293
TColWidths m_ColWidths
Definition: html.hpp:832
CHTMLSingleElement(const string &tagname, const char *text)
Definition: html.hpp:420
CHTML_area(const string &href, int coords[], int count, const string &alt=kEmptyStr)
CHTML_option(const string &value, bool selected=false, bool disabled=false)
virtual CNcbiOstream & PrintEnd(CNcbiOstream &out, TMode mode)
Definition: node.cpp:356
CHTMLComment(CNCBINode *node)
Definition: html.hpp:564
string m_Text
Definition: html.hpp:299
CHTMLListElement(const char *tagname, const char *type, bool compact=false)
Definition: html.hpp:589
CHTMLNode(void)
Definition: html.hpp:160
CHTMLElement CParent
Definition: html.hpp:1239
CHTML_color(const string &color, const string &text)
CHTMLNode CParent
Definition: html.hpp:548
CHTML_map * AddPolygon(const string &href, int coords[], int count, const string &alt=kEmptyStr)
CHTML_input CParent
Definition: html.hpp:1068
CHTML_font(void)
unsigned TIndex
Definition: html.hpp:701
CHTMLNode * SetAccessKey(char key)
CHTMLSingleElement CParent
Definition: html.hpp:1519
const string & GetNameAttribute(void) const
CHTML_map * AddPolygon(const string &href, vector< int > coords, const string &alt=kEmptyStr)
CHTMLOpenElement CParent
Definition: html.hpp:403
ERowPlainSep m_IsRowSep
Definition: html.hpp:829
CHTML_font * SetFontSize(int size, bool absolute)
TIndex m_CurrentRow
Definition: html.hpp:818
CHTMLElement CParent
Definition: html.hpp:1018
CHTMLSingleElement CParent
Definition: html.hpp:1030
CHTMLInlineElement(const char *tagname, const string &text)
Definition: html.hpp:447
void SetNoWrap(void)
Definition: html.hpp:392
virtual CNcbiOstream & PrintBegin(CNcbiOstream &out, TMode mode)
Definition: node.cpp:350
CHTMLListElement CParent
Definition: html.hpp:1424
CHTMLSingleElement(const char *tagname)
Definition: html.hpp:405
CHTMLInlineElement(const string &tagname, const string &text)
Definition: html.hpp:459
CHTMLListElement CParent
Definition: html.hpp:1437
CHTML_hr(int size, int width, bool noShade=false)
CHTML_tc * NextRowHeaderCell(void)
Definition: html.hpp:773
CHTMLInlineElement(const string &tagname, const char *text)
Definition: html.hpp:456
CHTMLBlockElement(const char *tagname, CNCBINode *node)
Definition: html.hpp:522
CHTMLInlineElement CParent
Definition: html.hpp:1261
CHTML_ol(const char *type, bool compact=false)
CHTMLOpenElement(const string &tagname)
Definition: html.hpp:374
CHTML_basefont(const string &typeface, int size)
void SetCurrentCell(TIndex row, TIndex col)
Definition: html.hpp:746
CHTML_table_Cache & operator=(const CHTML_table_Cache &)
CHTMLBlockElement(const char *tagname)
Definition: html.hpp:513
CHTML_option * SetSelected(void)
CHTML_input CParent
Definition: html.hpp:1122
CHTMLComment(void)
Definition: html.hpp:551
CHTML_tr_Cache ** m_Rows
Definition: html.hpp:948
CHTMLElement CParent
Definition: html.hpp:982
CHTML_basefont(int size)
CHTML_ul(const char *type, bool compact=false)
virtual CNcbiOstream & Print(CNcbiOstream &out, TMode mode=eHTML)
Definition: node.cpp:296
CHTML_tr_Cache & operator=(const CHTML_tr_Cache &)
CHTML_tc * InsertAt(TIndex row, TIndex column, CNCBINode *node)
CHTML_menu(bool compact=false)
CHTML_input CParent
Definition: html.hpp:1134
void SetRowNode(CHTML_tr *rowNode)
Definition: html.hpp:890
CHTML_area(const string &href, int x1, int y1, int x2, int y2, const string &alt=kEmptyStr)
void SetAttribute(const string &name, const string &value)
CHTML_map * AddPolygon(const string &href, list< int > coords, const string &alt=kEmptyStr)
CHTMLInlineElement(const char *tagname, const char *text)
Definition: html.hpp:444
CHTMLOpenElement(const string &tagname, const string &text)
Definition: html.hpp:380
CHTML_ul(const string &type, bool compact=false)
CHTML_font(const string &typeface, int size, bool absolute, CNCBINode *node=0)
CHTMLBlockElement(const string &tagname, CNCBINode *node)
Definition: html.hpp:534
TIndex m_CellsSize
Definition: html.hpp:914
CHTMLNode * SetHeight(int height)
CHTMLElement(const char *tagname, const char *text)
Definition: html.hpp:480
CHTML_font(const string &typeface, int size, bool absolute, const char *text)
CHTMLElement CParent
Definition: html.hpp:664
CHTMLElement(const string &tagname, const string &text)
Definition: html.hpp:495
CHTML_table_Cache(const CHTML_table_Cache &)
CHTML_map * AddCircle(const string &href, int x, int y, int radius, const string &alt=kEmptyStr)
CHTML_font CParent
Definition: html.hpp:1508
CHTMLElement CParent
Definition: html.hpp:1335
TIndex m_RowsSize
Definition: html.hpp:947
CHTML_ol(bool compact=false)
CHTMLListElement(const char *tagname, const string &type, bool compact=false)
Definition: html.hpp:598
CHTML_dir(const char *type, bool compact=false)
CHTMLListElement * AppendItem(const string &text)
CHTML_font(const string &typeface, int size, bool absolute, const string &text)
CHTML_br(void)
CHTMLNode * SetSize(int size)
CHTMLSingleElement(const char *tagname, CNCBINode *node)
Definition: html.hpp:414
CHTMLElement(const string &tagname)
Definition: html.hpp:489
CHTML_select * AppendOption(const string &value, bool selected=false, bool disabled=false)
CHTML_tc_Cache(void)
Definition: html.hpp:839
bool IsUsed(void) const
Definition: html.hpp:845
CHTMLListElement CParent
Definition: html.hpp:1411
CHTMLElement CParent
Definition: html.hpp:1219
void SetText(const string &text)
CHTML_font(int size, CNCBINode *node=0)
CHTML_a(const string &href, CNCBINode *node)
CHTML_optgroup * SetDisabled(void)
CHTML_font(int size, bool absolute, const char *text)
void ResetTableCache(void)
CHTMLNode * SetBgColor(const string &color)
CHTML_tc_Cache * m_Cells
Definition: html.hpp:915
CHTMLBlockElement(const string &tagname, const char *text)
Definition: html.hpp:528
char m_RowSepChar
Definition: html.hpp:828
CHTML_tc(const char *tagname, const string &text)
Definition: html.hpp:673
CHTML_table::TIndex TIndex
Definition: html.hpp:923
CHTML_table * SetCellPadding(int padding)
CHTMLListElement(const char *tagname, bool compact=false)
Definition: html.hpp:582
CHTMLElement CParent
Definition: html.hpp:959
CHTML_select * AppendGroup(CHTML_optgroup *group)
CHTML_tc * DataCell(TIndex row, TIndex column)
Definition: html.hpp:763
CHTML_color(const string &color, CNCBINode *node=0)
CHTMLNode * AppendPlainText(const string &text, bool noEncode=false)
CHTMLInlineElement(const char *tagname, CNCBINode *node)
Definition: html.hpp:450
CHTML_table * SetColumnWidth(TIndex column, int width)
CHTMLNode(const char *tagname, const char *text)
Definition: html.hpp:165
CHTMLSingleElement(const string &tagname)
Definition: html.hpp:417
CHTML_dir(bool compact=false)
CHTML_dir(const string &type, bool compact=false)
CHTML_area(const string &href, list< int > coords, const string &alt=kEmptyStr)
CHTML_select(const string &name, bool multiple=false)
CHTMLInlineElement(const string &tagname, CNCBINode *node)
Definition: html.hpp:462
CHTML_map * AddRect(const string &href, int x1, int y1, int x2, int y2, const string &alt=kEmptyStr)
void SetNoEncode(bool noEncode=true)
Definition: html.hpp:283
CHTML_dl(bool compact=false)
bool m_Used
Definition: html.hpp:863
@ eAnyCell
Definition: html.hpp:733
@ eDataCell
Definition: html.hpp:734
@ ePrintRowSep
Definition: html.hpp:807
@ eHTML_EH_Change
Definition: html.hpp:136
@ eHTML_EH_KeyDown
Definition: html.hpp:149
@ eHTML_EH_Focus
Definition: html.hpp:139
@ eHTML_EH_MouseOver
Definition: html.hpp:145
@ eHTML_EH_Blur
Definition: html.hpp:135
@ eHTML_EH_Load
Definition: html.hpp:140
@ eHTML_EH_MouseOut
Definition: html.hpp:146
@ eHTML_EH_KeyUp
Definition: html.hpp:151
@ eHTML_EH_Unload
Definition: html.hpp:141
@ eHTML_EH_Submit
Definition: html.hpp:148
@ eHTML_EH_MouseDown
Definition: html.hpp:142
@ eHTML_EH_DblClick
Definition: html.hpp:138
@ eHTML_EH_KeyPress
Definition: html.hpp:150
@ eHTML_EH_MouseUp
Definition: html.hpp:143
@ eHTML_EH_Click
Definition: html.hpp:137
@ eHTML_EH_Select
Definition: html.hpp:147
@ eHTML_EH_MouseMove
Definition: html.hpp:144
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
#define kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_XHTML_EXPORT
Definition: ncbi_export.h:1139
static const char label[]
CMapControl::TIndex TIndex
@ eHTML
HTML tag or, for example, HTML entity.
Definition: unicode.hpp:57
The standard node class.
HTML library helper classes and functions.
n background color
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n th
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
n padding
sat & gt
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n td
int i
static void text(MDB_val *v)
Definition: mdb_dump.c:62
mdb_mode_t mode
Definition: lmdb++.h:38
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
const char * tag
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
@ eGet
Definition: ns_types.hpp:55
static BOOL number
Definition: pcregrep.c:193
#define row(bind, expected)
Definition: string_bind.c:73
Definition: inftrees.h:24
Definition: type.c:6
#define _ASSERT
Modified on Thu Apr 11 15:20:48 2024 by modify_doxy.py rev. 669887