home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / mnprefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  7.1 KB  |  310 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef _MNPREFS_H
  20. #define _MNPREFS_H
  21.  
  22. #ifdef MOZ_MAIL_NEWS
  23. #include "property.h"
  24. #include "dirprefs.h"
  25. #include "mailmisc.h"
  26.  
  27. #define MAX_HOSTNAME_LEN     256    //include '\0'
  28. #define MAX_DESCRIPTION_LEN    1024    //include '\0'
  29. #define MAX_PORT_NUMBER        65535
  30.  
  31. typedef enum
  32. {
  33.   FROM_SUBSCRIBEUI,
  34.   FROM_FOLDERPANE,
  35.   FROM_PREFERENCE
  36. };
  37.  
  38. class CMailFolderCombo;
  39. class CMailServerPropertySheet;
  40.  
  41. class CChooseFolderDialog : public CDialog 
  42. {
  43. // Attributes
  44. public:
  45.  
  46.     CString m_szFolder;
  47.     CString m_szServer;
  48.     CString m_szPrefUrl;
  49.  
  50.     CChooseFolderDialog(CWnd* pParent = NULL, char *pFolderPath = NULL, int nType = 0 );
  51.  
  52.     enum { IDD = IDD_PREF_CHOOSE_FOLDER};
  53.  
  54.  
  55.     //{{AFX_VIRTUAL(CChooseFolderDialog)
  56.     protected:
  57.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  58.     //}}AFX_VIRTUAL
  59.  
  60. // Implementation
  61. protected:
  62.  
  63.     int m_nDefaultID;
  64.     CMailFolderCombo m_FolderCombo;
  65.     CMailFolderCombo m_ServerCombo;
  66.     char* m_pFolderPath;
  67.  
  68.     virtual void OnOK();
  69.     virtual BOOL OnInitDialog();
  70.  
  71.     afx_msg void OnNewFolder();
  72.     DECLARE_MESSAGE_MAP()
  73. };
  74.  
  75. /////////////////////////////////////////////////////////////////////////////
  76. // CGeneralServerPage  
  77. //
  78. class CGeneralServerPage : public CPropertyPage
  79. {
  80. public:
  81.  
  82.     CGeneralServerPage(CWnd *pParent, const char* pName);
  83.     
  84.     enum { IDD = IDD_MAILSERVER_GENERAL };
  85.  
  86.  
  87.     CMailServerPropertySheet* m_pParent;
  88.  
  89.     BOOL ProcessOK();
  90.  
  91.     //{{AFX_VIRTUAL(CGeneralServerPage)
  92.     protected:
  93.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  94.     //}}AFX_VIRTUAL
  95.  
  96.     virtual BOOL OnInitDialog();
  97.  
  98. protected: 
  99.  
  100.     CString m_szServerName;
  101.  
  102.     afx_msg void OnChangeServerType();
  103.     DECLARE_MESSAGE_MAP()
  104. };
  105.  
  106. /////////////////////////////////////////////////////////////////////////////
  107. // CPopServerPage  
  108. class CPopServerPage : public CPropertyPage
  109. {
  110. public:
  111.  
  112.     CPopServerPage(CWnd *pParent);
  113.     
  114.     enum { IDD = IDD_MAILSERVER_POP };
  115.  
  116.     BOOL ProcessOK();
  117.  
  118.     //{{AFX_VIRTUAL(CPopServerPage)
  119.     protected:
  120.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  121.     //}}AFX_VIRTUAL
  122.  
  123.     virtual BOOL OnInitDialog();
  124.  
  125. protected: 
  126.  
  127.     DECLARE_MESSAGE_MAP()
  128. };
  129.  
  130. /////////////////////////////////////////////////////////////////////////////
  131. // CIMAPServerPage  
  132. class CIMAPServerPage : public CPropertyPage
  133. {
  134. public:
  135.  
  136.     CIMAPServerPage(CWnd *pParent, const char* pName);
  137.     
  138.     enum { IDD = IDD_MAILSERVER_IMAP };
  139.  
  140.     CMailServerPropertySheet* m_pParent;
  141.     XP_Bool    GetUseSSL();
  142.     BOOL ProcessOK();
  143.  
  144.     //{{AFX_VIRTUAL(CIMAPServerPage)
  145.     protected:
  146.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  147.     //}}AFX_VIRTUAL
  148.  
  149.     virtual BOOL OnInitDialog();
  150.  
  151. protected: 
  152.  
  153.     CString m_szServerName;
  154.  
  155.     DECLARE_MESSAGE_MAP()
  156. };
  157.  
  158. /////////////////////////////////////////////////////////////////////////////
  159. // CIMAPAdvancedPage  
  160. class CIMAPAdvancedPage : public CPropertyPage
  161. {
  162. public:
  163.  
  164.     CIMAPAdvancedPage(CWnd *pParent, const char* pName);
  165.     
  166.     enum { IDD = IDD_MAILSERVER_ADVANCED };
  167.  
  168.     CMailServerPropertySheet* m_pParent;
  169.  
  170.     void GetPersonalDir(char* pDir, int nLen);
  171.     void GetPublicDir(char* pDir, int nLen);
  172.     void GetOthersDir(char* pDir, int nLen);
  173.     XP_Bool GetOverrideNameSpaces();
  174.     BOOL ProcessOK();
  175.  
  176.  
  177.     //{{AFX_VIRTUAL(CIMAPAdvancedPage)
  178.     protected:
  179.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  180.     //}}AFX_VIRTUAL
  181.  
  182.     virtual BOOL OnInitDialog();
  183.  
  184. protected: 
  185.  
  186.     CString m_szServerName;
  187.  
  188.     DECLARE_MESSAGE_MAP()
  189. };
  190.  
  191. /////////////////////////////////////////////////////////////////////////////
  192. // CMailServerPropertySheet
  193. //
  194. class CMailServerPropertySheet : public CPropertySheet
  195. {
  196. public:
  197.  
  198.     CMailServerPropertySheet(CWnd *pParent, const char* pTitle, const char* pName, 
  199.                     int nType = -1, BOOL bEdit = FALSE, BOOL bBothType = FALSE);
  200.     ~CMailServerPropertySheet();
  201.     
  202.     BOOL    IsPopServer() { return m_bPop; }
  203.     BOOL    EditServer() { return m_bEdit; }
  204.     BOOL    AllowBothTypes() { return m_bBothType; }
  205.     char*    GetMailHostName() { return m_hostName; }
  206.     void    SetMailHostName(char* pName);
  207.     XP_Bool    GetIMAPUseSSL();
  208.     void    GetIMAPPersonalDir(char* pDir, int nLen);
  209.     void    GetIMAPPublicDir(char* pDir, int nLen);
  210.     void    GetIMAPOthersDir(char* pDir, int nLen);
  211.     XP_Bool GetIMAPOverrideNameSpaces();
  212.  
  213.     void    ShowHidePages(int nShowType);
  214.  
  215.     //In Win16, GetActivePage() is a protected
  216.     CPropertyPage*  GetCurrentPage() 
  217.         { return (CPropertyPage*)GetActivePage();    }
  218.  
  219.     virtual void OnHelp();
  220.  
  221. protected:
  222.  
  223.     BOOL m_bPop;
  224.     BOOL m_bEdit;
  225.     BOOL m_bBothType;
  226.     CGeneralServerPage* m_pGeneralPage;
  227.     CPopServerPage* m_pPopPage;
  228.     CIMAPServerPage* m_pIMAPPage;
  229.     CIMAPAdvancedPage* m_pAdvancedPage;
  230.     char m_hostName[MAX_HOSTNAME_LEN];
  231.  
  232.     BOOL IsPageValid(CPropertyPage* pPage);
  233.  
  234. #ifdef _WIN32
  235.     virtual BOOL OnInitDialog();
  236. #else
  237.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  238. #endif
  239.     afx_msg void OnOK();
  240.     DECLARE_MESSAGE_MAP()
  241. };
  242.  
  243. /////////////////////////////////////////////////////////////////////////////
  244. // CNewsServerDialog
  245. //
  246. class CNewsServerDialog : public CDialog 
  247. {
  248. // Attributes
  249. public:
  250.  
  251.     CNewsServerDialog(CWnd* pParent, const char* pName, int nFromWhere, MSG_NewsHost *pHost = NULL);
  252.  
  253.     enum { IDD = IDD_NEWSGROUP_ADDSERVER };
  254.  
  255.     char* GetNewsHostName() { return m_hostName; }
  256.     XP_Bool GetSecure() { return m_bIsSecure; }
  257.     XP_Bool GetAuthentication() { return m_bAuthentication; }
  258.     int32 GetNewsHostPort() { return m_lPort; }
  259.  
  260.     //{{AFX_VIRTUAL(CNewNewsgroupsPage)
  261.     protected:
  262.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  263.     //}}AFX_VIRTUAL
  264.  
  265.     virtual BOOL OnInitDialog();
  266.  
  267.     // Implementation
  268. protected:
  269.  
  270.     char    m_hostName[MSG_MAXGROUPNAMELENGTH];
  271.     XP_Bool    m_bIsSecure;
  272.     XP_Bool    m_bAuthentication;
  273.     int     m_nFromWhere;
  274.     int32    m_lPort;
  275.     MSG_NewsHost* m_pEditHost;
  276.  
  277.     BOOL NewsHostExists();
  278.     BOOL IsSameServer(MSG_Host *pHost);
  279.     int32 GetPortNumber();
  280.  
  281.     afx_msg void OnOK();
  282.     afx_msg void OnCheckSecure();
  283.     afx_msg void OnHelp();
  284.     DECLARE_MESSAGE_MAP()
  285. };
  286.  
  287. #endif /* MOZ_MAIL_NEWS */
  288.  
  289. class CDirDialog : public CFileDialog 
  290. {
  291. // Attributes
  292. public:
  293.  
  294.     CDirDialog(CWnd* pParent, LPCTSTR pInitDir);    
  295.  
  296.     //{{AFX_VIRTUAL(CDirDialog)
  297.     protected:
  298.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  299.     //}}AFX_VIRTUAL
  300.  
  301. // Implementation
  302. protected:
  303.  
  304.     char m_szIniFile[1024];
  305.  
  306.     DECLARE_MESSAGE_MAP()
  307. };
  308.  
  309. #endif // _MNPREFS_H
  310.