|
a/src/internfile/mh_mail.h |
|
b/src/internfile/mh_mail.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 _MAIL_H_INCLUDED_
|
17 |
#ifndef _MAIL_H_INCLUDED_
|
18 |
#define _MAIL_H_INCLUDED_
|
18 |
#define _MAIL_H_INCLUDED_
|
19 |
/* @(#$Id: mh_mail.h,v 1.10 2006-12-15 16:33:15 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: mh_mail.h,v 1.11 2006-12-16 15:39:54 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <sstream>
|
21 |
#include <sstream>
|
22 |
#include <vector>
|
22 |
#include <vector>
|
23 |
using std::vector;
|
23 |
using std::vector;
|
24 |
|
24 |
|
|
... |
|
... |
27 |
namespace Binc {
|
27 |
namespace Binc {
|
28 |
class MimeDocument;
|
28 |
class MimeDocument;
|
29 |
class MimePart;
|
29 |
class MimePart;
|
30 |
}
|
30 |
}
|
31 |
|
31 |
|
|
|
32 |
class MHMailAttach;
|
|
|
33 |
|
32 |
/**
|
34 |
/**
|
33 |
* Translate a mail folder file into internal documents (also works
|
35 |
* Translate a mail folder file into internal documents (also works
|
34 |
* for maildir files). This has to keep state while parsing a mail folder
|
36 |
* for maildir files). This has to keep state while parsing a mail folder
|
35 |
* file.
|
37 |
* file.
|
36 |
*/
|
38 |
*/
|
|
... |
|
... |
38 |
public:
|
40 |
public:
|
39 |
MimeHandlerMail(const string &mt)
|
41 |
MimeHandlerMail(const string &mt)
|
40 |
: RecollFilter(mt), m_bincdoc(0), m_fd(-1), m_stream(0), m_idx(-1)
|
42 |
: RecollFilter(mt), m_bincdoc(0), m_fd(-1), m_stream(0), m_idx(-1)
|
41 |
{}
|
43 |
{}
|
42 |
virtual ~MimeHandlerMail();
|
44 |
virtual ~MimeHandlerMail();
|
43 |
virtual bool set_document_file(const string &file_path);
|
45 |
virtual bool set_document_file(const string& file_path);
|
44 |
virtual bool set_document_string(const string &data);
|
46 |
virtual bool set_document_string(const string& data);
|
|
|
47 |
virtual bool is_data_input_ok(DataInput input) const {
|
|
|
48 |
if (input == DOCUMENT_FILE_NAME || input == DOCUMENT_STRING)
|
|
|
49 |
return true;
|
|
|
50 |
return false;
|
|
|
51 |
}
|
45 |
virtual bool next_document();
|
52 |
virtual bool next_document();
|
|
|
53 |
virtual bool skip_to_document(const string& ipath);
|
46 |
|
54 |
|
47 |
private:
|
55 |
private:
|
48 |
bool processMsg(Binc::MimePart *doc, int depth);
|
56 |
bool processMsg(Binc::MimePart *doc, int depth);
|
49 |
void walkmime(Binc::MimePart* doc, int depth);
|
57 |
void walkmime(Binc::MimePart* doc, int depth);
|
50 |
bool processAttach();
|
58 |
bool processAttach();
|
51 |
Binc::MimeDocument *m_bincdoc;
|
59 |
Binc::MimeDocument *m_bincdoc;
|
52 |
int m_fd;
|
60 |
int m_fd;
|
53 |
std::stringstream *m_stream;
|
61 |
std::stringstream *m_stream;
|
54 |
int m_idx; // starts at -1 for self, then index into
|
62 |
int m_idx; // starts at -1 for self, then index into
|
55 |
// attachments;
|
63 |
// attachments;
|
56 |
vector<Binc::MimePart *> m_attachments;
|
64 |
vector<MHMailAttach *> m_attachments;
|
|
|
65 |
};
|
|
|
66 |
|
|
|
67 |
class MHMailAttach {
|
|
|
68 |
public:
|
|
|
69 |
string m_contentType;
|
|
|
70 |
string m_filename;
|
|
|
71 |
string m_charset;
|
|
|
72 |
string m_contentTransferEncoding;
|
|
|
73 |
Binc::MimePart *m_part;
|
57 |
};
|
74 |
};
|
58 |
|
75 |
|
59 |
#endif /* _MAIL_H_INCLUDED_ */
|
76 |
#endif /* _MAIL_H_INCLUDED_ */
|