#if !defined(__alffmdlg_h)              // Sentry, use file only if it's not already included.
#define __alffmdlg_h
/*  Project Tec3270

	 SUBSYSTEM:    Tec3270.exe (Tec3270 application)
	 FILE:         alffmdlg.h
	 AUTHOR:       Alcindo Ferreira Filho

	 OVERVIEW:
	 ALFFSessSelect,  ALFFAutoConnect, ALFFChooseFontDialog,
    ALFFFontOptionsDialog, and ALFFSecurityOptions
    Classes Definition, main Tec3270 application options
    dialogs.

    COPYRIGHT:    © 1998-2007
                  Alcindo Ferreira Filho
                  <alcindo@inttec.com.br>

    LICENSE:      Tec3270_License (docs/Tec3270_License.txt)
*/
#include "alffnaux.h"
#include "alffmsgs.h"   //* TecLib Message Object Include */
#include "alffinif.h"   //* TecLib Ini File Object Include */
#include "alffnmdc.h"
#include "alfflogf.h"   //* TecLib Log File Object Include */
#include "alffnttl.h"
#include "alff3270.h"
#include "alffntsc.h"
#include "alffstat.h"   //* TecLib Static Control
#include "tec3270.rh"   //* Definition of all resources.

/////////////////////////////////////////////////////////////////////
// ALFFMDIClient Dialogs
//

/* Sessions To Automate Selection Dialog */
//{{ALFFSessSelect}}
class ALFFSessSelect : public ALFFDialog
{
 public:
  ALFFSessSelect(TWindow* Parent);
  virtual ~ALFFSessSelect();
  char far* GetClassName() {return "ALFFSessSelect";}
  char* ExecuteSel();

 protected:
  void SetupWindow();
  void CmOk();
  void CmHelp();
  void EvPaint();
  void NotifyList(UINT code);
  ALFFMsgs* 	pMsgs;
  ALFFIniFile* iniFile;
  TListBox* 	keyList;
  UINT 			selIndex;
  char* far   	sessList;
  int*      	sessIndex;
  bool      	sessExist;

 DECLARE_RESPONSE_TABLE(ALFFSessSelect);
};

/* Automatic Connection Dialog */
class ALFFAutoConnect : public ALFFDialog
{
 public:
  ALFFAutoConnect (TWindow* parent,
						 TResId idDlg);
  ~ALFFAutoConnect();
  char far* GetClassName() {return "ALFFAutoConnect";}
 protected:
	 void 		SetupWindow();
	 void       BuildAutoName(char* autoName, const UINT sessNum,
									  const char* sessName);
	 bool       NewAutomation(char* autoName);
	 bool       DelAutomation(const UINT sessNum);
	 bool			ChangeAutomation(const UINT sessNum, const char* connName);
	 bool       LoadAutomations();
	 bool       RenumAutomations();
	 void       CmOk();
	 void       CmHelp();
	 LRESULT    EvCommand(uint controlId, HWND , uint notifyCode);
	 TWindow*       	acParent;
	 ALFFIniFile*     iniFile;
	 ALFFMsgs*        pMsgs;

	 /* Session Automation Controls     */
	 TListBox*     autoListBox;
    TCheckBox*    checkInact;
	 char* far     autoList;
	 bool          autoExist;
    bool          autoInact;
	 int           lastAutoNumber;
	 int           autoSelIndex;
};


/* Choose Font Dialog For Centering it on Screen */
class
ALFFChooseFontDialog : public TChooseFontDialog
{
 public:
	 class TData : public TChooseFontDialog::TData
	  {
		public:
		 bool AutomaticWindowSizing;
		 bool AutomaticFontSizing;
	  };
	 ALFFChooseFontDialog(TWindow* parent,
								 ALFFChooseFontDialog::TData& fData,
								 const char far* title = 0,
								 bool showOptions = false,
								 TModule* module = 0);
	 virtual ~ALFFChooseFontDialog();
    char far* GetClassName() {return "ALFFChooseFontDialog";}
 protected:
	 TData&       Data;
	 bool         fontOptions;
	 TButton*     optionsButton;
	 TCheckBox*   windowSizing;
	 TCheckBox*   fontSizing;
	 virtual void SetupWindow();
    void         CmHelp();
	 LRESULT      EvCommand(uint controlId, HWND hwnd, uint notifyCode);
};

/* Font Options Dialog For Window and Font Automatic Sizing */
class
ALFFFontOptionsDialog : public ALFFDialog
{
 public:
	 ALFFFontOptionsDialog(TWindow* parent,
								  ALFFChooseFontDialog::TData& fData);
	 virtual ~ALFFFontOptionsDialog();
    char far* GetClassName() {return "ALFFFontOptionsDialog";}
 protected:
	 ALFFChooseFontDialog::TData& Data;
	 TCheckBox*   windowSizing;
	 TCheckBox*   fontSizing;
	 void         CmOk();
	 void         CmHelp();
	 virtual void SetupWindow();
	 LRESULT      EvCommand(uint controlId, HWND hwnd, uint notifyCode);
};

/* Automatic Connection Dialog */
class ALFFSecurityOptions : public ALFFDialog
{
 public:
  		ALFFSecurityOptions (TWindow* parent,
                           TResId idDlg = IDD_ALFFSECURITYOPTIONSDLG);
  		~ALFFSecurityOptions();
      char far* GetClassName() {return "ALFFSecurityOptions";}
 protected:
	 	void 				SetupWindow();
	 	void       		CmOk();
      void           CmHelp();
	 	LRESULT    		EvCommand(uint controlId, HWND , uint notifyCode);
	 	TWindow*         secParent;
	 	ALFFIniFile*     iniFile;
	 	ALFFMsgs*        pMsgs;

    	/* Options selected */
    	bool			  verifyServerCert;
    	bool          verifyRevoked;
    	int           telnetTLSMethod;

	 	/* Session Automation Controls     */
    	TCheckBox*    verifyServerCertCheck;     // IDC_ALFFSECVERIFYSERVER
    	TCheckBox*    verifyRevokedCheck;     	  // IDC_ALFFSECVERIFYREVOKED
    	TGroupBox*    telnetTLSMethodGroup;      // IDC_ALFFSECTLSMETHODGRP
    	TRadioButton* sslv3Radio;                // IDC_ALFFSECTLSMETHODSSLV3
    	TRadioButton* tlsv1Radio;                // IDC_ALFFSECTLSMETHODTLSV1
};
#endif    // __alffmdlg_h sentry.
