Files correlati : agalib Ricompilazione Demo : [ ] Commento : Implementato di meccanismo generico di blocco degli inserimenti, attivabile nelle singole applicazioni (cg2 e ve0) git-svn-id: svn://10.65.10.50/branches/R_10_00@22420 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			89 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			89 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#ifndef __GOLEM_H
 | 
						|
#define __GOLEM_H
 | 
						|
 | 
						|
#ifndef __DATE_H
 | 
						|
#include <date.h>
 | 
						|
#endif
 | 
						|
 | 
						|
#ifndef __ARRAY_H
 | 
						|
#include <array.h>
 | 
						|
#endif
 | 
						|
 | 
						|
bool goto_url(const char* url);
 | 
						|
bool edit_url(const char* url);
 | 
						|
bool print_url(const char* url);
 | 
						|
 | 
						|
class TMAPI_session;
 | 
						|
 | 
						|
class TMail_message : public TString_array
 | 
						|
{                  
 | 
						|
  TString_array _recipients, _copy_recipients, _attachments;
 | 
						|
  TString _subject;
 | 
						|
  TString _sender;
 | 
						|
  TString _id;
 | 
						|
  TDate _date;
 | 
						|
  long _hms;
 | 
						|
  bool _query_receipt;
 | 
						|
  
 | 
						|
protected:
 | 
						|
  bool add_recipient_ex(const char* recipient, int type);
 | 
						|
 | 
						|
public: // Semiprotected: You don't have access to TMAPI_session
 | 
						|
  bool send(TMAPI_session& lhSession, bool hide_ui = false);
 | 
						|
  bool remove(TMAPI_session& lhSession);
 | 
						|
  
 | 
						|
public:                                                       
 | 
						|
  bool add_recipient(const char* address) { return add_recipient_ex(address, 0); }
 | 
						|
  void set_subject(const char* subject) { _subject = subject; _subject.trim(); }
 | 
						|
  bool add_copy_recipient(const char* address) { return add_recipient_ex(address, 1); }
 | 
						|
  bool attach(const char* filename) { return add_recipient_ex(filename, 2); }
 | 
						|
  void set_sender(const char* address) { _sender = address; _sender.trim(); }
 | 
						|
  void set_id(const char* id) { _id = id; }
 | 
						|
  void query_receipt(bool qr) { _query_receipt = qr; }
 | 
						|
  int add_line(const char * s);
 | 
						|
  
 | 
						|
  TMail_message& operator = (const char* msg) { destroy(); add(msg); return *this; }
 | 
						|
  TMail_message& operator = (const TString& msg) { destroy(); add(msg); return *this; }
 | 
						|
  
 | 
						|
  bool send(bool hide_ui = false);
 | 
						|
  bool remove();
 | 
						|
 | 
						|
  const TString& sender() const { return _sender; }
 | 
						|
  const TString& subject() const { return _subject; }
 | 
						|
  const TString& id() const { return _id; }
 | 
						|
  bool receipt_requested() const { return _query_receipt; }
 | 
						|
 | 
						|
  void set_date_time(const char* date_time);
 | 
						|
  void set_date_time(const TDate& date, long hhmmss = 0);
 | 
						|
  const TDate& date() const { return _date; }
 | 
						|
  long time() const { return _hms; }
 | 
						|
 | 
						|
  int recipients() const { return _recipients.items(); }
 | 
						|
  const TString& recipient(int n = 0) const;
 | 
						|
  
 | 
						|
  TMail_message(const char* recipient = NULL, const char* subject = NULL, 
 | 
						|
                const char* text = NULL, const char* sender = NULL);
 | 
						|
  virtual ~TMail_message() { }
 | 
						|
};
 | 
						|
 | 
						|
class TMail_messages : public TArray
 | 
						|
{
 | 
						|
public:
 | 
						|
  int get(const char* sender = NULL, const char* subject = NULL, 
 | 
						|
          const char* body = NULL, bool attachments = false, bool mark_as_read = false);
 | 
						|
 | 
						|
  bool send(bool hide_ui = true);
 | 
						|
  bool remove();
 | 
						|
 | 
						|
  TMail_message& msg(int i) 
 | 
						|
  { return (TMail_message&)(*this)[i]; }
 | 
						|
  
 | 
						|
  const TMail_message& msg(int i) const 
 | 
						|
  { return (const TMail_message&)(*this)[i]; }
 | 
						|
  
 | 
						|
  TMail_messages();
 | 
						|
  virtual ~TMail_messages() { }
 | 
						|
};
 | 
						|
 | 
						|
#endif
 |