• 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., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef FL_SQUIGGLES_H
00021 #define FL_SQUIGGLES_H
00022 
00023 #include <vector>
00024 
00025 #include "fl_BlockLayout.h"
00026 
00027 typedef enum
00028 {
00029   FL_SQUIGGLE_SPELL,
00030   FL_SQUIGGLE_GRAMMAR
00031 } FL_SQUIGGLE_TYPE;
00032 
00033 class ABI_EXPORT fl_Squiggles
00034 {
00035 public:
00036     fl_Squiggles(fl_BlockLayout* pOwner, FL_SQUIGGLE_TYPE iType);
00037 virtual ~fl_Squiggles(void);
00038 
00039     void                    add(const fl_PartOfBlockPtr& pPOB);
00040     void                    markForRedraw(const fl_PartOfBlockPtr& pPOB);
00041 
00042     bool                    deleteAll(void);
00043 
00044     fl_PartOfBlockPtr       get(UT_sint32 iOffset) const;
00045     inline const fl_PartOfBlockPtr& getNth(UT_sint32 n) const
00046         { return m_vecSquiggles.at(n); }
00047 
00048     void                    clear(const fl_PartOfBlockPtr& pPOB);
00049 
00050     void                    textInserted(UT_sint32 iOffset,
00051                                          UT_sint32 iLength);
00052     void                    textDeleted(UT_sint32 iOffset,
00053                                         UT_sint32 iLength);
00054 
00055     void                    textRevised(UT_sint32 iOffset,
00056                                         UT_sint32 iLength);
00057 
00058     FL_SQUIGGLE_TYPE        getSquiggleType(void) const
00059       { return m_iSquiggleType;}
00060 
00061     void                    updatePOBs(UT_sint32 iOffset, UT_sint32 shift);
00062     void                    join(UT_sint32 iOffset,
00063                                  fl_BlockLayout* pPrevBL);
00064     void                    split(UT_sint32 iOffset,
00065                                   fl_BlockLayout* pNewBL);
00066 
00067     bool                    findRange(UT_sint32 iStart, UT_sint32 iEnd,
00068                                       UT_sint32& iFirst,
00069                                       UT_sint32& iLast, bool bDontExpand = false) const;
00070 
00071     bool                    recheckIgnoredWords(const UT_UCSChar* pBlockText);
00072 
00073 #ifdef FMT_TEST
00074     void                    __dump(FILE * fp) const;
00075 #endif
00076 
00077 private:
00078     void                    _purge(void);
00079 
00080     void                    _deleteNth(UT_sint32 iIndex);
00081     bool                    _deleteAtOffset(UT_sint32 iOffset);
00082 
00083     bool                    _findFirstAfter(UT_sint32 iOffset,
00084                                             UT_sint32& iIndex) const;
00085     UT_sint32               _find(UT_sint32 iOffset) const;
00086 
00087     void                    _move(UT_sint32 iOffset, UT_sint32 chg,
00088                                   fl_BlockLayout* pBlock=NULL);
00089 
00090     inline UT_sint32        _getCount(void) const
00091         { return m_vecSquiggles.size(); }
00092 
00093     std::vector<fl_PartOfBlockPtr>  m_vecSquiggles;
00094     fl_BlockLayout*         m_pOwner;
00095     FL_SQUIGGLE_TYPE                m_iSquiggleType;
00096 };
00097 
00098 class ABI_EXPORT fl_SpellSquiggles : public fl_Squiggles
00099 {
00100  public:
00101   fl_SpellSquiggles(fl_BlockLayout* pOwner);
00102 };
00103 
00104 class ABI_EXPORT fl_GrammarSquiggles : public fl_Squiggles
00105 {
00106  public:
00107   fl_GrammarSquiggles(fl_BlockLayout* pOwner);
00108 };
00109 
00110 #endif /* FL_SQUIGGLES_H */
00111 
00112 
00113 
00114 

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1