home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / apichrom.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  5.3 KB  |  173 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 APICHROM_H
  20. #define APICHROM_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_CHROME    "Chrome"
  30. #define APICLASS_NSTOOLBAR "NSToolBar"
  31.  
  32. class CToolbarButton;
  33. class CCustToolbar;
  34.  
  35. class INSToolBar: public IUnknown {
  36.  
  37. public:
  38.     // Initialization
  39.     virtual int Create( CFrameWnd *pParent, 
  40.                         DWORD dwStyle = WS_CHILD|WS_VISIBLE|CBRS_TOP, 
  41.                         UINT nID = AFX_IDW_TOOLBAR ) = 0;
  42.  
  43.     virtual void SetSizes( SIZE sizeButton, 
  44.                            SIZE sizeImage ) = 0;
  45.  
  46.     virtual void SetButtons( const UINT *lpIDArray,
  47.                              int nIDCount, UINT nBitmapID = 0 ) = 0;
  48.     
  49.     virtual void SetButtonStyle( UINT nIDButtonCommand, DWORD dwButtonStyle ) = 0;
  50.     virtual void GetButtonRect( UINT nIDButtonCommand, RECT * pRect ) = 0;
  51.  
  52.     virtual void AddButton( CToolbarButton *pButton, int index = -1 ) = 0;
  53.     
  54.     virtual void RemoveAllButtons() = 0;
  55.  
  56.     virtual CToolbarButton *RemoveButton( int index ) = 0;
  57.  
  58.     virtual BOOL LoadBitmap( LPCSTR lpszResourceName ) = 0;
  59.  
  60.     // State
  61.     virtual void SetToolbarStyle( int nToolbarStyle ) = 0;
  62.  
  63.     virtual void Show( BOOL bShow = TRUE ) = 0;
  64.  
  65.     // should the buttons be the same width or their own size
  66.     virtual void SetButtonsSameWidth(BOOL bSameWidth) = 0;
  67.     // Data Access
  68.     virtual HWND GetHWnd() = 0;
  69. };
  70.  
  71. typedef INSToolBar *LPNSTOOLBAR;
  72.  
  73. class CNetscapeStatusBar;
  74.  
  75. class INSStatusBar: public IUnknown {
  76. public:
  77.     virtual int Create( CWnd* pParentWnd, 
  78.                         DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_BOTTOM, 
  79.                         UINT nID = AFX_IDW_STATUS_BAR,
  80.                         BOOL bSecurity = TRUE, BOOL bTaskbar = TRUE ) = 0;
  81.     
  82.     virtual void Attach( CNetscapeStatusBar *pBar ) = 0;
  83.  
  84.     // Messages
  85.     virtual void SetStatusText(const char * = NULL) = 0;
  86.     virtual const char *GetStatusText() = 0;
  87.  
  88.     // Progress
  89.     virtual void SetProgress(int = 0) = 0;
  90.     virtual int GetProgress() = 0;
  91.     virtual void ProgressComplete() = 0;
  92.         
  93.     // Create/Remove a modal status window
  94.     virtual void ModalStatus( BOOL bModal, UINT uDelay, char * szTitle = NULL ) = 0;
  95.  
  96.     virtual void Show( BOOL bShow = TRUE ) = 0;
  97.  
  98.     virtual HWND GetHWnd() = 0;
  99.  
  100.     // status mode cues    
  101.     virtual void StartAnimation() = 0;
  102.     virtual void StopAnimation() = 0;
  103. };
  104.  
  105. typedef INSStatusBar *LPNSSTATUSBAR;
  106.  
  107. #define ApiToolBar(v,unk) APIPTRDEF(IID_INSToolBar,INSToolBar,v,unk)
  108.  
  109. class INSAnimation: public IUnknown {
  110.  
  111. public:
  112.     virtual void StartAnimation() = 0;
  113.     virtual void StopAnimation() = 0;
  114. };
  115.  
  116. typedef INSAnimation *LPNSANIMATION;
  117.  
  118. #define ApiAnimation(v,unk) APIPTRDEF(IID_INSAnimation,INSAnimation,v,unk)
  119.  
  120. class IChrome: public IUnknown {
  121.  
  122. public:
  123. // Initialization
  124.     virtual void Initialize(CFrameWnd *pWnd) = 0;
  125.  
  126.     virtual BOOL procTabNavigation( UINT nChar, UINT forward, UINT controlKey ) = 0;
  127.  
  128. // Menu bar stuff
  129.     virtual void SetMenu( UINT ) = 0;
  130.  
  131. // General Toolbar functionality
  132.     virtual void ShowToolbar(UINT nToolbarID, BOOL bShow = TRUE) = 0;
  133.     virtual BOOL GetToolbarVisible(UINT nToolbarID) = 0;
  134.     virtual CWnd *GetToolbar(UINT nToolbarID) = 0;
  135.     virtual void SetToolbarFocus(UINT nToolbarID) = 0;
  136.     // nPos, bOpen, and bShowing are IN/OUT parameters. Values going in are default values and values
  137.     // coming out are the values from the registry or default if not in the registry.
  138.     virtual void LoadToolbarConfiguration(UINT nToolbarID, CString &csToolbarName, int32 & nPos, BOOL & bOpen, BOOL & bShowing) = 0;
  139.     virtual void SaveToolbarConfiguration(UINT nToolbarID, CString &csToolbarName)  = 0;
  140.     virtual void SetSaveToolbarInfo(BOOL bSaveToolbarInfo) = 0;
  141.  
  142. // Animation Stuff
  143.     virtual void StartAnimation() = 0;
  144.     virtual void StopAnimation() = 0;
  145.  
  146. // Configurable Toolbar Manager stuff
  147.     virtual int CreateCustomizableToolbar(CString toolbarName, int nMaxToolbars, BOOL bHasAnimation)=0;
  148.     virtual int CreateCustomizableToolbar(UINT nStringID, int nMaxToolbars, BOOL bHasAnimation) = 0;
  149.     virtual CString GetCustToolbarString() = 0;
  150.     virtual void RenameCustomizableToolbar(UINT nStringID) = 0;
  151.     virtual void FinishedAddingBrowserToolbars()=0;
  152.     virtual void SetToolbarStyle( int nToolbarStyle )=0;
  153.     virtual BOOL CustToolbarShowing()=0;
  154.     virtual void ViewCustToolbar(BOOL bShow) = 0;
  155.     virtual void Customize()=0;
  156.     virtual CCustToolbar * GetCustomizableToolbar() = 0;
  157.  
  158. //  MainFrame's Toolbar Stuff
  159.     virtual void ImagesButton(BOOL) = 0;
  160.  
  161.  
  162.  
  163. //    Window Title Stuff
  164.     virtual void SetWindowTitle(const char *) = 0;
  165.     virtual void SetDocumentTitle(const char *) = 0;
  166. };
  167.  
  168. typedef IChrome * LPCHROME;
  169.  
  170. #define ApiChrome(v,unk) APIPTRDEF(IID_IChrome,IChrome,v,unk)
  171.  
  172. #endif
  173.