home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / srchdlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.4 KB  |  270 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. #ifndef _srchdlg_h_
  19. #define _srchdlg_h_
  20.  
  21. // SRCHDLG.H
  22. //
  23. // DESCRIPTION:
  24. //        This file contains the declarations for basic/advanced
  25. //        ldap search dialog
  26. //
  27.  
  28. #ifdef FEATURE_BUTTONPROPERTYPAGE
  29. #include "butprop.h"
  30. #endif
  31.  
  32. #include "srchobj.h"
  33. #include "mnrccln.h"
  34.  
  35.  
  36. #ifndef LDS_GETSEARCHPANE
  37. #define LDS_GETSEARCHPANE    (WM_USER + 225)
  38. #define LDS_GETSERVER        (WM_USER + 226)
  39. #define LDS_RECALC_LAYOUT    (WM_USER + 227)
  40. #endif
  41.  
  42. /****************************************************************************
  43. *
  44. *    Class: CSearchDialog
  45. *
  46. *    DESCRIPTION:
  47. *        This class is the property sheet window for editing all the attributes
  48. *        of the people types in the address book
  49. *
  50. ****************************************************************************/
  51.  
  52. typedef enum _ButtonPosition    // Normally in butprop.h.
  53. {
  54.     BUTTON_RIGHT,
  55.     BUTTON_BOTTOM,
  56.     BUTTON_NONE
  57. } ButtonPosition;
  58.  
  59. #ifdef FEATURE_BUTTONPROPERTYPAGE
  60. class CSearchDialog : public CButtonPropertySheet
  61. #else
  62. class CSearchDialog : public CWnd
  63. #endif
  64. {
  65. protected:
  66. #ifdef FEATURE_BUTTONPROPERTYPAGE
  67.     CButtonPropertyPage * m_pAdvancedSearch;
  68.     CButtonPropertyPage * m_pBasicSearch;
  69. #else
  70.     CDialog* m_pAdvancedSearch;
  71.     CDialog* m_pBasicSearch;
  72. public:
  73.     int DoModal() { return 0; }
  74. protected:
  75. #endif
  76.  
  77.     MSG_Pane* m_pSearchPane;
  78.     DIR_Server* m_pServer;
  79.  
  80. public:
  81.     
  82.     HFONT        m_pFont;
  83.  
  84. public:
  85.     CSearchDialog (UINT nIDCaption, 
  86.         MSG_Pane* pSearchPane,
  87.         DIR_Server* pServer,
  88.         CWnd* pParentWnd = NULL,
  89.         UINT numButtons = 0, 
  90.         ButtonPosition buttonPosition = BUTTON_NONE, 
  91.         CUIntArray* buttonLabels = NULL);
  92.     CSearchDialog (
  93.         LPCTSTR lpszCaption,
  94.         MSG_Pane* pSearchPane,
  95.         DIR_Server* pServer,
  96.         CWnd * parent = NULL,
  97.         UINT numButtons = 0, 
  98.         ButtonPosition buttonPosition = BUTTON_NONE,
  99.         CPtrArray* buttonLabels = NULL); 
  100.     virtual ~CSearchDialog ( );    
  101.     virtual void OnHelp();
  102.     virtual void OnButton2();       
  103.     virtual void OnButton3();           
  104.     virtual void OnButton4();       
  105.  
  106. protected:
  107.     // Overrides
  108.     // ClassWizard generate virtual function overrides
  109.     //{{AFX_VIRTUAL(CSearchDialog)
  110.     public:
  111.     virtual void PostNcDestroy();
  112.     //}}AFX_VIRTUAL
  113.  
  114.     // Implementation
  115. protected:
  116.     // Generated message map functions
  117.     //{{AFX_MSG(CSearchDialog)
  118.         // NOTE: the ClassWizard will add member functions here
  119.     afx_msg int OnCreate( LPCREATESTRUCT );
  120.     afx_msg LRESULT OnGetServer(WPARAM, LPARAM);
  121.     afx_msg LRESULT OnGetSearchPane(WPARAM, LPARAM);
  122.     afx_msg LRESULT OnRecalcLayout(WPARAM, LPARAM);
  123.     //}}AFX_MSG
  124.  
  125.     DECLARE_MESSAGE_MAP()
  126. };
  127.  
  128.  
  129. /****************************************************************************
  130. *
  131. *    Class: CAdvancedSearch
  132. *
  133. *    DESCRIPTION:
  134. *
  135. ****************************************************************************/
  136.  
  137. #ifdef FEATURE_BUTTONPROPERTYPAGE
  138. class CAdvancedSearch : public CButtonPropertyPage
  139. #else
  140. class CAdvancedSearch : public CDialog
  141. #endif
  142. {
  143.  
  144. // Construction
  145. public:
  146.     CAdvancedSearch(CWnd *pParent);
  147.     virtual ~CAdvancedSearch();
  148.  
  149. // Dialog Data
  150.     //{{AFX_DATA(CAddressUser)
  151.     enum { IDD = IDD_ADVANCED_LDAP_SEARCH };
  152.  
  153.     //}}AFX_DATA
  154.  
  155. // Overrides
  156.     // ClassWizard generate virtual function overrides
  157.     //{{AFX_VIRTUAL(CAdvancedSearch)
  158.     public:
  159.     virtual BOOL OnInitDialog();
  160.     protected:
  161.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  162.     //}}AFX_VIRTUAL
  163.  
  164.     // Overridables
  165.     public:
  166.     void InitializePrevSearch();
  167.  
  168.  
  169. // Implementation
  170. protected:
  171.  
  172. #ifndef ON_UPDATE_COMMAND_UI_RANGE
  173.     virtual BOOL OnCmdMsg( UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo );  
  174. #endif
  175.     // Generated message map functions
  176.     //{{AFX_MSG(CAdvancedSearch)
  177.         // NOTE: the ClassWizard will add member functions here
  178.     afx_msg void OnMore();
  179.     afx_msg void OnFewer();
  180.     afx_msg void OnSearch();
  181.     afx_msg void OnClearSearch();
  182.     afx_msg void OnAttrib1();
  183.     afx_msg void OnAttrib2();
  184.     afx_msg void OnAttrib3();
  185.     afx_msg void OnAttrib4();
  186.     afx_msg void OnAttrib5();
  187.     afx_msg    void OnAndOr();
  188.     afx_msg void OnOK();
  189.     afx_msg void OnUpdateQuery( CCmdUI *pCmdUI );
  190.     afx_msg void OnEditValueChanged ();
  191.     afx_msg void OnOperatorValueChanged ();
  192.     virtual BOOL OnSetActive();
  193.     //}}AFX_MSG
  194.  
  195.     DECLARE_MESSAGE_MAP()
  196.  
  197.     void AdjustHeight (int dy);
  198.  
  199. public:
  200.     BOOL SavePreviousSearch ();
  201.  
  202. // Data members
  203. protected:
  204.     CSearchObject m_searchObj;
  205.     int        m_iMoreCount;
  206.     BOOL    m_bLogicType;
  207.     BOOL    m_bChanged;
  208. };
  209.  
  210.  
  211. /****************************************************************************
  212. *
  213. *    Class: CBasicSearch
  214. *
  215. *    DESCRIPTION:
  216. *
  217. ****************************************************************************/
  218. #ifdef FEATURE_BUTTONPROPERTYPAGE
  219. class CBasicSearch : public CButtonPropertyPage
  220. #else
  221. class CBasicSearch : public CDialog
  222. #endif
  223. {
  224.  
  225. // Construction
  226. public:
  227.     CBasicSearch(CWnd *pParent);
  228.     virtual ~CBasicSearch();
  229.  
  230. protected:
  231.     void BuildQuery (MSG_Pane* searchPane, BOOL bLogicType);
  232.  
  233. // Dialog Data
  234.     //{{AFX_DATA(CAddressUser)
  235.     enum { IDD = IDD_BASIC_SEARCH };
  236.  
  237.     //}}AFX_DATA
  238.  
  239. // Overrides
  240.     // ClassWizard generate virtual function overrides
  241.     //{{AFX_VIRTUAL(CBasicSearch)
  242.     public:
  243.     virtual BOOL OnInitDialog();
  244.     virtual BOOL OnSetActive();
  245.     protected:
  246.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  247.     //}}AFX_VIRTUAL
  248.  
  249. // Implementation
  250. protected:
  251.     // Generated message map functions
  252.     //{{AFX_MSG(CBasicSearch)
  253.         // NOTE: the ClassWizard will add member functions here
  254.     afx_msg void OnOK();
  255.     afx_msg void OnEditValueChanged ();
  256.     //}}AFX_MSG
  257.  
  258.     DECLARE_MESSAGE_MAP()
  259.  
  260. public:
  261.     BOOL SavePreviousSearch ();
  262.     void InitializeSearchValues ();
  263.  
  264. protected:
  265.     BOOL     m_bLogicType;
  266.     BOOL    m_bChanged;
  267. };
  268.  
  269. #endif
  270.