home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / macfe / Composer / CEditDictionary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.5 KB  |  76 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. #pragma once
  20.  
  21. #include "CTextTable.h"
  22. #include <LGADialogBox.h>
  23.  
  24.  
  25. class LGAPushButton;
  26. class CLargeEditFieldBroadcast;
  27. class ISpellChecker;
  28.  
  29.  
  30. class CEditDictionary : public LGADialogBox {
  31.  
  32.     public:
  33.  
  34.         virtual     void                            ListenToMessage    (    MessageT inMessage, 
  35.                                                                     void*        ioParam );        
  36.                                                         
  37.         virtual        void                            FinishCreateSelf();
  38.                                                     CEditDictionary(LStream *inStream);
  39.                                                                 
  40.                     void                            SetISpellChecker(ISpellChecker *i);
  41.                     ISpellChecker                    *GetISpellChecker();                        
  42.                                                                 
  43.         enum    { class_ID = 'CEdD', res_ID = 5298 };
  44.         enum    { AddButtonID    = 201 ,    WordID = 200, WordsTableID = 202, ReplaceButtonID = 203,
  45.                 RemoveButtonID = 204, HelpButtonID = 205, msg_LeaveDictionaryTable = 208 };
  46.         enum    { max_word_length = 50 };    // Max length of a word
  47.         
  48.     protected:
  49.     
  50.                             void                             MakeDictionaryChangesPermanent();
  51.         virtual        void                             AddNewWord();
  52.         virtual        void                          RemoveSelectedWords();
  53.         virtual        void                            ReplaceSelectedWord();
  54.         CLargeEditFieldBroadcast         *mWordNameField;            // The field where user edits word
  55.         LGAPushButton                             *mAddButton;                    // Add new word button
  56.         LGAPushButton                                *mReplaceButton;
  57.         LGAPushButton                                *mRemoveButton;
  58.         LGAPushButton                                *mHelpButton;
  59.         CTextTable                                    *mWordsView;                    // The Personal Dictionary view
  60.         
  61.         int                                                    mNumWords;
  62.         
  63.         ISpellChecker                                *mISpellChecker;
  64. };
  65.  
  66. class CEditDictionaryTable : public CTextTable {
  67.  
  68.     public:
  69.     
  70.             enum    {class_ID = 'CEDT' };
  71.             virtual void        BeTarget();
  72.             virtual void        DontBeTarget();
  73.                                             CEditDictionaryTable(LStream *inStream) : CTextTable(inStream) { }
  74.     
  75.                             void         HiliteSelection(    Boolean    inActively,     Boolean     inHilite );
  76. };