00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef LAYOUT_ITEM_H
00023 #define LAYOUT_ITEM_H
00024
00025 #include "text_layout.h"
00026 #include "treeitem.h"
00027
00028 namespace cwidget
00029 {
00030 class fragment;
00031
00032 namespace widgets
00033 {
00034 class layout_item : public treeitem
00035 {
00036 protected:
00037 class layout_line;
00038
00039 private:
00040 typedef std::vector<layout_line *> child_list;
00041
00042 child_list children;
00043 fragment *f;
00044 fragment_contents lines;
00045
00046 int lastw;
00047 int lastbasex;
00048
00049 protected:
00050 class layout_line:public treeitem
00051 {
00052 int n;
00053 layout_item &parent;
00054 public:
00055 layout_line(int _n, layout_item &_parent);
00056
00057 void paint(tree *win, int y, bool hierarchical,
00058 const style &st);
00059
00060 const wchar_t *tag();
00061 const wchar_t *label();
00062 };
00063
00064
00065 class levelref:public tree_levelref
00066 {
00067 size_t item_num;
00068 const child_list &lines;
00069
00070 public:
00071 levelref(const levelref &x);
00072 levelref(size_t n, const child_list &_lines);
00073
00074 treeitem *get_item();
00075 virtual void advance_next();
00076 virtual void return_prev();
00077 bool is_begin();
00078 bool is_end();
00079 levelref *clone() const;
00080 };
00081
00082 public:
00083 layout_item(fragment *f);
00084
00085 const wchar_t *tag();
00086 const wchar_t *label();
00087
00089 void paint_line(int n,
00090 tree *win, int y, bool hierarchical,
00091 const style &st);
00092 void paint(tree *win, int y, bool hierarchical,
00093 const style &st);
00094
00095 int get_normal_attr();
00096
00097 levelref *begin();
00098 levelref *end();
00099 bool has_visible_children();
00100
00101 const fragment_line &get_line(tree *win, size_t n, int basex,
00102 const style &st);
00103
00104 ~layout_item();
00105 };
00106 }
00107 }
00108
00109 #endif