/******************************************************************************
 GMailPrefsDialog.h

	Interface for the GMailPrefsDialog class

	Copyright @ 1997 by Glenn W. Bach.

 ******************************************************************************/

#ifndef _H_GMailPrefsDialog
#define _H_GMailPrefsDialog

#include <JXDialogDirector.h>

class JXTextButton;
class JXInputField;
class JXTextCheckbox;
class JXStaticText;
class JString;
class JXIntegerInput;
class JXChooseMonoFont;
class GMCustomFromInput;
class JXRadioGroup;

class GMailPrefsDialog : public JXDialogDirector
{
public:

	GMailPrefsDialog(JXDirector* supervisor,
						const JString& inbox,
						const JString& smtp,
						const JString& smtpuser,
						const JString& repltyto,
						const JBoolean showstate,
						const JString& pop,
						const JString& account,
						const JBoolean usePop,
						const JBoolean leave,
						const JBoolean save,
						const JBoolean useAPop,
						const JBoolean autoQuote,
						const JBoolean autoCheck,
						const JInteger minutes,
						const JBoolean showSender,
						const JString& senderString,
						const JBoolean useFrom,
						const JString& fromLine,
						const JString& fontname,
						const JSize	   fontsize,
						const JSize	   maxQuotedReply,
						const JBoolean reportSCErrors,
						const JSize	   spacesPerTab,
						const JBoolean beepOnNewMail,
						const JIndex   encType);

	virtual ~GMailPrefsDialog();

	void	GetValues(JString* inbox,
						JString* 	smtp,
						JString* 	smtpuser,
						JString*	replyto,
						JBoolean* 	showstate,
						JString* 	pop,
						JString* 	account,
						JBoolean* 	usePop,
						JBoolean* 	leave,
						JBoolean* 	save,
						JBoolean* 	useAPop,
						JBoolean* 	autoQuote,
						JBoolean* 	autoCheck,
						JInteger*	minutes,
						JBoolean*	showSender,
						JString*	senderString,
						JBoolean*	useFrom,
						JString*	fromLine,
						JString* 	fontname,
						JSize*	 	fontsize,
						JSize*		maxQuotedReply,
						JBoolean* 	reportSCErrors,
						JSize*		spacesPerTab,
						JBoolean*	beepOnNewMail,
						JIndex*		encType);
	
protected:
	
	virtual void		Receive(JBroadcaster* sender, const Message& message);

private:

// begin JXLayout

    JXInputField*      itsSMTPServerInput;
    JXInputField*      itsSMTPUserName;
    JXInputField*      itsReplyToAddress;
    JXIntegerInput*    itsMaxReplyInput;
    JXInputField*      itsSenderStringInput;
    JXIntegerInput*    itsSpacesPerTabInput;
    JXIntegerInput*    itsCheckMailDelay;
    JXInputField*      itsPopServerInput;
    JXInputField*      itsPopAccountInput;
    JXTextButton*      itsChooseInboxButton;
    JXStaticText*      itsPOPText3;
    JXTextCheckbox*    itsUsePopButton;
    JXTextCheckbox*    itsLeaveMailButton;
    JXTextCheckbox*    itsSavePasswdButton;
    JXStaticText*      itsPOPText4;
    JXStaticText*      itsInboxText;
    JXTextCheckbox*    itsShowStateInTitle;
    JXTextCheckbox*    itsAutoQuote;
    JXTextCheckbox*    itsUseAPop;
    JXTextCheckbox*    itsAutoCheckMail;
    JXStaticText*      itsPOPText2;
    JXTextCheckbox*    itsShowSenderString;
    JXStaticText*      itsSenderText;
    JXTextCheckbox*    itsFromLineCB;
    JXStaticText*      itsFromLineText;
    JXTextButton*      itsHelpButton;
    JXChooseMonoFont*  itsFontMenu;
    JXTextCheckbox*    itsReportSCErrorsCB;
    GMCustomFromInput* itsFromLineInput;
    JXTextCheckbox*    itsBeepOnNewMailCB;
    JXRadioGroup*      itsEncryptionType;

// end JXLayout

private:

	void	BuildWindow(const JString& inbox,
						const JString& smtp,
						const JString& smtpuser,
						const JString& repltyto,
						const JBoolean showstate,
						const JString& pop,
						const JString& account,
						const JBoolean usePop,
						const JBoolean leave,
						const JBoolean savepasswd,
						const JBoolean useAPop,
						const JBoolean autoQuote,
						const JBoolean autoCheck,
						const JInteger minutes,
						const JBoolean showSender,
						const JString& senderString,
						const JBoolean useFrom,
						const JString& fromLine,
						const JString& fontname,
						const JSize	   fontsize,
						const JSize	   maxQuotedReply,
						const JBoolean reportSCErrors,
						const JSize	   spacesPerTab,
						const JBoolean beepOnNewMail,
						const JIndex   encType);

	void	AdjustForPOP(const JBoolean usePOP);
	void	AdjustForAutoCheck(const JBoolean quote);
	void	AdjustForSenderString(const JBoolean showSender);
	void	AdjustForFromLine(const JBoolean useFrom);
	void	AdjustForQuotedReply(const JBoolean quote);

	// not allowed

	GMailPrefsDialog(const GMailPrefsDialog& source);
	const GMailPrefsDialog& operator=(const GMailPrefsDialog& source);
};

#endif
