00001 #ifndef __DW_ALIGNEDTEXTBLOCK_HH__ 00002 #define __DW_ALIGNEDTEXTBLOCK_HH__ 00003 00004 #include "core.hh" 00005 #include "textblock.hh" 00006 00007 namespace dw { 00008 00013 class AlignedTextblock: public Textblock 00014 { 00015 private: 00016 class List 00017 { 00018 private: 00019 lout::misc::SimpleVector <AlignedTextblock*> *textblocks; 00020 lout::misc::SimpleVector <int> *values; 00021 int maxValue, refCount; 00022 00023 ~List (); 00024 00025 public: 00026 List (); 00027 inline int add (AlignedTextblock *textblock); 00028 void unref (int pos); 00029 00030 inline int getMaxValue () { return maxValue; } 00031 inline void setMaxValue (int maxValue) { this->maxValue = maxValue; } 00032 00033 inline int size () { return textblocks->size (); } 00034 inline AlignedTextblock *getTextblock (int pos) { 00035 return textblocks->get (pos); } 00036 inline int getValue (int pos) {return values->get (pos); } 00037 inline void setValue (int pos, int value) { 00038 return values->set (pos, value); } 00039 }; 00040 00041 List *list; 00042 int listPos; 00043 00044 protected: 00045 AlignedTextblock(bool limitTextWidth); 00046 00047 virtual int getValue () = 0; 00048 virtual void setMaxValue (int maxValue, int value) = 0; 00049 00050 void setRefTextblock (AlignedTextblock *ref); 00051 void updateValue (); 00052 00053 public: 00054 static int CLASS_ID; 00055 00056 ~AlignedTextblock(); 00057 }; 00058 00059 } // namespace dw 00060 00061 #endif // __DW_ALIGNEDTEXTBLOCK_HH__
1.5.9