Paragraph.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
#ifndef __CB2__PARAGRAPH_H__
00015
#define __CB2__PARAGRAPH_H__
00016
00017
00018
#include <cb2/utils.h>
00019
#include <cb2/Widgets.h>
00020
00021
00022 #define STRONG CB2::Text::strong
00023 #define NO_STRONG CB2::Text::no_strong
00024 #define EM CB2::Text::em
00025 #define NO_EM CB2::Text::no_em
00026 #define TT CB2::Text::tt
00027 #define NO_TT CB2::Text::no_tt
00028
00029
00030
namespace CB2 {
00031
00032
00038 class Anchor :
public Class {
00039
public:
00040
Anchor(
const String & url,
const String & text,
const String & title =
"",
const String & css_class =
"",
const String & css_id =
"");
00042
const String &
GetUrl()
const;
00043
const String &
GetText()
const;
00044
const String &
GetTitle()
const;
00045
const String &
GetCSSclass()
const;
00046
const String &
GetCSSid()
const;
00048
private:
00049
00050 String _url;
00051 String _text;
00052 String _title;
00053 String _css_class;
00054 String _css_id;
00055
00056 };
00057
00058
00064 class Text :
public Class {
00065
public:
00066
00072 typedef enum {
00073
strong,
00074
no_strong,
00075
em,
00076
no_em,
00077
tt,
00078
no_tt
00079 } text_cmd;
00080
00081
Text();
00082
Text(
const Text & prev);
00084
const Text & operator=(
const Text & prev);
00085
Text &
operator<<(
const String & text);
00086
Text &
operator<<(
const Anchor & anchor);
00087
Text &
operator<<(
const text_cmd & cmd);
00089
String HTML() const;
00091 private:
00092
00096 typedef struct {
00097 bool html;
00098 String text;
00099 }
text_component;
00100
00101 typedef List< text_component> text_components;
00103 text_components components;
00104 };
00105
00106
00113 class Paragraph :
public Widget {
00114
public:
00115
Paragraph(
Container & parent,
const String & text,
const String & css_class =
"",
const String & css_id =
"");
00116
Paragraph(
Application & parent,
const String & text,
const String & css_class =
"",
const String & css_id =
"");
00118
Paragraph(
Container & parent,
const Text & text,
const String & css_class =
"",
const String & css_id =
"");
00119
Paragraph(
Application & parent,
const Text & text,
const String & css_class =
"",
const String & css_id =
"");
00121
virtual ~Paragraph();
00123
private:
00124 String contents;
00125 String _css_class;
00126 String _css_id;
00127 };
00128
00129
00135 class Heading :
public Widget {
00136
public:
00137
Heading(
Container & parent,
const unsigned int level,
const String & text,
const String & css_class =
"",
const String & css_id =
"");
00138
Heading(
Application & parent,
const unsigned int level,
const String & text,
const String & css_class =
"",
const String & css_id =
"");
00140
virtual ~Heading();
00142
private:
00143 String contents;
00144 unsigned int _level;
00145 String _css_class;
00146 String _css_id;
00147 };
00148
00149 }
00150
00151
00152
#endif
Generated on Thu Sep 16 23:26:49 2004 for ColorBox2 by
1.3.7