home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / apiaddr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  5.2 KB  |  232 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 __APIADDR_H
  19. #define __APIADDR_H
  20.  
  21. #ifndef __APIAPI_H
  22.     #include "apiapi.h"
  23. #endif
  24. #ifndef __NSGUIDS_H
  25.     #include "nsguids.h"
  26. #endif
  27.  
  28. class IAddressParent
  29. {
  30. public:
  31.     virtual void AddedItem (
  32.         HWND hwnd,
  33.         LONG id,
  34.         int index
  35.         ) = 0;
  36.  
  37.     virtual int ChangedItem (
  38.         char * pString,
  39.         int index,
  40.         HWND hwnd,
  41.         char ** ppFullName,
  42.         unsigned long* entryID,
  43.         UINT* bitmapID
  44.         ) = 0;
  45.  
  46.     virtual void DeletedItem (
  47.         HWND hwnd,
  48.         LONG id,
  49.         int index
  50.         ) = 0;
  51.  
  52.     virtual char * NameCompletion (
  53.         char * pString
  54.         ) = 0;
  55. };
  56.  
  57. typedef IAddressParent * LPADDRESSPARENT;
  58.  
  59. // Address control API
  60.  
  61. #define    APICLASS_ADDRESSCONTROL   "AddressControl"
  62.  
  63. typedef struct {
  64.     ULONG ulHeaderType;
  65.     char * szAddress;
  66.     UINT idBitmap;
  67.     ULONG idEntry;
  68. } NSADDRESSLIST;
  69.  
  70. typedef NSADDRESSLIST * LPNSADDRESSLIST;
  71.  
  72. #define WM_CHILDLOSTFOCUS           WM_USER+600
  73. #define    WM_LEAVINGLASTFIELD            WM_USER+601
  74. #define WM_UPDATEHEADERTYPE         WM_USER+602
  75. #define WM_UPDATEHEADERCONTENTS     WM_USER+603
  76. #define WM_NOTIFYSELECTIONCHANGE    WM_USER+604
  77. #define WM_DISPLAYTYPELIST          WM_USER+605
  78.  
  79. class CNSAddressList;
  80. class CNSAddressTypeControl;
  81.  
  82. class IAddressControl 
  83. {
  84. public:
  85.     virtual BOOL AddAddressType (
  86.         char * pszChoice, 
  87.         UINT pidBitmap = 0, 
  88.         BOOL bExpand = TRUE,
  89.         BOOL bHidden = FALSE,
  90.         BOOL bExclusive = FALSE,
  91.         DWORD dwUserData = 0
  92.         ) = 0;
  93.  
  94.     virtual void SetDefaultBitmapId (
  95.         int id = 0
  96.         ) = 0;
  97.  
  98.     virtual int GetDefaultBitmapId (
  99.         void
  100.         ) = 0;
  101.  
  102.     virtual BOOL RemoveSelection (
  103.         int nIndex = -1
  104.         ) = 0;
  105.  
  106.     virtual int    AppendEntry (
  107.         BOOL expandName = TRUE,
  108.         LPCTSTR szType = 0,
  109.         LPCTSTR szName = 0,
  110.         UINT idBitmap = 0,
  111.         unsigned long idEntry = 0
  112.         ) = 0; 
  113.  
  114.     virtual int    InsertEntry(
  115.         int nIndex,
  116.         BOOL expandName = TRUE,
  117.         LPCTSTR szType = 0,
  118.         LPCTSTR szName = 0,
  119.         UINT idBitmap = 0,
  120.         unsigned long idEntry = 0
  121.         ) = 0;
  122.  
  123.     virtual BOOL SetEntry ( 
  124.         int nIndex, 
  125.         LPCTSTR szType = 0,
  126.         LPCTSTR szName = 0,
  127.         UINT idBitmap = 0,
  128.         unsigned long idEntry = 0
  129.         ) = 0;
  130.  
  131.     virtual BOOL GetEntry ( 
  132.         int nIndex, 
  133.         char ** szType = 0,
  134.         char ** szName = 0,
  135.         UINT * idBitmap = 0,
  136.         unsigned long * idEntry = 0
  137.         ) = 0;
  138.  
  139.    virtual int GetItemFromPoint(
  140.         LPPOINT point
  141.         ) = 0;
  142.  
  143.     virtual BOOL DeleteEntry ( 
  144.         int nIndex 
  145.         ) = 0;
  146.  
  147.     virtual int    FindEntry ( 
  148.         int nStart, 
  149.         LPCTSTR lpszName 
  150.         ) = 0;
  151.  
  152.     virtual BOOL Create (
  153.         CWnd *pParent, 
  154.         int id = 1000
  155.         ) = 0;
  156.  
  157.     virtual CListBox * GetAddressTypeComboBox (
  158.         void 
  159.         ) = 0;
  160.  
  161.     virtual CEdit * GetAddressNameField ( 
  162.         void 
  163.         ) = 0;
  164.  
  165.     virtual void SetItemName (
  166.         int nIndex, 
  167.         char * text
  168.         ) = 0;
  169.  
  170.     virtual void SetItemBitmap ( 
  171.         int nIndex, 
  172.         UINT id
  173.         ) = 0;
  174.  
  175.     virtual void SetItemEntryID ( 
  176.         int nIndex, 
  177.         unsigned long id
  178.         ) = 0;
  179.  
  180.     virtual void SetControlParent ( 
  181.         LPADDRESSPARENT pIAddressParent
  182.         ) = 0;
  183.  
  184.     virtual int GetAddressList (
  185.         LPNSADDRESSLIST * ppAdressList
  186.         ) = 0;
  187.  
  188.     virtual int SetAddressList (
  189.         LPNSADDRESSLIST pAddressList,
  190.         int count
  191.         ) = 0;
  192.  
  193.     virtual CListBox * GetListBox(
  194.         void
  195.         ) = 0;
  196.  
  197.     virtual BOOL IsCreated(
  198.         void
  199.         ) = 0;
  200.     virtual int SetSel(
  201.         int nIndex,
  202.         BOOL bSelected
  203.         ) = 0;
  204.  
  205. #define ADDRESS_TYPE_FLAG               UINT
  206. #define ADDRESS_TYPE_FLAG_VALUE         0x1
  207. #define ADDRESS_TYPE_FLAG_HIDDEN        0x2
  208. #define ADDRESS_TYPE_FLAG_EXCLUSIVE     0x4
  209. #define ADDRESS_TYPE_FLAG_BITMAP        0x8
  210. #define ADDRESS_TYPE_FLAG_USER          0x10
  211.  
  212.     virtual void GetTypeInfo(
  213.         int nIndex, 
  214.         ADDRESS_TYPE_FLAG flag, 
  215.         void ** value
  216.         ) = 0;
  217.  
  218.     virtual void EnableParsing(
  219.         BOOL bParse = TRUE
  220.         ) = 0;
  221.  
  222.     virtual void SetCSID (
  223.         int16 csid = 0
  224.         ) = 0;
  225.   };
  226.  
  227. typedef IAddressControl * LPADDRESSCONTROL;
  228.  
  229. #define ApiAddressControl(v,unk) APIPTRDEF(IID_IAddressControl,IAddressControl,v,unk)
  230.  
  231. #endif
  232.