00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1999, 2002, 2004-2006, 2008 Peter Miller 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program. If not, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef LIBAEGIS_WIDE_OUTPUT_COLUMN_H 00021 #define LIBAEGIS_WIDE_OUTPUT_COLUMN_H 00022 00023 #include <libaegis/wide_output.h> 00024 00025 struct column_row_ty 00026 { 00027 size_t length_max; 00028 size_t length; 00029 wchar_t *text; 00030 int printing_width; 00031 }; 00032 00040 class wide_output_column: 00041 public wide_output 00042 { 00043 public: 00044 typedef aegis_shared_ptr<wide_output_column> cpointer; 00045 00049 virtual ~wide_output_column(); 00050 00051 private: 00056 wide_output_column(int width, int length); 00057 00058 public: 00063 static cpointer open(int width, int length); 00064 00065 column_row_ty *get(int n); 00066 00067 void clear_buffers(); 00068 00069 protected: 00070 // See base class for documentation. 00071 nstring filename(); 00072 00073 // See base class for documentation. 00074 int page_width(); 00075 00076 // See base class for documentation. 00077 int page_length(); 00078 00079 // See base class for documentation. 00080 const char *type_name() const; 00081 00082 // See base class for documentation. 00083 void write_inner(const wchar_t *data, size_t len); 00084 00085 // See base class for documentation. 00086 void flush_inner(); 00087 00088 // See base class for documentation. 00089 void end_of_line_inner(); 00090 00091 private: 00092 int width; 00093 int length; 00094 00095 column_row_ty *row; 00096 size_t nrows; 00097 size_t nrows_max; 00098 00102 wide_output_column(); 00103 00104 wide_output_column(const wide_output_column &); 00105 00106 wide_output_column &operator=(const wide_output_column &); 00107 }; 00108 00109 #endif // LIBAEGIS_WIDE_OUTPUT_COLUMN_H