home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / apitab.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.9 KB  |  100 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 _APITAB_H
  20. #define _APITAB_H
  21.  
  22. #ifndef __APIAPI_H
  23.     #include "apiapi.h"
  24. #endif
  25. #ifndef __NSGUIDS_H
  26.     #include "nsguids.h"
  27. #endif
  28.  
  29. #define    APICLASS_TABCONTROL    "TabControl"
  30.  
  31. //
  32. // Message send to parent
  33. //
  34.  
  35. // Notify that a tab is about the change. The message handler
  36. // can return non-zero to prevent the user from changing
  37. // the tab.
  38. #ifndef TCM_TABCHANGING
  39. #define TCM_TABCHANGING        (WM_USER + 200)
  40. #endif
  41.  
  42. // Notify tab changed. The message handler can use
  43. // GetCurSel to determine the new page.
  44. #ifndef TCM_TABCHANGED
  45. #define TCM_TABCHANGED        (WM_USER + 201)
  46. #endif
  47.  
  48. #undef INTERFACE
  49. #define INTERFACE ITabControl
  50.  
  51. DECLARE_INTERFACE_(ITabControl, IUnknown)
  52. {
  53. // Attributes
  54.     // Returns the height of the tab control
  55.     STDMETHOD_(int, GetHeight) (THIS) const PURE;
  56.  
  57.     // Returns the currently selected tag (0 based index)
  58.     STDMETHOD_(int, GetCurSel) (THIS) const PURE;
  59.     
  60.     // Returns the number of tabs
  61.     STDMETHOD_(int, GetItemCount) (THIS) const PURE;
  62.     
  63.     // Returns the HWND of the tab control
  64.     STDMETHOD_(HWND, GetHWnd) (THIS) const PURE;
  65.  
  66.     // Returns the tab under a given point (in client coords)
  67.     STDMETHOD_(int, TabFromPoint) (const POINT *pt) PURE;
  68.  
  69. // Operations
  70.     // Creates a TabControl. Takes normal window styles.
  71.     STDMETHOD(Create) (THIS_ DWORD dwStyle, const RECT *rect, HWND hParent, UINT nID) PURE;
  72.     
  73.     // Adds a tab with caption and image with index iImage (-1 for no image)
  74.     STDMETHOD(AddTab) (THIS_ LPCTSTR lpszCaption, int iImage) PURE;
  75.     
  76.     // Removed tab nTab (0 based index)
  77.     STDMETHOD(RemoveTab) (THIS_ int nTab) PURE;
  78.     
  79.     // Show/Hide tab nTab (0 based index)
  80.     STDMETHOD(ShowTab) (THIS_ int nTab, BOOL bShow = TRUE) PURE;
  81.  
  82.     // Select tab nTab (0 based index)
  83.     STDMETHOD(SetCurSel) (THIS_ int nTab) PURE;
  84.     
  85.     // Sets the bitmap for the tab images
  86.     STDMETHOD(LoadBitmap) (THIS_ UINT id) PURE;
  87.     
  88.     // Set the size of each tab image
  89.     STDMETHOD(SetSizes) (THIS_ const SIZE *size) PURE;
  90.  
  91.     // Change the text of a tab
  92.     STDMETHOD(SetText) (THIS_ int idx, LPCSTR lpszCaption) PURE;
  93. };
  94.  
  95. typedef ITabControl * LPTABCONTROL;
  96.  
  97. #define ApiTabControl(v,unk) APIPTRDEF(IID_ITabControl,ITabControl,v,unk)
  98.  
  99. #endif
  100.