tagging release
[dasher.git] / trunk / Src / Common / IOstreamDasherEdit.h
blob0bc5dcd88a7e221e53433f81fcdcf27dcb8e5ade
1 // IOstreamDasherEdit.h
2 // (c) 2003 Yann Dirson
3 // Derived from GtkDasherEdit.h
4 // (c) 2002 Philip Cowans
6 #ifndef IOSTREAM_DASHER_EDIT_H
7 #define IOSTREAM_DASHER_EDIT_H
9 #include "Common.h"
10 #include "DashEdit.h"
11 #include "DasherTypes.h"
12 #include "DasherInterface.h"
14 #include <string.h>
15 #include <iostream>
17 #ifndef ICONV_CONST
18 #define ICONV_CONST const
19 #endif
21 using namespace Dasher;
23 class IOstreamDasherEdit:public Dasher::CDashEditbox {
24 public:
25 IOstreamDasherEdit(CDasherInterface * _interface, std::ostream * os = &std::cout);
26 ~IOstreamDasherEdit();
28 void write_to_file();
29 void get_new_context(std::string & str, int max);
30 void unflush();
31 void output(symbol Symbol);
32 void flush(symbol Symbol);
33 void deletetext();
34 void Clear();
36 void SetEncoding(Opts::FileEncodingFormats Encoding);
37 void SetFont(std::string Name, long Size);
38 bool SaveAs(const std::string filename, bool a);
39 bool Save(bool a = false);
40 bool Open(const std::string filename);
42 void TimeStampNewFiles(bool Value);
44 void kill_flush();
46 void set_display_encoding(int _enc);
48 protected:
49 int flush_count;
50 CDasherInterface *interface;
52 std::ostream * outstream;
54 int enc;
55 char encstr[256];
58 #endif