home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / compbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.9 KB  |  224 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 __COMPBAR_H
  19. #define __COMPBAR_H
  20.  
  21. #include <afxwin.h>
  22. #include <afxext.h>
  23. #include "compstd.h"
  24. #include "msgcom.h"
  25. #include "addrbook.h"
  26. #include "apiaddr.h"
  27. #include "apiimg.h"
  28. #include "collapse.h"
  29. #include "tooltip.h"
  30.  
  31. class CComposeEdit;
  32. class CNSAddressList;
  33. class CNSAttachmentList;
  34.  
  35. #define MAX_TIPS    4
  36.  
  37. class CComposeSubjectEdit;
  38.  
  39. class CComposeBar : public CDialogBar,
  40.             public IAddressParent
  41. {
  42. protected:
  43.     class CNSComposeToolInfo 
  44.     {
  45.     public:
  46.        CRect m_rect;
  47.     UINT m_idText;
  48.        WPARAM m_idCommand;
  49.     CString m_csToolTip;
  50.        void Initialize(UINT idText, CRect & rect, WPARAM idCommand)
  51.        {
  52.            m_csToolTip = szLoadString(idText);
  53.         m_idText = idText;
  54.            m_rect = rect;
  55.            m_idCommand = idCommand;
  56.        }
  57.     };
  58.     LPUNKNOWN m_pUnkImage;
  59.     LPUNKNOWN m_pUnkAddressControl;
  60.     LPIMAGEMAP m_pIImage;
  61. public:
  62.     CNSToolTip2  * m_pToolTip;
  63.     CNSCollapser collapser;
  64.     LPADDRESSCONTROL m_pIAddressList;
  65.     LPUNKNOWN m_pUnkAddress;
  66.     int m_iMinSize;
  67.     int m_iMaxSize;
  68.     int m_iHeight;
  69.     int m_iBoxHeight;
  70.     int m_cxChar;
  71.     int m_iFirstX;
  72.     int m_iSelectedTab;
  73.     int m_iPriorityIdx;
  74.     char * m_pszMessageFormat;
  75.     char * m_pszCharSet;
  76.     BOOL m_bReceipt;
  77.     BOOL m_bEncrypted;
  78.     BOOL m_bSigned;
  79.     BOOL m_bAttachVCard;
  80.     BOOL m_bUse8Bit;
  81.     BOOL m_bUseUUENCODE;
  82.     int m_iTotalAttachments;
  83.     int m_iPrevHeight;
  84.     CNSComposeToolInfo m_ToolTipInfo[MAX_TIPS];
  85.     HFONT m_cfTextFont;
  86.     HFONT m_cfStaticFont;
  87.     HFONT m_cfSubjectFont;
  88.     CComposeEdit * m_pComposeEdit;
  89. #ifdef BUTTONS
  90.     CWnd * m_pButton[3];
  91. #endif
  92.     CButton * m_pReturnReceipt;
  93.     CButton * m_pEncrypted;
  94.     CButton * m_pSigned;
  95.     CButton * m_pUse8Bit;
  96.     CButton * m_pUseUUENCODE;
  97.  
  98.     CNSAttachmentList * m_pAttachmentList;
  99.     CWnd * m_pWidget;
  100.  
  101.     CComposeSubjectEdit * m_pSubjectEdit;
  102.     CStatic * m_pPriorityText;
  103.     CStatic * m_pSubjectEditText;
  104.     CStatic * m_pMessageFormatText;
  105.     CComboBox * m_pPriority;
  106.     CComboBox * m_pMessageFormat;
  107.     CNSAttachDropTarget * m_pDropTarget;
  108.  
  109.     virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz );
  110.     void Enable3d(BOOL bEnable);
  111.    
  112. public:
  113.  
  114.     CEdit * m_pSubject;
  115.     BOOL m_bClosed;
  116.     BOOL m_bHidden;
  117.     BOOL m_bSizing;
  118.     BOOL m_bCanSize;
  119.     int  m_iY;
  120.     
  121.     CComposeBar ( );
  122.     ~CComposeBar ( );
  123.     
  124.     LPADDRESSCONTROL GetAddressWidgetInterface();
  125.  
  126.     void ShowTab(int idx);
  127.     int GetTab();
  128.     void AttachFile(void);
  129.     void AttachUrl(void);
  130.     inline BOOL IsCollapsed(void) { return m_bClosed; }
  131.  
  132.     void SetComposeEdit ( CComposeEdit * pEdit )
  133.     {
  134.         m_pComposeEdit = pEdit;
  135.     }
  136.     CComposeEdit * GetComposeEdit ( void )
  137.     {
  138.         return m_pComposeEdit;
  139.     }
  140.     void SetCSID(int m_iCSID);
  141.     void SetSigned(BOOL bSigned) { m_bSigned = bSigned; }
  142.     void SetEncrypted(BOOL bEncrypted) { m_bEncrypted = bEncrypted; }
  143.     void SetReturnReceipt(BOOL bReceipt) { m_bReceipt = bReceipt; }
  144.     void SetUse8Bit(BOOL bUse8Bit) { m_bUse8Bit = bUse8Bit; }
  145.     void SetUseUUENCODE(BOOL bUseUUENCODE) {m_bUseUUENCODE = bUseUUENCODE; }
  146.     BOOL GetEncrypted(void) { return m_bEncrypted; }
  147.     BOOL GetSigned(void) { return m_bSigned; }
  148.     BOOL GetReturnReceipt(void) { return m_bReceipt; }
  149.     BOOL GetUse8Bit(void) { return m_bUse8Bit; }
  150.     BOOL GetUseUUENCODE(void) { return m_bUseUUENCODE; }
  151.     void Draw3DStaticEdgeSimulation(CDC & dc, CRect &rect, BOOL bReverse = FALSE);
  152.     void DrawVerticalTab(CDC &, int, CRect &);
  153.     BOOL IsAttachmentsMailOnly(void);
  154.     BOOL TabControl(BOOL bShift = FALSE, BOOL bControl = FALSE, CWnd * pWnd = (CWnd*)TABCTRL_HOME);
  155.     void CalcFieldLayout(void);
  156.     void DisplayHeaders ( MSG_HEADER_SET );
  157.     int GetHeightNeeded ( void );
  158.     void CreateAddressingBlock(void);
  159.     void CreateStandardFields(void);
  160.     void CreateAddressPage(void);
  161.     void CreateAttachmentsPage(void);
  162.     void CreateOptionsPage(void);
  163.     void DestroyOptionsPage(void);
  164.     void DestroyAddressPage(void);
  165.     void DestroyStandardFields(void);
  166.     void DestroyAttachmentsPage(void);
  167.     void UpdateFixedSize ( );
  168.     void UpdateHeaderInfo ( void );
  169.     void UpdateRecipientInfo ( char *pTo, char *pCc, char *pBcc );
  170.     int  GetTotalAttachments(void);
  171.     void UpdateAttachmentInfo(int nTotal = -1);
  172.     void TabChanging(int tab);
  173.     void TabChanged(int tab);
  174.     void GetWidgetRect(CRect &WinRect, CRect &rect);
  175.     BOOL GetAttachMyCard() { return m_bAttachVCard; }
  176.     void SetAttachMyCard(BOOL bAttach) { m_bAttachVCard = bAttach; }
  177.     void Cleanup(void);
  178.     void UpdateSecurityOptions(void);
  179.  
  180.     virtual void AddedItem (HWND hwnd, LONG id,int index);
  181.     virtual int     ChangedItem (char * pString, int index, HWND hwnd, char ** ppszFullName, unsigned long* entryID = NULL, UINT* bitmapID = NULL);
  182.     virtual void DeletedItem (HWND hwnd, LONG id,int index);
  183.     virtual char * NameCompletion (char *);
  184.     virtual int OnToolHitTest( CPoint point, TOOLINFO* pTI ) const;
  185.     BOOL ProcessVCardData(COleDataObject * pDataObject,CPoint &point);
  186.  
  187.     void OnAttachTab(void);
  188.     void OnAddressTab(void);
  189.     void OnOptionsTab(void);
  190.     void OnCollapse(void);
  191.     void OnToggleShow(void);
  192.     inline BOOL IsVisible() {return !m_bHidden;}
  193.  
  194. protected:
  195. #ifdef XP_WIN16
  196.     BOOL PreTranslateMessage( MSG* pMsg );
  197. #endif
  198.     void UpdateOptionsInfo();
  199.   
  200.     afx_msg LRESULT OnSizeParent(WPARAM wParam, LPARAM lParam);
  201.     afx_msg void    OnDropFiles( HDROP hDropInfo );
  202.     afx_msg void OnMouseMove( UINT nFlags, CPoint point );
  203.     afx_msg int  OnCreate ( LPCREATESTRUCT );
  204.     afx_msg void OnPaint();
  205.     afx_msg BOOL OnSetCursor( CWnd* pWnd, UINT nHitTest, UINT message );
  206.     afx_msg void OnButtonAttach(void);
  207.     afx_msg void OnSize( UINT nType, int cx, int cy );
  208.     afx_msg LONG OnLeavingLastField(UINT, LONG);
  209.     afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
  210.     afx_msg void OnLButtonUp( UINT nFlags, CPoint point );
  211.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  212.     afx_msg void OnTimer( UINT  nIDEvent );
  213.     afx_msg void OnUpdateToolBar(void);
  214.     afx_msg void OnUpdateOptions(void);
  215.  
  216.     DECLARE_MESSAGE_MAP()
  217.  
  218.     friend class CComposeFrame;
  219.  
  220. };
  221.  
  222. #endif
  223.  
  224.