diff options
author | jcid <devnull@localhost> | 2008-09-24 18:44:40 +0200 |
---|---|---|
committer | jcid <devnull@localhost> | 2008-09-24 18:44:40 +0200 |
commit | c377e06400f138325a9a9d43d91a9272691867a1 (patch) | |
tree | 49f3ca1c46af11a058a68714899d4137ec717618 /dw/alignedtextblock.hh | |
parent | 642f9b3e747859a7256ea12fab9f9ed50aa9253a (diff) |
- Moved the dw2 tree into dillo2's tree.
Diffstat (limited to 'dw/alignedtextblock.hh')
-rw-r--r-- | dw/alignedtextblock.hh | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/dw/alignedtextblock.hh b/dw/alignedtextblock.hh new file mode 100644 index 00000000..e855f1cc --- /dev/null +++ b/dw/alignedtextblock.hh @@ -0,0 +1,61 @@ +#ifndef __DW_ALIGNEDTEXTBLOCK_HH__ +#define __DW_ALIGNEDTEXTBLOCK_HH__ + +#include "core.hh" +#include "textblock.hh" + +namespace dw { + +/** + * \brief Base widget for all textblocks (sub classes of dw::Textblock), which + * are positioned vertically and aligned horizontally. + */ +class AlignedTextblock: public Textblock +{ +private: + class List + { + private: + misc::SimpleVector <AlignedTextblock*> *textblocks; + misc::SimpleVector <int> *values; + int maxValue, refCount; + + ~List (); + + public: + List (); + inline int add (AlignedTextblock *textblock); + void unref (int pos); + + inline int getMaxValue () { return maxValue; } + inline void setMaxValue (int maxValue) { this->maxValue = maxValue; } + + inline int size () { return textblocks->size (); } + inline AlignedTextblock *getTextblock (int pos) { + return textblocks->get (pos); } + inline int getValue (int pos) {return values->get (pos); } + inline void setValue (int pos, int value) { + return values->set (pos, value); } + }; + + List *list; + int listPos; + +protected: + AlignedTextblock(bool limitTextWidth); + + virtual int getValue () = 0; + virtual void setMaxValue (int maxValue, int value) = 0; + + void setRefTextblock (AlignedTextblock *ref); + void updateValue (); + +public: + static int CLASS_ID; + + ~AlignedTextblock(); +}; + +} // namespace dw + +#endif // __DW_ALIGNEDTEXTBLOCK_HH__ |