00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
#ifndef __CB2__WIDGETS_H__
00015
#define __CB2__WIDGETS_H__
00016
00017
00018
#include <cb2/utils.h>
00019
#include <cb2/Template.h>
00020
00021
00022
namespace CB2 {
00023
00024
class Container;
00025
class Application;
00034 class Size :
public Class {
00035
public:
00036
00040 typedef enum {
00041
px,
00042
em
00043 } size_type;
00044
00045
Size(
const int value,
const size_type type);
00047
String GetSize() const;
00049 private:
00050
00051 int svalue;
00052 size_type stype;
00053 };
00054
00055
00063 class
Widget : public
Class {
00064
public:
00065
Widget(
Container & parent);
00066
Widget(
Application & parent);
00067
virtual ~
Widget();
00069
protected:
00070
void Data(
const String & data);
00072
private:
00073
Widget(
const Widget & prev);
00074
void operator=(
const Widget & prev);
00076 Template * ptempl;
00077 String panchor;
00078 bool filled;
00079 };
00080
00081
00088 class Container :
public Widget {
00089
public:
00090
Container(
Container & parent);
00091
Container(
Application & parent);
00093
virtual Template * Add(
Widget * child,
String & anchor) = 0;
00094 };
00095
00096
00102 class Spacer :
public Widget {
00103
public:
00104
Spacer(
Container & parent,
const String & css_class =
"",
const String & css_id =
"");
00105
Spacer(
Application & parent,
const String & css_class =
"",
const String & css_id =
"");
00107
Spacer(
Container & parent,
const Size & height);
00108
Spacer(
Application & parent,
const Size & height);
00110
virtual ~
Spacer();
00112
private:
00113
00114
void init(
const String & css_class,
const String & css_id);
00115
void init(
const Size & height);
00117 String data;
00119 };
00120
00121
00122 }
00123
00124
00125
#endif