home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / LdapSearchFrame.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.1 KB  |  74 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.    LdapSearchFrame.cpp -- Ldap Search window stuff.
  20.    Created: Dora Hsu<dora@netscape.com>, 16-Dec-96.
  21.  */
  22.  
  23. #include "LdapSearchFrame.h"
  24. #include "LdapSearchView.h"
  25. #include "xpassert.h"
  26.  
  27. static XFE_LdapSearchFrame *theFrame = NULL;
  28.  
  29. XFE_LdapSearchFrame::XFE_LdapSearchFrame(Widget toplevel,
  30.                                          XFE_Frame *parent_frame,
  31.                                          Chrome *chromespec)
  32.         : XFE_Frame("Ldap", toplevel, parent_frame,
  33.                     FRAME_LDAP_SEARCH, chromespec, False, False, False, False, True /* destroyOnClose */)
  34. {
  35.  
  36.   XFE_LdapSearchView *view = new XFE_LdapSearchView(this, 
  37.                                                     getViewParent(), 
  38.                                                     this,
  39.                                                     NULL, 
  40.                                                     m_context, 
  41.                                                     NULL);
  42.  
  43.   view->createWidgets(view->getBaseWidget());
  44.   setView(view);
  45.  
  46.   registerInterest(XFE_LdapSearchView::CloseLdap, this,
  47.         (XFE_FunctionNotification)close_cb);
  48.  
  49.   view->show();
  50. }
  51.  
  52. XFE_LdapSearchFrame::~XFE_LdapSearchFrame()
  53. {
  54.     theFrame = NULL;
  55. }
  56.  
  57. XFE_CALLBACK_DEFN(XFE_LdapSearchFrame, close)(XFE_NotificationCenter */*obj*/,
  58.             void * /*clientData*/, 
  59.             void */*callData*/) 
  60. {
  61.     delete_response();
  62. }
  63.  
  64.  
  65. extern "C" MWContext*
  66. fe_showLdapSearch(Widget toplevel, XFE_Frame *parent_frame, Chrome *chromespec)
  67. {
  68.   if (theFrame == NULL)
  69.         theFrame = new XFE_LdapSearchFrame(toplevel, parent_frame, chromespec);
  70.   theFrame->show();
  71.  
  72.   return theFrame->getContext();
  73. }
  74.