|
a/src/internfile/internfile.h |
|
b/src/internfile/internfile.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _INTERNFILE_H_INCLUDED_
|
17 |
#ifndef _INTERNFILE_H_INCLUDED_
|
18 |
#define _INTERNFILE_H_INCLUDED_
|
18 |
#define _INTERNFILE_H_INCLUDED_
|
19 |
/* @(#$Id: internfile.h,v 1.20 2008-10-04 14:26:59 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: internfile.h,v 1.21 2008-10-08 16:15:22 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
22 |
#include <vector>
|
22 |
#include <vector>
|
|
|
23 |
#include <map>
|
|
|
24 |
#include <set>
|
23 |
using std::string;
|
25 |
using std::string;
|
24 |
using std::vector;
|
26 |
using std::vector;
|
|
|
27 |
using std::map;
|
|
|
28 |
using std::set;
|
25 |
|
29 |
|
26 |
#include "pathut.h"
|
30 |
#include "pathut.h"
|
27 |
#include "Filter.h"
|
31 |
#include "Filter.h"
|
28 |
|
32 |
|
29 |
class RclConfig;
|
33 |
class RclConfig;
|
|
... |
|
... |
93 |
* that we stop conversion at the native document type (ie: extracting
|
97 |
* that we stop conversion at the native document type (ie: extracting
|
94 |
* an email attachment and starting an external viewer)
|
98 |
* an email attachment and starting an external viewer)
|
95 |
*/
|
99 |
*/
|
96 |
void setTargetMType(const string& tp) {m_targetMType = tp;}
|
100 |
void setTargetMType(const string& tp) {m_targetMType = tp;}
|
97 |
|
101 |
|
|
|
102 |
/* In case we see an html version, it's set aside and can be recovered */
|
|
|
103 |
const string& get_html() {return m_html;}
|
|
|
104 |
|
98 |
/** Utility function: extract internal document into temporary file.
|
105 |
/** Utility function: extract internal document into temporary file.
|
99 |
* This is used mainly for starting an external viewer for a
|
106 |
* This is used mainly for starting an external viewer for a
|
100 |
* subdocument (ie: mail attachment).
|
107 |
* subdocument (ie: mail attachment).
|
101 |
* @return true for success.
|
108 |
* @return true for success.
|
102 |
* @param temp output reference-counted temp file object (goes
|
109 |
* @param temp output reference-counted temp file object (goes
|
|
... |
|
... |
108 |
*/
|
115 |
*/
|
109 |
static bool idocTempFile(TempFile& temp, RclConfig *cnf, const string& fn,
|
116 |
static bool idocTempFile(TempFile& temp, RclConfig *cnf, const string& fn,
|
110 |
const string& ipath, const string& mtype);
|
117 |
const string& ipath, const string& mtype);
|
111 |
|
118 |
|
112 |
const string& getReason() const {return m_reason;}
|
119 |
const string& getReason() const {return m_reason;}
|
113 |
const list<string>& getMissingExternal();
|
|
|
114 |
void getMissingExternal(string& missing);
|
120 |
static void getMissingExternal(string& missing);
|
115 |
const string& get_html() {return m_html;}
|
121 |
static void getMissingDescription(string& desc);
|
116 |
|
122 |
|
117 |
private:
|
123 |
private:
|
118 |
static const unsigned int MAXHANDLERS = 20;
|
124 |
static const unsigned int MAXHANDLERS = 20;
|
119 |
RclConfig *m_cfg;
|
125 |
RclConfig *m_cfg;
|
120 |
string m_fn;
|
126 |
string m_fn;
|
|
... |
|
... |
133 |
bool m_tmpflgs[MAXHANDLERS];
|
139 |
bool m_tmpflgs[MAXHANDLERS];
|
134 |
vector<TempFile> m_tempfiles;
|
140 |
vector<TempFile> m_tempfiles;
|
135 |
// Error data if any
|
141 |
// Error data if any
|
136 |
string m_reason;
|
142 |
string m_reason;
|
137 |
// Missing external programs
|
143 |
// Missing external programs
|
138 |
list<string> m_missingExternal;
|
144 |
static set<string> o_missingExternal;
|
|
|
145 |
static map<string, set<string> > o_typesForMissing;
|
139 |
|
146 |
|
140 |
void tmpcleanup();
|
147 |
void tmpcleanup();
|
141 |
bool dijontorcl(Rcl::Doc&);
|
148 |
bool dijontorcl(Rcl::Doc&);
|
142 |
void collectIpathAndMT(Rcl::Doc&, string& ipath) const;
|
149 |
void collectIpathAndMT(Rcl::Doc&, string& ipath) const;
|
143 |
bool dataToTempFile(const string& data, const string& mt, string& fn);
|
150 |
bool dataToTempFile(const string& data, const string& mt, string& fn);
|
144 |
void popHandler();
|
151 |
void popHandler();
|
145 |
int addHandler();
|
152 |
int addHandler();
|
146 |
void checkExternalMissing(const string& msg);
|
153 |
void checkExternalMissing(const string& msg, const string& mt);
|
147 |
void processNextDocError(Rcl::Doc &doc, string& ipath);
|
154 |
void processNextDocError(Rcl::Doc &doc, string& ipath);
|
148 |
};
|
155 |
};
|
149 |
|
156 |
|
150 |
|
157 |
|
151 |
#endif /* _INTERNFILE_H_INCLUDED_ */
|
158 |
#endif /* _INTERNFILE_H_INCLUDED_ */
|