00001 #ifndef COLUMN_HEADERS_CLASS
00002 #define COLUMN_HEADERS_CLASS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "textual_dll.h"
00019
00020 #include <basis/packable.h>
00021
00022
00023 class column_info_array;
00024 class string_matrix;
00025
00027
00032 class TEXTUAL_CLASS_STYLE column_headers : public packable
00033 {
00034 public:
00035 column_headers();
00036 virtual ~column_headers();
00037
00038 int columns() const;
00040
00041 enum justifications { LEFT_JUSTIFY, CENTER_JUSTIFY, RIGHT_JUSTIFY };
00042
00043 void add(const istring &column_name, justifications placement = LEFT_JUSTIFY,
00044 int maximum_width = 0);
00046
00050 bool get(int index, istring &column_name, justifications &placement,
00051 int &maximum_width);
00053
00054 bool zap(int start, int end = -1);
00056
00059 bool format(istring &to_fill, const string_array &to_format);
00061
00068 bool format(istring &to_fill, const string_matrix &to_format);
00070
00076 virtual void pack(byte_array &packed_form) const;
00078 virtual bool unpack(byte_array &packed_form);
00080
00081 private:
00082 column_info_array *_cols;
00083 };
00084
00085 #endif
00086