• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

fl_Squiggles.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 1998,1999 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017  * 02111-1307, USA.
00018  */
00019 
00020 #ifndef FL_SQUIGGLES_H
00021 #define FL_SQUIGGLES_H
00022 
00023 #include "fl_BlockLayout.h"
00024 
00025 typedef enum
00026 {
00027   FL_SQUIGGLE_SPELL,
00028   FL_SQUIGGLE_GRAMMAR
00029 } FL_SQUIGGLE_TYPE;
00030 
00031 class ABI_EXPORT fl_Squiggles
00032 {
00033 public:
00034     fl_Squiggles(fl_BlockLayout* pOwner, FL_SQUIGGLE_TYPE iType);
00035 virtual ~fl_Squiggles(void);
00036 
00037     void                    add(fl_PartOfBlock* pPOB);
00038     void                    markForRedraw(fl_PartOfBlock* pPOB);
00039 
00040     bool                    deleteAll(void);
00041 
00042     fl_PartOfBlock*         get(UT_sint32 iOffset) const;
00043     inline fl_PartOfBlock*  getNth(UT_sint32 n) const
00044         { return (fl_PartOfBlock *) m_vecSquiggles.getNthItem(n); }
00045 
00046     void                    clear(fl_PartOfBlock* pPOB);
00047 
00048     void                    textInserted(UT_sint32 iOffset,
00049                                          UT_sint32 iLength);
00050     void                    textDeleted(UT_sint32 iOffset,
00051                                         UT_sint32 iLength);
00052 
00053     void                    textRevised(UT_sint32 iOffset,
00054                                         UT_sint32 iLength);
00055 
00056     FL_SQUIGGLE_TYPE        getSquiggleType(void) const
00057       { return m_iSquiggleType;}
00058 
00059     void                    updatePOBs(UT_sint32 iOffset, UT_sint32 shift);
00060     void                    join(UT_sint32 iOffset,
00061                                  fl_BlockLayout* pPrevBL);
00062     void                    split(UT_sint32 iOffset,
00063                                   fl_BlockLayout* pNewBL);
00064 
00065     bool                    findRange(UT_sint32 iStart, UT_sint32 iEnd,
00066                                       UT_sint32& iFirst,
00067                                       UT_sint32& iLast, bool bDontExpand = false) const;
00068 
00069     bool                    recheckIgnoredWords(const UT_UCSChar* pBlockText);
00070 
00071 #ifdef FMT_TEST
00072     void                    __dump(FILE * fp) const;
00073 #endif
00074 
00075 private:
00076     void                    _purge(void);
00077 
00078     void                    _deleteNth(UT_sint32 iIndex);
00079     bool                    _deleteAtOffset(UT_sint32 iOffset);
00080 
00081     bool                    _findFirstAfter(UT_sint32 iOffset,
00082                                             UT_sint32& iIndex) const;
00083     UT_sint32               _find(UT_sint32 iOffset) const;
00084 
00085     void                    _move(UT_sint32 iOffset, UT_sint32 chg,
00086                                   fl_BlockLayout* pBlock=NULL);
00087 
00088     inline UT_sint32        _getCount(void) const
00089         { return m_vecSquiggles.getItemCount(); }
00090 
00091     UT_Vector           m_vecSquiggles;
00092     fl_BlockLayout*         m_pOwner;
00093     FL_SQUIGGLE_TYPE                m_iSquiggleType;
00094 };
00095 
00096 class ABI_EXPORT fl_SpellSquiggles : public fl_Squiggles
00097 {
00098  public:
00099   fl_SpellSquiggles(fl_BlockLayout* pOwner);
00100 };
00101 
00102 class ABI_EXPORT fl_GrammarSquiggles : public fl_Squiggles
00103 {
00104  public:
00105   fl_GrammarSquiggles(fl_BlockLayout* pOwner);
00106 };
00107 
00108 
00109 #endif /* FL_SQUIGGLES_H */
00110 
00111 
00112 
00113 

Generated on Sun May 27 2012 for AbiWord by  doxygen 1.7.1