home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / abmldlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.6 KB  |  162 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 _abmldlg_h_
  19. #define _abmldlg_h_
  20.  
  21. // ABMLDLG.H
  22. //
  23. // DESCRIPTION:
  24. //        This file contains the declarations of the for the mailing list
  25. //        dialog
  26. //
  27.  
  28. #include "addrfrm.h"
  29. #include "apimsg.h"
  30. #include "xp_core.h"
  31. #include "addrbook.h"
  32. #include "property.h"
  33. #include "apiaddr.h"
  34. #include "mnrccln.h"
  35.  
  36. class CNSAddressList;
  37. class CABMLDialog;
  38. class CABMLDialogEntryList;
  39.  
  40.  
  41. class CMailListDropTarget : public COleDropTarget
  42. {
  43. public:
  44.  
  45.     CABMLDialog* m_pOwner;
  46. //Construction
  47.     CMailListDropTarget(CABMLDialog* pOwner) { m_pOwner = pOwner; }
  48.     BOOL        OnDrop(CWnd *, COleDataObject *, DROPEFFECT, CPoint);
  49.     DROPEFFECT  OnDragOver(CWnd *, COleDataObject *, DWORD, CPoint);
  50. };
  51.  
  52. /****************************************************************************
  53. *
  54. *    Class: CABMLDialog
  55. *
  56. *    DESCRIPTION:
  57. *        This class is the address picker from the compose window
  58. *
  59. ****************************************************************************/
  60. class CABMLDialog : public CDialog,
  61.                     public IAddressParent {
  62. // Attributes
  63. public:
  64.  
  65.     friend class CABMLDialogEntryList;
  66.  
  67. // Dialog Data
  68.     //{{AFX_DATA(CABMLDialog)
  69.     enum { IDD = IDD_ADDRESS_LIST };
  70.     CString    m_description;
  71.     CString    m_name;
  72.     CString    m_nickname;
  73.     //}}AFX_DATA
  74.  
  75. protected:
  76.  
  77.     LPADDRESSCONTROL    m_pIAddressList;
  78.     LPUNKNOWN           m_pUnkAddress;
  79.     int                    m_iMysticPlane;
  80.     HFONT                m_pFont;
  81.  
  82.     LPMSGLIST            m_pIAddrList;
  83.     MLPane                *m_addrBookPane;
  84.     DIR_Server            *m_dir;
  85.     ABID                m_entryID;
  86.     BOOL                m_addingEntries;
  87.     BOOL                m_saved;
  88.     int                    m_errorCode;
  89.     BOOL                m_changingEntry;
  90.  
  91.     CMailListDropTarget *m_pDropTarget;
  92.  
  93.     // Support loading resources from dll
  94.     CMailNewsResourceSwitcher m_MailNewsResourceSwitcher;
  95.  
  96. // Support for IMsgList Interface (Called by CABMLDialogEntryList)
  97.     virtual void ListChangeStarting( MSG_Pane* pane, XP_Bool asynchronous,
  98.                                      MSG_NOTIFY_CODE notify, MSG_ViewIndex where,
  99.                                      int32 num);
  100.     virtual void ListChangeFinished( MSG_Pane* pane, XP_Bool asynchronous,
  101.                                      MSG_NOTIFY_CODE notify, MSG_ViewIndex where,
  102.                                      int32 num);
  103.     void CleanupOnClose();
  104.     void AddEntriesToList(int index, int num);
  105.  
  106.     // IAddressParent stuff
  107.     virtual void AddedItem (HWND hwnd, LONG id,int index);
  108.     virtual int     ChangedItem (char * pString, int index, HWND hwnd, char** ppFullName, unsigned long* entryID, UINT* bitmapID);
  109.     virtual void DeletedItem (HWND hwnd, LONG id,int index);
  110.     virtual char * NameCompletion (char *);
  111.  
  112. // Operations
  113. public:
  114.     CABMLDialog(DIR_Server* dir, CWnd* pParent = NULL, ABID listID = NULL, MWContext* context = NULL);
  115.     ~CABMLDialog();
  116.  
  117.     
  118.     BOOL Create( CWnd *pParent ) { return CDialog::Create( IDD, pParent ); };
  119.  
  120.     enum { ToolInvalid = -1, ToolText = 0, ToolPictures = 1, ToolBoth = 2 };
  121.  
  122.     static void HandleErrorReturn(int errorID, CWnd* parent = NULL);
  123.     MLPane*    GetPane() { return m_addrBookPane; }
  124.     ABID    GetEntryID() { return m_entryID; }
  125.  
  126.     CNSAddressList * GetAddressWidget();
  127.   
  128.     void DoUpdateAddressBook( CCmdUI* pCmdUI, AB_CommandType cmd, BOOL bUseCheck = TRUE );
  129.  
  130.     // Drop
  131.     BOOL IsDragInListBox(CPoint *pPoint);
  132.     BOOL ProcessVCardData(COleDataObject * pDataObject,CPoint &point);
  133.  
  134. // Overrides
  135.     // ClassWizard generated virtual function overrides
  136.     //{{AFX_VIRTUAL(CABMLDialog)
  137.     public:
  138.     virtual  BOOL OnInitDialog( );
  139.     BOOL PreTranslateMessage( MSG* pMsg );
  140.  
  141.     protected:
  142.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  143.     virtual void PostNcDestroy( );
  144.     //}}AFX_VIRTUAL
  145.  
  146. // Implementation
  147. protected:
  148.     // Generated message map functions
  149.     //{{AFX_MSG(CABMLDialog)
  150.     afx_msg int OnCreate( LPCREATESTRUCT );
  151.     afx_msg void OnDestroy( );
  152.     afx_msg void OnOK();
  153.     afx_msg void OnCancel();
  154.     afx_msg void OnRemoveEntry();
  155.     afx_msg void OnHelp();
  156.     //}}AFX_MSG
  157.     DECLARE_MESSAGE_MAP()
  158. };
  159.  
  160.  
  161. #endif
  162.