home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / MsgView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.4 KB  |  136 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.    MsgView.h -- class definition for MsgView.
  20.    Created: Chris Toshok <toshok@netscape.com>, 29-Aug-1996
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_msgview_h
  26. #define _xfe_msgview_h
  27.  
  28. #include "MNView.h"
  29. #include "HTMLView.h"
  30. #include "PopupMenu.h"
  31. #include "Command.h"
  32. #include "msgcom.h"
  33. #include "ReadAttachPanel.h"
  34.  
  35. class XFE_MsgView : public XFE_MNView
  36. {
  37. public:
  38.   XFE_MsgView(XFE_Component *toplevel_component, Widget parent, XFE_View *parent_view, MWContext *context, MSG_Pane *p = NULL);
  39.   virtual ~XFE_MsgView();
  40.  
  41.   void loadMessage(MSG_FolderInfo *info, MessageKey key);
  42.  
  43.   MSG_FolderInfo *getFolderInfo();
  44.   MessageKey getMessageKey();
  45.  
  46.   virtual void paneChanged(XP_Bool asynchronous, MSG_PANE_CHANGED_NOTIFY_CODE code, int32 value);
  47.  
  48.   virtual Boolean isCommandEnabled(CommandType cmd, void *calldata = NULL,
  49.                                    XFE_CommandInfo* i = NULL);
  50.   virtual Boolean isCommandSelected(CommandType cmd, void *calldata = NULL,
  51.                                    XFE_CommandInfo* i = NULL);
  52.   virtual void doCommand(CommandType, void *calldata = NULL,
  53.                                    XFE_CommandInfo* i = NULL);
  54.   virtual Boolean handlesCommand(CommandType cmd, void *calldata = NULL,
  55.                                    XFE_CommandInfo* i = NULL);
  56.   virtual char* commandToString(CommandType cmd, void *calldata = NULL,
  57.                                    XFE_CommandInfo* i = NULL);
  58.  
  59.   /* posted when the message being displayed in this view has changed. */
  60.   static const char *messageHasChanged;
  61.   
  62.   /* posted when we get a notice that the last msg in a folder was deleted. */
  63.   static const char *lastMsgDeleted;
  64.   
  65.   /* posted when the user hits space at the end of the message */
  66.   static const char *spacebarAtMsgBottom;
  67. private:
  68.   /* True: MsgFrame is deleted; 
  69.    * False (default): otherwise
  70.    */
  71.   XP_Bool              m_frameDeleted; 
  72.  
  73.   /* True: notify thread to update itself!
  74.    * False (default): otherwise
  75.    */
  76.   XP_Bool              m_updateThread;
  77.  
  78.   XFE_HTMLView        *m_htmlView;
  79.   XFE_ReadAttachPanel *m_attachPanel;
  80.     
  81.     XFE_PopupMenu *m_popup;
  82.  
  83.   /* This gets called when allConnectionsComplete happens
  84.    */
  85.   XFE_CALLBACK_DECL(allConnectionsComplete)
  86.  
  87.   /* This gets called when the user hits space at the end of the message. */
  88.   XFE_CALLBACK_DECL(spaceAtMsgEnd)
  89.  
  90.   /* This gets called when the user modifies preferences that require
  91.      the message views to refresh. */
  92.   XFE_CALLBACK_DECL(refresh)
  93.  
  94.   /* This gets called on right mouse button events in our HTMLView */
  95.   XFE_CALLBACK_DECL(showPopup)
  96.  
  97.   // called as attachments are processed
  98.   static void AttachmentCountCb(MSG_Pane*,void*,int32,XP_Bool);
  99.   void attachmentCountCb(int32,XP_Bool);
  100.   // called when user clicks attachment icon in message header
  101.   static void ToggleAttachmentPanelCb(MSG_Pane*,void*);
  102.   void toggleAttachmentPanelCb();
  103.  
  104.   // remember application-set or user-set height of attachment panel
  105.   int m_attachApplHeight;
  106.   int m_attachUserHeight;
  107.  
  108.   void setAttachPrefHeight();
  109.     
  110.   MSG_FolderInfo *m_folderInfo;
  111.   MessageKey m_messageKey;
  112.  
  113.     static MenuSpec separator_spec[];
  114.     static MenuSpec openLinkNew_spec[];
  115.     static MenuSpec openLinkEdit_spec[];
  116.  
  117.     static MenuSpec repl_spec[];
  118.  
  119.     static MenuSpec showImage_spec[];
  120.     static MenuSpec stopLoading_spec[];
  121.     static MenuSpec openImage_spec[];
  122.     static MenuSpec addLinkBookmark_spec[];
  123.     static MenuSpec addBookmark_spec[];
  124.     static MenuSpec saveLink_spec[];
  125.     static MenuSpec saveImage_spec[];
  126.     static MenuSpec copy_spec[];
  127.     static MenuSpec copyLink_spec[];
  128.     static MenuSpec copyImage_spec[];
  129.     static MenuSpec addr_spec[];
  130.     static MenuSpec filemsg_spec[];
  131.  
  132.     static MenuSpec addToAddrbk_submenu_spec[];
  133. };
  134.  
  135. #endif
  136.