00001
00004 enum ReporterEnvir {
00005 TextEnvir = 0,
00006 TabularEnvir = 1,
00007 TableEnvir = 2,
00008 ItemEnvir = 3,
00009 EnumEnvir = 4,
00010 FigureEnvir = 5,
00011 DispmathEnvir = 6,
00012 CenterEnvir = 7
00013 };
00014
00015
00016 enum TextStyle {
00017 PLAIN = 0,
00018 BOLD = 1,
00019 ITALICS = 2,
00020 TYPEWRITER = 3,
00021 MATHTEXT = 4
00022 };
00023
00024
00025 #define Type ReporterEnvir
00026 #include <Stack_Type.h>
00027 #undef Type
00028
00029 #define Type TextStyle
00030 #include <Stack_Type.h>
00031 #undef Type
00032
00033
00034
00035
00036 class Reporter : public HandleId
00037
00038 {
00039 private:
00040
00041 void constructor (Os os);
00042
00043 protected:
00044
00045 String currPlotDir;
00046 int plotSecCount;
00047
00048 void preparePlots ();
00049 String filename;
00050 String extension;
00051 Os os;
00052
00053 ReporterEnvir envir;
00054 TextStyle style;
00055
00056 Stack(ReporterEnvir) envirStack;
00057 Stack(TextStyle) styleStack;
00058
00059 bool singlefile;
00060 String purpose;
00061
00062 int tb_ncols;
00063 String cell_delim;
00064
00065 Reporter (Os os);
00066 Reporter (const String& filename, const String& extension);
00067
00068 virtual void putTextline (const String& txt) =0;
00069 virtual void putTabularline (const String& txt) =0;
00070 virtual void putTableline (const String& txt) =0;
00071 virtual void putItemline (const String& txt) =0;
00072 virtual void putEnumline (const String& txt) =0;
00073 virtual void putFigureline (const String& txt) =0;
00074 virtual void putDispmathline (const String& txt) =0;
00075 virtual void putCenterline (const String& txt) =0;
00076
00077 virtual bool copyFile (const String& file, const String& format);
00078
00079 public:
00080
00081 virtual ~Reporter ();
00082
00083
00084
00085
00086 virtual Reporter& header (const String& title, const String& author,
00087 bool fullpage = true,
00088 bool singlefile = true,
00089 const char* purpose = NULL);
00090
00091 virtual Reporter& trailer ();
00092
00093 virtual String getSectionRef () = 0;
00094
00095 virtual Reporter& section (const String& txt);
00096 virtual Reporter& section (const String& txt, const String& label);
00097 virtual Reporter& subsection (const String& txt) =0;
00098 virtual Reporter& subsection (const String& txt, const String& label) =0;
00099 virtual Reporter& subsubsection (const String& txt) =0;
00100 virtual Reporter& subsubsection (const String& txt, const String& label) =0;
00101
00102 virtual Reporter& pagebreak () =0;
00103 virtual Reporter& linebreak () =0;
00104 virtual Reporter& eject (int n = 1) =0;
00105 virtual Reporter& drawline () =0;
00106 virtual Reporter& putLabel (const String& ) { return *this; }
00107 virtual Reporter& putReference(const String& ) { return *this; }
00108 virtual Reporter& putReference(const String& ,
00109 const String& ) { return *this; }
00110 Reporter& flush ();
00111
00112 virtual Reporter& beginGroup (TextStyle style);
00113 virtual Reporter& endGroup ();
00114
00115 virtual String getGroup (const String& txt, TextStyle style);
00116
00117
00118
00119 virtual String cellpad (const String& s) =0;
00120
00121
00122
00123
00124 virtual String adaptString (const String& txt);
00125
00126
00127
00128
00129 Reporter& insert (const String& txt);
00130
00131 Reporter& put (const String& txt);
00132 virtual Reporter& putmathline (const String& txt);
00133 virtual Reporter& centerline (const String& txt) =0;
00134
00135
00136
00137 virtual Reporter& put (ArrayGenSimple(String)& tb);
00138 virtual Reporter& put (ArrayGenSimple(real)& tb);
00139 virtual Reporter& put (ArrayGenSimple(real)& tb,
00140 const String& cell_format);
00141 virtual Reporter& put (ArrayGenSimple(real)& tb,
00142 ArrayGenSimple(String)& cell_format);
00143
00144 virtual Reporter& insertDocument (const String& basename) =0;
00145 virtual Reporter& insertVerbatim (const String& file) =0;
00146
00147
00148
00149 virtual Reporter& beginCenter ();
00150 virtual Reporter& endCenter ();
00151
00152 virtual Reporter& beginTabular (int ncols, const String& col_format);
00153 virtual Reporter& endTabular ();
00154
00155 virtual Reporter& beginTable (int ncols, const String& col_format);
00156 virtual Reporter& endTable (const String& caption, const String& label);
00157
00158 virtual Reporter& beginItemize ();
00159 virtual Reporter& endItemize ();
00160
00161 virtual Reporter& beginEnumerate ();
00162 virtual Reporter& endEnumerate ();
00163
00164 virtual Reporter& beginFigure (const String& psfilename,
00165 real cmWidth = 10.0);
00166 virtual Reporter& endFigure (const String& caption, const String& label);
00167
00168 virtual Reporter& beginDispmath ();
00169 virtual Reporter& endDispmath ();
00170
00171
00172 virtual String makeLabelRef (const String& label) = 0;
00173 String getCurrPlotDir ();
00174
00175
00176
00177
00178 virtual Reporter& figure (const String& psfilename, const String& caption,
00179 const String& label, real cmWidth = 10.0);
00180
00181 virtual Reporter& figure (const Strings& psfilename,
00182 const Strings& caption,
00183 const String& common_caption,
00184 const Strings& label,
00185 real cmWidth = 10.0);
00186
00187 Reporter& displaymath (const String& txt);
00188
00189
00190
00191
00192 virtual void process (bool postscript = true) =0;
00193 virtual void print (bool postscript = true) =0;
00194 virtual void preview (bool postscript = true) =0;
00195
00196
00197 CLASS_INFO
00198 };
00199
00200 )
00296 Put a label in current position. For example, in `\`LaTeX`\`
00297 documents, this will be an ordinary label that can be referred
00298 to later using the ref command (coded in class "Reporter" by
00299 the function "putReference"), while in HTML documents a label
00300 will result in an anchor (similary, the hyperlink to an anchor
00301 is coded using the "putReference" function).
00302
00303 */
00304 )
00306 Makes a reference to a label. See documentation of the
00307 "puLabel" function. The function with only one argument is
00308 useful for `\`LaTeX`\` documents only. HTML documents usually
00309 require a document-label and a highlighted text. The overloaded
00310 version of "putReference" is aimed at both `\`LaTeX`\` and HTML
00311 reports. The "label" argument is the `\`LaTeX`\` label and the
00312 highlighted text in HTML while the "document" argument is the
00313 document-label in HTML.
00314
00315 */
00316 , const String& )
00318 See documentation of one of the overloaded functions.
00319 */
00320