home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / interact / findw.h < prev   
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.3 KB  |  145 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. // ===========================================================================
  20. // findw.h
  21. // Find dialog box.
  22. // Contains find dialog box declarations.
  23. // Minimal interface in the header file, most of the class definitions are in
  24. // .cp file.
  25. // Created by atotic, June 6th, 1994
  26. // ===========================================================================
  27.  
  28.  
  29. #pragma once
  30. #include <LDialogBox.h>
  31. #include <LStream.h>
  32. #include <LApplication.h>
  33. #include "cstring.h"
  34. #include "CHTMLView.h"
  35.  
  36. class CTSMEditField;
  37.  
  38. /*****************************************************************************
  39.  * class CFindWindow
  40.  * Find dialog box
  41.  *****************************************************************************/
  42.  
  43. class CFindWindow: public LDialogBox
  44. {
  45.     private:
  46.         typedef LDialogBox super;
  47.     public:
  48.         enum                { class_ID = 'find' };
  49.         
  50.             // constructor
  51.                             CFindWindow(LStream* inStream);
  52.         virtual                ~CFindWindow();
  53.         virtual void        FinishCreateSelf();
  54.         
  55.         virtual void        GetDialogValues();
  56.         virtual void        SetDialogValues();
  57.         virtual void         SetTextTraitsID(ResIDT    inTextTraitsID);
  58.         
  59.         static void            DoFind(CHTMLView* theHTMLView);    
  60.         static Boolean        CanFindAgain();
  61.         
  62.             // Interface to the application
  63.         static void            RegisterViewTypes();
  64.  
  65.             // events & commands
  66.         virtual void        FindCommandStatus(CommandT inCommand,
  67.                                                 Boolean& outEnabled, 
  68.                                                 Boolean& outUsesMark,
  69.                                                 Char16& outMark,
  70.                                                 Str255 outName);
  71.         virtual void        ListenToMessage( MessageT inMessage, void* ioParam );
  72.         virtual void        SavePlace (LStream *outPlace);
  73.         virtual void        RestorePlace (LStream *inPlace);
  74.         virtual void        DoSetBounds (const Rect &inBounds);
  75.  
  76.         static CHTMLView*    sViewBeingSearched;
  77.         static CFindWindow* sFindWindow;        // Global holds current find window
  78.         static cstring        sLastSearch;        // Last search string
  79.         static Boolean        sCaseless;            // Search is caseless?
  80.         static Boolean        sBackward;            // Search backward
  81.         static Boolean        sWrap;                // Wrap to beginning of doc
  82.  
  83.     protected:
  84.         CTSMEditField*        fSearchFor;
  85.         LStdCheckBox*        fCaseSensitive;
  86.         LStdCheckBox*        fSearchBackwards;
  87.         LStdCheckBox*        fWrapSearch;
  88.  
  89.     private:
  90. };
  91.  
  92. class LMailNewsFindWindow: public CFindWindow
  93. {
  94. public:
  95.     enum                { class_ID = 'Dfmn' };
  96.     
  97.                         LMailNewsFindWindow( LStream* inStream );
  98.     
  99.     virtual void        FinishCreateSelf();
  100.     virtual void        GetDialogValues();
  101.     
  102.     static Boolean        sFindInHeaders;
  103.  
  104. protected:
  105.     LStdRadioButton*    fFindInHeaders;
  106. };
  107.  
  108.  
  109. /*****************************************************************************
  110.  * class CComposeFindWindow
  111.  * handles Composer's Find/Replace dialog
  112.  *****************************************************************************/
  113.  
  114. class CComposeFindWindow: public CFindWindow
  115. {
  116.     public:
  117.         enum                { class_ID = 'Efnd' };
  118.         
  119.                             CComposeFindWindow( LStream* inStream );
  120.         virtual void        FinishCreateSelf();
  121.         virtual void        ListenToMessage( MessageT inMessage, void* ioParam );
  122.         virtual void        SetDialogValues();
  123.         virtual void         GetDialogValues();
  124.  
  125.         static cstring        sLastReplace;        // Last search string
  126.  
  127.     protected:
  128.         CTSMEditField*        fReplaceWith;
  129. };
  130.  
  131. /*****************************************************************************
  132.  * class CLoadURLBox
  133.  * The only thing it does is sets the fGetURLWindow of uapp to NULL on deletion
  134.  *****************************************************************************/
  135. class CLoadURLBox: public LDialogBox
  136. {
  137. public:
  138.                         CLoadURLBox( LStream* inStream );
  139.     virtual                ~CLoadURLBox();
  140. };
  141.  
  142.  
  143.  
  144.  
  145.