home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / central / CPlainTextConversionContext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.8 KB  |  134 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. // CPlainTextConversionContext.h
  20.  
  21. //    This is a subclass of CNSContext to handle plain text translation.
  22. //    This replaces code in ns/lib/xlate/text.c where a new text MWContext is
  23. //    created.
  24.  
  25. #pragma once
  26.  
  27. #include "CNSContext.h"
  28.  
  29. class CPlainTextConversionContext : public CNSContext
  30. {
  31. public:
  32.                     CPlainTextConversionContext(MWContext* inUIContext);
  33.     virtual            ~CPlainTextConversionContext() { }
  34.  
  35. protected:
  36.     // Overrides of base CNSContext methods
  37.  
  38.     virtual    void                 LayoutNewDocument(
  39.                                         URL_Struct*                inURL,
  40.                                         Int32*                    inWidth,
  41.                                         Int32*                    inHeight,
  42.                                         Int32*                    inMarginWidth,
  43.                                         Int32*                    inMarginHeight);
  44.  
  45.     virtual    void                 DisplaySubtext(
  46.                                         int                     inLocation,
  47.                                         LO_TextStruct*            inText,
  48.                                         Int32                     inStartPos,
  49.                                         Int32                    inEndPos,
  50.                                         XP_Bool                 inNeedBG);
  51.  
  52.     virtual    void                 DisplayText(
  53.                                         int                     inLocation,
  54.                                         LO_TextStruct*            inText,
  55.                                         XP_Bool                 inNeedBG);
  56.  
  57.     virtual    void                 DisplaySubDoc(
  58.                                         int                     inLocation,
  59.                                         LO_SubDocStruct*        inSubdocStruct);
  60.  
  61.     virtual    void                 DisplayTable(
  62.                                         int                     inLocation,
  63.                                         LO_TableStruct*            inTableStruct);
  64.  
  65.     virtual    void                 DisplayLineFeed(
  66.                                         int                     inLocation,
  67.                                         LO_LinefeedStruct*        inLinefeedStruct,
  68.                                         XP_Bool                 inNeedBG);
  69.  
  70.     virtual    void                 DisplayHR(
  71.                                         int                     inLocation,
  72.                                         LO_HorizRuleStruct*        inRuleStruct);
  73.  
  74.     virtual    char*                 TranslateISOText(
  75.                                         int                     inCharset,
  76.                                         char*                    inISOText);
  77.  
  78.     virtual    int                 GetTextInfo(
  79.                                         LO_TextStruct*            inText,
  80.                                         LO_TextInfo*            inTextInfo);
  81.  
  82.     virtual    int                 MeasureText(
  83.                                         LO_TextStruct*            inText,
  84.                                         short*                    outCharLocs);
  85.                                         
  86.     virtual    void                 DisplayBullet(
  87.                                         int                     inLocation,
  88.                                         LO_BulletStruct*        inBulletStruct);
  89.  
  90.     virtual    void                 FinishedLayout(void);
  91.  
  92.     virtual    void                 AllConnectionsComplete(void);
  93.  
  94.     virtual    void                 Progress(
  95.                                         const char*                inMessageText);
  96.  
  97.     virtual    void                 GraphProgressInit(
  98.                                         URL_Struct*                inURL,
  99.                                         Int32                     inContentLength);
  100.  
  101.     virtual    void                 GraphProgressDestroy(
  102.                                         URL_Struct*                inURL,
  103.                                         Int32                     inContentLength,
  104.                                         Int32                     inTotalRead);
  105.  
  106.     virtual    void                 GraphProgress(
  107.                                         URL_Struct*                inURL,
  108.                                         Int32                     inBytesReceived,
  109.                                         Int32                     inBytesSinceLast,
  110.                                         Int32                     inContentLength);
  111.  
  112.     // Methods to stub out.
  113.  
  114.         virtual    void                 Alert(
  115.                                             const char*                inAlertText);
  116.  
  117.         virtual    XP_Bool                Confirm(
  118.                                             const char*             inMessage);
  119.  
  120.         virtual    char*                 Prompt(
  121.                                             const char*             inMessage,
  122.                                             const char*                inDefaultText);
  123.  
  124.         virtual    XP_Bool             PromptUsernameAndPassword(
  125.                                             const char*                inMessage,
  126.                                             char**                    outUserName,
  127.                                             char**                    outPassword);
  128.  
  129.         virtual    char*                 PromptPassword(
  130.                                             const char*             inMessage);
  131.  
  132.         CNSContext*                    mUIContext;
  133. };
  134.