home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / EditorView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.8 KB  |  83 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.    EditorView.h -- class definition for the Editor view class
  20.    Created: Richard Hess <rhess@netscape.com>, 11-Nov-96.
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_editorview_h
  26. #define _xfe_editorview_h
  27.  
  28. #include "structs.h"
  29. #include "mozilla.h"
  30. #include "xfe.h"
  31.  
  32. #include "HTMLView.h"
  33. #include "Editable.h"
  34. #include "Command.h"
  35. #include "EditorDrop.h"
  36.  
  37. #define RGB_TO_WORD(r,g,b) (((r) << 16) + ((g) << 8) + (b))
  38. #define WORD_TO_R(w)       (((w) >> 16) & 0xff)
  39. #define WORD_TO_G(w)       (((w) >> 8) & 0xff)
  40. #define WORD_TO_B(w)       ((w) & 0xff)
  41.  
  42. class XFE_EditorView : public XFE_HTMLView, public XFE_Editable
  43. {
  44. public:
  45.   XFE_EditorView(XFE_Component *toplevel_component, Widget parent, XFE_View *parent_view, MWContext *context);
  46.   ~XFE_EditorView();
  47. #if 0
  48.   virtual Boolean isCommandEnabled(CommandType cmd, void *calldata = NULL,
  49.                                    XFE_CommandInfo* i = NULL);
  50.   virtual void    doCommand(CommandType, void *calldata = NULL,
  51.                                    XFE_CommandInfo* i = NULL);
  52.   virtual Boolean handlesCommand(CommandType cmd, void *calldata = NULL,
  53.                                    XFE_CommandInfo* i = NULL);
  54.   virtual char*   commandToString(CommandType cmd, void *calldata = NULL,
  55.                                   XFE_CommandInfo* i = NULL);
  56.   virtual Boolean isCommandSelected(CommandType cmd, void* calldata,
  57.                                    XFE_CommandInfo* i = NULL);
  58. #endif
  59.   virtual XFE_Command* getCommand(CommandType);
  60.   virtual XFE_View*    getCommandView(XFE_Command*);
  61.  
  62.   virtual char *getPlainText();
  63.   virtual void insertMessageCompositionText(const char* text, 
  64.                         XP_Bool leaveCursorBeginning, XP_Bool isHTML = False);
  65.   virtual void getMessageBody(char **pBody, uint32 *body_size, 
  66.                   MSG_FontCode **font_changes);
  67.   virtual void doneWithMessageBody(char* pBody);
  68.  
  69.   virtual Boolean isModified();
  70.  
  71.   void    updateChrome();
  72.  
  73. private:
  74.   XFE_EditorDrop *_dropSite;
  75.   XtIntervalId m_update_timer;
  76.     
  77.   virtual void DocEncoding(XFE_NotificationCenter *, void *, void *);
  78.   static  void updateChromeTimeout(XtPointer closure, XtIntervalId* id);
  79. };
  80.  
  81. #endif /* _xfe_editorview_h */
  82.  
  83.