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

fv_View.h

Go to the documentation of this file.
00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: t -*- */
00002 /* AbiWord
00003  * Copyright (C) 1998-2000 AbiSource, Inc.
00004  * Copyright (c) 2001,2002 Tomas Frydrych
00005  * Copyright (C) 2016 Hubert Figuière
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301 USA.
00021  */
00022 #ifndef FV_VIEW_H
00023 #define FV_VIEW_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif
00028 
00029 #include <memory>
00030 #include <string>
00031 #include <vector>
00032 
00033 #include "xap_Features.h"
00034 #include "ut_types.h"
00035 #include "xav_View.h"
00036 #include "pt_Types.h"
00037 #include "pp_Property.h"
00038 #include "fp_types.h"
00039 #include "fl_PartOfBlock.h"
00040 #ifdef ENABLE_SPELL
00041 #include "fl_Squiggles.h"
00042 #endif
00043 #include "ev_EditBits.h"
00044 
00045 // have to include these as they are instantiated in the FV_View
00046 // class definition
00047 #include "fv_FrameEdit.h"
00048 #include "fv_Selection.h"
00049 #include "fv_InlineImage.h"
00050 
00051 #ifdef TOOLKIT_GTK_ALL
00052 #include "fv_UnixVisualDrag.h"
00053 #include "fv_UnixFrameEdit.h"
00054 #include "fv_UnixInlineImage.h"
00055 #include "fv_UnixSelectionHandles.h"
00056 #else
00057 #include "fv_VisualDragText.h"
00058 #endif
00059 #include "fv_SelectionHandles.h"
00060 
00061 #define AUTO_SCROLL_MSECS   100
00062 #define STD_DOUBLE_BUFFERING_FOR_THIS_FUNCTION FV_ViewDoubleBuffering dblBuffObj(this, true, true); dblBuffObj.beginDoubleBuffering();
00063 
00064 class FL_DocLayout;
00065 class FV_Caret_Listener;
00066 
00067 class fl_DocSectionLayout;
00068 class fl_HdrFtrSectionLayout;
00069 class fl_DocListener;
00070 class fl_BlockLayout;
00071 class fl_EndnoteLayout;
00072 
00073 class fp_PageSize;
00074 class fp_Page;
00075 class fp_Run;
00076 class fp_HyperlinkRun;
00077 class fp_CellContainer;
00078 
00079 class FG_Graphic;
00080 
00081 class pf_Frag_Strux;
00082 class PD_Document;
00083 class PP_AttrProp;
00084 class PP_RevisionAttr;
00085 
00086 class GR_Graphics;
00087 class FV_ViewDoubleBuffering;
00088 struct dg_DrawArgs;
00089 
00090 class UT_Worker;
00091 class UT_Timer;
00092 class UT_UTF8String;
00093 class UT_StringPtrMap; // TODO remove.
00094 
00095 class AP_TopRulerInfo;
00096 class AP_LeftRulerInfo;
00097 class AP_TopRuler;
00098 class AP_LeftRuler;
00099 
00100 class AP_Dialog_Annotation;
00101 class AP_Dialog_SplitCells;
00102 
00103 class XAP_App;
00104 class XAP_Prefs;
00105 
00106 class SpellChecker;
00107 
00108 class CellLine;
00109 
00110 typedef enum
00111 {
00112     hori_left,
00113     hori_mid,
00114     hori_right,
00115     vert_above,
00116     vert_mid,
00117     vert_below
00118 } AP_CellSplitType;
00119 
00120 
00121 typedef enum _AP_JumpTarget
00122 {
00123     AP_JUMPTARGET_PAGE,             // beginning of page
00124     AP_JUMPTARGET_LINE,
00125     AP_JUMPTARGET_BOOKMARK,
00126 //  AP_JUMPTARGET_PICTURE, TODO
00127     AP_JUMPTARGET_XMLID,
00128     AP_JUMPTARGET_ANNOTATION
00129 } AP_JumpTarget;
00130 
00131 struct fv_ChangeState
00132 {
00133     fv_ChangeState();
00134     ~fv_ChangeState();
00135 
00136     bool                bUndo;
00137     bool                bRedo;
00138     bool                bDirty;
00139     bool                bSelection;
00140     UT_uint32           iColumn;
00141     fl_CellLayout *     pCellLayout;
00142     PP_PropertyVector   propsChar;
00143     PP_PropertyVector   propsBlock;
00144     PP_PropertyVector   propsSection;
00145 };
00146 
00147 struct FV_DocCount
00148 {
00149     UT_uint32 word;
00150     UT_uint32 para;
00151     UT_uint32 ch_no;
00152     UT_uint32 ch_sp;
00153     UT_uint32 line;
00154     UT_uint32 page;
00155        // sometimes people want to have a word count without footnotes/endnotes included
00156     UT_uint32 words_no_notes;
00157 };
00158 
00159 class ABI_EXPORT fv_PropCache
00160 {
00161 public:
00162     fv_PropCache(void);
00163     ~fv_PropCache(void);
00164     UT_uint32         getTick(void) const;
00165     void              setTick(UT_uint32 iTick);
00166     fl_ContainerLayout * getCurrentCL(void) const;
00167     void              setCurrentCL(fl_ContainerLayout* pCL);
00168     bool              isValid(void) const {
00169         return !m_props.empty();
00170     }
00171     const PP_PropertyVector & getProps() const {
00172         return m_props;
00173     }
00174     void              fillProps(const PP_PropertyVector & props);
00175     void              clearProps(void);
00176 private:
00177     UT_uint32         m_iTick;
00178     PP_PropertyVector   m_props;
00179     fl_ContainerLayout* m_pCurrentCL;
00180 };
00181 
00182 enum FV_BIDI_Order
00183 {
00184     FV_Order_Visual = 0,
00185     FV_Order_Logical_LTR = UT_BIDI_LTR,
00186     FV_Order_Logical_RTL = UT_BIDI_RTL
00187 };
00188 
00189 class ABI_EXPORT fv_CaretProps
00190 {
00191 public:
00192         fv_CaretProps(FV_View * pView, PT_DocPosition InsPoint);
00193     virtual ~fv_CaretProps(void);
00194     PT_DocPosition      m_iInsPoint;
00195     UT_sint32           m_xPoint;
00196     UT_sint32           m_yPoint;
00197     UT_sint32           m_xPoint2;
00198     UT_sint32           m_yPoint2;
00199     bool                m_bPointDirection;
00200     bool                m_bDefaultDirectionRtl;
00201     bool                m_bUseHebrewContextGlyphs;
00202     bool                m_bPointEOL;
00203     UT_uint32           m_iPointHeight;
00204     UT_RGBColor         m_caretColor;
00205     FV_Caret_Listener*  m_PropCaretListner;
00206     GR_Caret*           m_pCaret;
00207     UT_uint32           m_ListenerID;
00208     FV_View*            m_pView;
00209     UT_sint32           m_iAuthorId;
00210     std::string         m_sCaretID;
00211 };
00212 
00230 class ABI_EXPORT FV_View_BubbleBlocker
00231 {
00232     friend class FV_View;
00233     FV_View* m_pView;
00234   public:
00235     FV_View_BubbleBlocker( FV_View* pView = 0 );
00236     ~FV_View_BubbleBlocker();
00237     FV_View_BubbleBlocker& operator=( const FV_View_BubbleBlocker& r );
00238 
00239 };
00240 
00241 class ABI_EXPORT FV_View : public AV_View
00242 {
00243     friend class fl_DocListener;
00244     friend class fl_BlockLayout;
00245     friend class FL_DocLayout;
00246     friend class fl_Squiggles;
00247     friend class fl_DocSectionLayout;
00248     friend class GR_Caret;
00249     friend class FV_FrameEdit;
00250     friend class FV_VisualDragText;
00251     friend class FV_VisualInlineImage;
00252     friend class FV_Selection;
00253     friend class CellLine;
00254     friend class FV_View_BubbleBlocker;
00255     friend class FV_ViewDoubleBuffering;
00256     friend class FV_SelectionHandles;
00257 public:
00258     FV_View(XAP_App*, void*, FL_DocLayout*);
00259     virtual ~FV_View();
00260 
00261     virtual inline GR_Graphics*    getGraphics(void) const { return m_pG; }
00262     void  setGraphics(GR_Graphics *pG);
00263     void  replaceGraphics(GR_Graphics *pG);
00264 
00265     virtual inline PT_DocPosition   getPoint(void) const { return m_iInsPoint; }
00266     PT_DocPosition  getSelectionAnchor(void) const;
00267     PT_DocPosition  getSelectionLeftAnchor(void) const;
00268     PT_DocPosition  getSelectionRightAnchor(void) const;
00269     UT_uint32       getSelectionLength(void) const;
00270 
00271     UT_sint32       getFrameMargin(void) const;
00272 
00273     virtual void focusChange(AV_Focus focus);
00274     virtual bool    isActive(void) const;
00275 
00276     virtual void    setXScrollOffset(UT_sint32);
00277     virtual void    setYScrollOffset(UT_sint32);
00278     virtual void    cmdScroll(AV_ScrollCmd cmd, UT_uint32 iPos = 0);
00279 
00280     virtual void    cmdHyperlinkJump(UT_sint32 xPos, UT_sint32 yPos);
00281     void            cmdHyperlinkJump(PT_DocPosition pos);
00282     void            cmdHyperlinkCopyLocation(PT_DocPosition pos);
00283 
00284     virtual void    draw(const UT_Rect* pRect=static_cast<UT_Rect*>(NULL));
00285     virtual void    drawSelectionBox(UT_Rect & box, bool drawHandles);
00286 
00287     void            setVisualSelectionEnabled(bool bActive);
00288 private:
00289     inline void     _drawResizeHandle(UT_Rect & box);
00290     void getCmdInsertRangeVariables( PT_DocPosition& posStart,
00291                                      PT_DocPosition& posEnd,
00292                                      fl_BlockLayout*& pBL1,
00293                                      fl_BlockLayout*& pBL2 );
00294     void _updateSelectionHandles (void);
00295 
00296 
00297 public:
00298     const PP_AttrProp * getAttrPropForPoint() const;
00299 
00300     virtual bool    notifyListeners(const AV_ChangeMask hint);
00301 
00302     virtual bool    canDo(bool bUndo) const;
00303     virtual UT_uint32 undoCount (bool bUndo) const;
00304     virtual void    cmdUndo(UT_uint32 count);
00305     virtual void    cmdRedo(UT_uint32 count);
00306     virtual UT_Error    cmdSave(void);
00307     virtual UT_Error    cmdSaveAs(const char * szFilename, int ieft);
00308     virtual UT_Error        cmdSaveAs(const char * szFilename, int ieft, bool cpy);
00309 
00310     UT_Error        cmdInsertField(const char* szName, const PP_PropertyVector & extra_attrs = PP_NOPROPS, const PP_PropertyVector & extra_props = PP_NOPROPS);
00311     UT_Error        cmdInsertBookmark(const char* szName);
00312     UT_Error        cmdDeleteBookmark(const char* szName);
00313     UT_Error        cmdInsertHyperlink(const char* szName, const char* szTitle = NULL);
00314     UT_Error        cmdInsertXMLID(const std::string& name);
00315     UT_Error        cmdDeleteXMLID(const std::string& name);
00316 
00317     fp_Run *        getHyperLinkRun(PT_DocPosition pos);
00318     UT_Error        cmdDeleteHyperlink();
00319     bool                    cmdInsertMathML(const char * szFileName,
00320                         PT_DocPosition pos);
00321     bool            cmdInsertEmbed(const UT_ConstByteBufPtr & pBuf,PT_DocPosition pos,const char * szMime,const char * szProps);
00322     bool            cmdUpdateEmbed(const UT_ConstByteBufPtr & pBuf, const char * szMime, const char * szProps);
00323     bool            cmdUpdateEmbed(fp_Run * pRun, const UT_ConstByteBufPtr & pBuf, const char * szMime, const char * szProps);
00324     bool            cmdDeleteEmbed(fp_Run * pRun);
00325 
00326     bool                    cmdInsertLatexMath(UT_UTF8String & sLatex,
00327                            UT_UTF8String & sMath, bool compact);
00328 
00329     UT_Error        cmdInsertTOC(void);
00330     UT_Error        cmdHyperlinkStatusBar(UT_sint32 xPos, UT_sint32 yPos);
00331 
00332     UT_Error        cmdInsertGraphic(const FG_ConstGraphicPtr&);
00333     UT_Error        cmdInsertGraphicAtStrux(const FG_ConstGraphicPtr& pFG, PT_DocPosition iPos, PTStruxType iStruxType);
00334     virtual void    toggleCase(ToggleCase c);
00335     virtual void    setPaperColor(const gchar * clr);
00336 
00337     virtual bool    isDocumentPresent(void) const;
00338     virtual void    cmdCopy(bool bToClipboard = true);
00339     virtual void    cmdCut(void);
00340     virtual void    cmdPaste(bool bHonorFormatting = true);
00341     virtual void    cmdPasteSelectionAt(UT_sint32 xPos, UT_sint32 yPos);
00342 
00343     void            pasteFromLocalTo(PT_DocPosition pos);
00344     void            _pasteFromLocalTo(PT_DocPosition pos);
00345     void            copyToLocal(PT_DocPosition pos1, PT_DocPosition pos2);
00346     void        copyTextToClipboard(const UT_UCS4String sIncoming, bool useClipboard=true);
00347 
00348     virtual void    getTopRulerInfo(AP_TopRulerInfo * pInfo);
00349     virtual void    getTopRulerInfo(PT_DocPosition pos, AP_TopRulerInfo * pInfo);
00350     virtual void    getLeftRulerInfo(AP_LeftRulerInfo * pInfo);
00351     virtual void    getLeftRulerInfo(PT_DocPosition pos, AP_LeftRulerInfo * pInfo);
00352         virtual void    setCursorWait(void);
00353     virtual void    clearCursorWait(void);
00354     virtual void    setCursorToContext(void);
00355     EV_EditMouseContext         getLastMouseContext(void);
00356     void                getMousePos(UT_sint32 * x, UT_sint32 * y);
00357 
00358     virtual EV_EditMouseContext getMouseContext(UT_sint32 xPos, UT_sint32 yPos);
00359     EV_EditMouseContext _getMouseContext(UT_sint32 xPos, UT_sint32 yPos);
00360     virtual EV_EditMouseContext getInsertionPointContext(UT_sint32 * pxPos, UT_sint32 * pyPos);
00361     void                setPrevMouseContext(EV_EditMouseContext  emc)
00362     {m_prevMouseContext = emc;}
00363 
00364     virtual void        updateLayout(void);
00365     virtual void        rebuildLayout(void);
00366     virtual void        remeasureCharsWithoutRebuild();
00367     virtual void        fontMetricsChange();
00368     virtual bool        isSelectionEmpty(void) const;
00369     bool                isSelectAll(void) const
00370     { return m_Selection.isSelectAll();}
00371     virtual void        cmdUnselectSelection(void);
00372     void                getDocumentRangeOfCurrentSelection(PD_DocumentRange * pdr) const;
00373     PT_DocPosition      mapDocPos( FV_DocPos dp );
00374     PT_DocPosition      mapDocPosSimple( FV_DocPos dp );
00375     PT_DocPosition saveSelectedImage (const char * toFile );
00376     PT_DocPosition saveSelectedImage(UT_ConstByteBufPtr & outByteBuf);
00377     PT_DocPosition getSelectedImage(const char **dataId) const;
00378     PT_DocPosition getSelectedImage(const char **dataId,const fp_Run **pImRun) const;
00379     fp_Run *getSelectedObject(void) const;
00380 
00381     void            getTextInCurrentBlock(UT_GrowBuf & buf) const;
00382     void            getTextInCurrentSection(UT_GrowBuf & buf) const;
00383     void            getTextInDocument(UT_GrowBuf & buf) const;
00384     bool            getLineBounds(PT_DocPosition pos, PT_DocPosition *start, PT_DocPosition *end);
00385     UT_UCSChar getChar(PT_DocPosition pos, UT_sint32 *x = NULL, UT_sint32 *y = NULL, UT_uint32 *width = NULL, UT_uint32 *height = NULL);
00386 
00387 // ----------------------
00388     FL_DocLayout*   getLayout() const;
00389     UT_uint32       getCurrentPageNumForStatusBar(void) const;
00390     fp_Page*        getCurrentPage(void) const;
00391     fl_BlockLayout* getCurrentBlock(void) const;
00392 
00393     void draw(int page, dg_DrawArgs* da);
00394 
00395 
00396     // TODO some of these functions should move into protected
00397 
00398     void    getPageScreenOffsets(const fp_Page* pPage, UT_sint32& xoff, UT_sint32& yoff) const;
00399     void    getPageYOffset(const fp_Page* pPage, UT_sint32& yoff) const;
00400     virtual UT_sint32 getPageViewLeftMargin(void) const;
00401     virtual UT_sint32 getPageViewTopMargin(void) const;
00402     virtual UT_sint32 getPageViewSep(void) const;
00403 
00404     bool    setSectionFormat(const PP_PropertyVector & properties);
00405     bool    getSectionFormat(PP_PropertyVector & properties) const;
00406 
00407     bool    setBlockIndents(bool doLists, double indentChange, double page_size);
00408     bool    setCollapsedRange(PT_DocPosition posLow,PT_DocPosition posHigh, const PP_PropertyVector & properties);
00409     bool    setBlockFormat(const PP_PropertyVector & properties);
00410     bool    getBlockFormat(PP_PropertyVector & properties, bool bExpandStyles=true) const;
00411     bool    removeStruxAttrProps(PT_DocPosition ipos1, PT_DocPosition ipos2, PTStruxType iStrux, const PP_PropertyVector & attributes, const PP_PropertyVector & properties);
00412     bool    isImageAtStrux(PT_DocPosition ipos1, PTStruxType iStrux);
00413 
00414     bool    processPageNumber(HdrFtrType hfType, const PP_PropertyVector & atts);
00415 
00416 #ifdef ENABLE_SPELL
00417     bool    isTextMisspelled()const ;
00418 #endif
00419     bool    isTabListBehindPoint(UT_sint32 & iNumToDelete) const;
00420     bool    isTabListAheadPoint(void) const;
00421     void    processSelectedBlocks(FL_ListType listType);
00422     void    getBlocksInSelection(UT_GenericVector<fl_BlockLayout*> * vBlock, bool bAllBlocks = true) const;
00423     UT_sint32 getNumColumnsInSelection(void) const;
00424     UT_sint32 getNumRowsInSelection(void) const;
00425     void    getAllBlocksInList(UT_GenericVector<fl_BlockLayout *> * vBlock) const;
00426     bool    isPointBeforeListLabel(void) const;
00427     bool    isCurrentListBlockEmpty(void) const;
00428     bool    cmdStartList(const gchar * style);
00429     bool    cmdStopList(void);
00430     void    changeListStyle(const fl_AutoNumPtr & pAuto,
00431                             FL_ListType lType,
00432                             UT_uint32 startv,
00433                             const gchar* pszDelim,
00434                             const gchar* pszDecimal,
00435                             const gchar* pszFormat,
00436                             float Aligm,
00437                             float Indent);
00438 
00439     void    setDontChangeInsPoint(void);
00440     void    allowChangeInsPoint(void);
00441 
00442     bool    getAttributes(const PP_AttrProp ** ppSpanAP, const PP_AttrProp ** ppBlockAP = NULL, PT_DocPosition posStart = 0) const;
00443 
00444     /* Experimental, for the moment; use with caution. - fjf, 24th Oct. '04
00445      */
00446     // - begin
00447     bool    getAllAttrProp(const PP_AttrProp *& pSpanAP, const PP_AttrProp *& pBlockAP, const PP_AttrProp *& pSectionAP, const PP_AttrProp *& pDocAP) const;
00448     bool    queryCharFormat(const gchar * szProperty, UT_UTF8String & szValue, bool & bExplicitlyDefined, bool & bMixedSelection) const;
00449     bool    queryCharFormat(const gchar * szProperty, UT_UTF8String & szValue, bool & bExplicitlyDefined, PT_DocPosition position) const;
00450     // - end
00451 
00452     bool    setCharFormat(const PP_PropertyVector & properties,
00453                           const PP_PropertyVector & attribs = PP_NOPROPS);
00454     bool    resetCharFormat(bool bAll);
00455     bool    getCharFormat(PP_PropertyVector & properties, bool bExpandStyles = true) const;
00456     bool    getCharFormat(PP_PropertyVector & properties, bool bExpandStyles, PT_DocPosition posStart) const;
00457     fl_BlockLayout * getBlockFromSDH(pf_Frag_Strux* sdh);
00458     bool    setStyle(const gchar * style, bool bDontGeneralUpdate=false);
00459     bool    setStyleAtPos(const gchar * style, PT_DocPosition posStart, PT_DocPosition posEnd, bool bDontGeneralUpdate=false);
00460     bool    isNumberedHeadingHere(fl_BlockLayout * pBlock) const;
00461     bool    getStyle(const gchar ** style) const;
00462     bool appendStyle(const PP_PropertyVector & style);
00463 
00464     UT_uint32       getCurrentPageNumber(void) const;
00465 
00466     bool    getEditableBounds(bool bEnd, PT_DocPosition & docPos, bool bOverride=false)const;
00467 
00468     bool    isParaBreakNeededAtPos(PT_DocPosition pos) const;
00469     bool    insertParaBreakIfNeededAtPos(PT_DocPosition pos);
00470     void    insertParagraphBreak(void);
00471     void    insertParagraphBreaknoListUpdate(void);
00472     void    insertSectionBreak( BreakSectionType type);
00473     void    insertSectionBreak(void);
00474     void    insertSymbol(UT_UCSChar c, const gchar * symfont);
00475 
00476     // ----------------------
00477     bool            isLeftMargin(UT_sint32 xPos, UT_sint32 yPos) const;
00478     void            selectRange( PT_DocPosition start, PT_DocPosition end );
00479     void            selectRange( const std::pair< PT_DocPosition, PT_DocPosition >& range );
00480     void            cmdSelect(UT_sint32 xPos, UT_sint32 yPos, FV_DocPos dpBeg, FV_DocPos dpEnd);
00481     void            cmdSelectTOC(UT_sint32 xPos, UT_sint32 yPos);
00482     bool            isTOCSelected(void) const;
00483     bool            setTOCProps(PT_DocPosition pos, const char * szProps);
00484 
00485     bool            cmdSelectNoNotify(PT_DocPosition dpBeg, PT_DocPosition dpEnd);
00486     void            cmdSelect(PT_DocPosition dpBeg, PT_DocPosition dpEnd);
00487     void            cmdSelect( const std::pair< PT_DocPosition, PT_DocPosition >& range );
00488     void            cmdCharMotion(bool bForward, UT_uint32 count);
00489     bool            cmdCharInsert(const UT_UCSChar * text, UT_uint32 count, bool bForce = false);
00490     bool            cmdCharInsert(const std::string& s, bool bForce = false);
00491     void            cmdCharDelete(bool bForward, UT_uint32 count);
00492     void            delTo(FV_DocPos dp);
00493     void            getSelectionText(UT_UCS4Char *& text) const;
00494 
00495     UT_UCSChar *    getTextBetweenPos(PT_DocPosition pos1, PT_DocPosition pos2) const;
00496     inline PT_DocPosition  getInsPoint () const { return m_iInsPoint; }
00497     void            warpInsPtToXY(UT_sint32 xPos, UT_sint32 yPos, bool bClick);
00498     void            moveInsPtTo(FV_DocPos dp, bool bClearSelection = true);
00499     void            moveInsPtTo(PT_DocPosition dp);
00500     void            warpInsPtNextPrevPage(bool bNext);
00501     void            warpInsPtNextPrevLine(bool bNext);
00502     void            warpInsPtNextPrevScreen(bool bNext);
00503     void            extSelHorizontal(bool bForward, UT_uint32 count);
00504     void            extSelToXY(UT_sint32 xPos, UT_sint32 yPos, bool bDrag);
00505     void            extSelToXYword(UT_sint32 xPos, UT_sint32 yPos, bool bDrag);
00506     void            extSelTo(FV_DocPos dp);
00507     void            swapSelectionOrientation(void);
00508 
00509 #ifdef ENABLE_SPELL
00510     SpellChecker * getDictForSelection () const;
00511 #endif
00512     void            extSelNextPrevLine(bool bNext);
00513     void            extSelNextPrevPage(bool bNext);
00514     void            extSelNextPrevScreen(bool bNext);
00515     void            endDrag(UT_sint32 xPos, UT_sint32 yPos);
00516 
00517     void endDragSelection(UT_sint32 xPos, UT_sint32 yPos);
00518 
00519     PT_DocPosition  getDocPositionFromXY(UT_sint32 xpos, UT_sint32 ypos, bool bNotFrames = false);
00520     PT_DocPosition  getDocPositionFromLastXY(void);
00521 
00522     fl_BlockLayout* getBlockAtPosition(PT_DocPosition pos) const {return _findBlockAtPosition(pos);};
00523     virtual void    updateScreen(bool bDirtyRunsOnly=true);
00524     bool            isInDocSection(PT_DocPosition pos = 0) const;
00525 
00526 //---------
00527 //Visual Drag stuff
00528 //
00529     void            cutVisualText(UT_sint32 x, UT_sint32 y);
00530     void            copyVisualText(UT_sint32 x, UT_sint32 y);
00531     void            dragVisualText(UT_sint32 x, UT_sint32 y);
00532     void            pasteVisualText(UT_sint32 x, UT_sint32 y);
00533     void            btn0VisualDrag(UT_sint32 x, UT_sint32 y);
00534     const FV_VisualDragText * getVisualText(void) const
00535       { return &m_VisualDragText;}
00536     FV_VisualDragText * getVisualText(void)
00537       { return &m_VisualDragText;}
00538     const UT_ByteBuf * getLocalBuf(void) const;
00539 
00540 //---------
00541 //Visual Inline Image Drag stuff
00542 //
00543     void            btn0InlineImage(UT_sint32 x, UT_sint32 y);
00544     void            btn1InlineImage(UT_sint32 x, UT_sint32 y);
00545     void            btn1CopyImage(UT_sint32 x, UT_sint32 y);
00546     void            dragInlineImage(UT_sint32 x, UT_sint32 y);
00547     void            releaseInlineImage(UT_sint32 x, UT_sint32 y);
00548 
00549 // -------
00550 // Frame stuff
00551 //
00552     FV_FrameEdit *  getFrameEdit(void);
00553     void            btn0Frame(UT_sint32 x, UT_sint32 y);
00554     void            btn1Frame(UT_sint32 x, UT_sint32 y);
00555     void            dragFrame(UT_sint32 x, UT_sint32 y);
00556     void            releaseFrame(UT_sint32 x, UT_sint32 y);
00557     bool            isInFrame(PT_DocPosition pos) const;
00558     void            deleteFrame(void);
00559     void            copyFrame(bool b_keepFrame = true);
00560     void            selectFrame(void);
00561     bool            isFrameSelected(void) const;
00562     void            activateFrame(void);
00563     fl_FrameLayout * getFrameLayout(PT_DocPosition pos) const;
00564     fl_FrameLayout * getFrameLayout(void) const;
00565     void            setFrameFormat(const PP_PropertyVector & props);
00566     void            setFrameFormat(const PP_PropertyVector & attribs, const PP_PropertyVector & props,
00567                                    fl_BlockLayout * pNewBL = NULL);
00568     void            setFrameFormat(const PP_PropertyVector & props, const FG_ConstGraphicPtr & pFG, const std::string & dataID,
00569                                    fl_BlockLayout * pNewBL = NULL);
00570     bool            getFrameStrings_view(UT_sint32 x, UT_sint32 y,fv_FrameStrings & FrameStrings,
00571                                          fl_BlockLayout ** pCloseBL,fp_Page ** ppPage);
00572     void            convertInLineToPositioned(PT_DocPosition pos,
00573                                             const PP_PropertyVector & attribs);
00574 
00575     bool            convertPositionedToInLine(fl_FrameLayout * pFrame);
00576     UT_Error        cmdInsertPositionedGraphic(const FG_ConstGraphicPtr& pFG, UT_sint32 mouseX, UT_sint32 mouseY);
00577     UT_Error        cmdInsertPositionedGraphic(const FG_ConstGraphicPtr& pFG);
00578 
00579 // ----------------------
00580 
00581     bool            isPosSelected(PT_DocPosition pos) const;
00582     bool            isXYSelected(UT_sint32 xPos, UT_sint32 yPos) const;
00583     FV_SelectionMode getSelectionMode(void) const;
00584     FV_SelectionMode getPrevSelectionMode(void) const;
00585     PD_DocumentRange * getNthSelection(UT_sint32 i) const;
00586     UT_sint32          getNumSelections(void) const;
00587     void            setSelectionMode(FV_SelectionMode selMode);
00588 #ifdef ENABLE_SPELL
00589 // ----------------------
00590 // Stuff for spellcheck context menu
00591 //
00592     UT_UCSChar *    getContextSuggest(UT_uint32 ndx);
00593     void            cmdContextSuggest(UT_uint32 ndx, fl_BlockLayout * ppBL = NULL, const fl_PartOfBlockPtr& ppPOB = fl_PartOfBlockPtr());
00594     void            cmdContextIgnoreAll(void);
00595     void            cmdContextAdd(void);
00596 #endif
00597 // ----------------------
00598 // Stuff for edittable Headers/Footers
00599 //
00600     bool                isInHdrFtr(PT_DocPosition pos) const;
00601     void                setHdrFtrEdit(fl_HdrFtrShadow * pShadow);
00602     void                clearHdrFtrEdit(void);
00603     bool                isHdrFtrEdit(void) const;
00604     fl_HdrFtrShadow *   getEditShadow(void) const;
00605     void                rememberCurrentPosition(void);
00606     PT_DocPosition      getSavedPosition(void) const;
00607     void                clearSavedPosition(void);
00608     void                markSavedPositionAsNeeded(void);
00609     bool                needSavedPosition(void) const;
00610     void                insertHeaderFooter(HdrFtrType hfType);
00611     bool                insertHeaderFooter(const PP_PropertyVector & props, HdrFtrType hfType, fl_DocSectionLayout * pDSL=NULL);
00612 
00613     void                cmdEditHeader(void);
00614     void                cmdEditFooter(void);
00615 
00616     void                cmdRemoveHdrFtr(bool isHeader);
00617     bool                isFooterOnPage(void) const;
00618     bool                isHeaderOnPage(void) const;
00619 
00620     void                SetupSavePieceTableState(void);
00621     void                RestoreSavedPieceTableState(void);
00622     void                removeThisHdrFtr(HdrFtrType hfType, bool bSkipPTSaves = false);
00623     void                createThisHdrFtr(HdrFtrType hfType, bool bSkipPTSaves = false);
00624     void                populateThisHdrFtr(HdrFtrType hfType, bool bSkipPTSaves = false);
00625     void                _populateThisHdrFtr(fl_HdrFtrSectionLayout * pHdrFtrSrc, fl_HdrFtrSectionLayout * pHdrFtrDest);
00626 
00627 //
00628 // ----------------------
00629 // Stuff for edittable Footnote/Endnotes
00630 //
00631     bool                insertFootnote(bool bFootnote);
00632     bool                insertFootnoteSection(bool bFootnote,const gchar * enpid);
00633     bool                isInFootnote(PT_DocPosition pos) const;
00634     bool                isInFootnote(void) const;
00635     bool                isInEndnote(PT_DocPosition pos) const;
00636     bool                isInEndnote(void) const;
00637     bool                isInAnnotation(PT_DocPosition pos) const;
00638     bool                isInAnnotation(void) const;
00639     fl_FootnoteLayout * getClosestFootnote(PT_DocPosition pos) const;
00640     fl_EndnoteLayout *  getClosestEndnote(PT_DocPosition pos) const;
00641     fl_AnnotationLayout *  getClosestAnnotation(PT_DocPosition pos) const;
00642     UT_sint32           getEmbedDepth(PT_DocPosition pos) const;
00643     //
00644     // ----------------------------------
00645     // Stuff for Annotaions
00646     //
00647     bool                insertAnnotation(UT_sint32 iAnnotation,
00648                                          const std::string & sDescr,
00649                                          const std::string & sAuthor,
00650                                          const std::string & sTitle,
00651                                          bool bReplace);
00652     bool                getAnnotationText(UT_uint32 iAnnotation, std::string & sText) const;
00653     std::string         getAnnotationText(UT_uint32 iAnnotation) const;
00654     bool                setAnnotationText(UT_uint32 iAnnotation, const std::string & sText);
00655     bool                setAnnotationText(UT_uint32 iAnnotation, const std::string & sText,
00656                                           const std::string & sAuthor, const std::string & sTitle);
00657     bool                getAnnotationRichText(UT_uint32 iAnnotation, std::string & sRTF) const;
00658     bool                setAnnotationRichText(UT_uint32 iAnnotation, const std::string & sRTF);
00659     // TODO getters and setters to implement/change/add as judged necessary
00660     bool                getAnnotationTitle(UT_uint32 iAnnotation, std::string & sTitle) const;
00661     std::string         getAnnotationTitle(UT_uint32 iAnnotation) const;
00662     bool                setAnnotationTitle(UT_uint32 iAnnotation, const std::string & sTitle);
00663     bool                getAnnotationAuthor(UT_uint32 iAnnotation, std::string & sAuthor) const;
00664     std::string         getAnnotationAuthor(UT_uint32 iAnnotation) const;
00665     bool                setAnnotationAuthor(UT_uint32 iAnnotation, const std::string & sAuthor);
00666 
00667     bool                isAnnotationPreviewActive(void) const { return m_bAnnotationPreviewActive;}
00668     void                setAnnotationPreviewActive(bool b) { m_bAnnotationPreviewActive = b;}
00669     UT_uint32           getActivePreviewAnnotationID() const { return m_iAnnPviewID;}
00670     void                setActivePreviewAnnotationID(UT_uint32 iID) { m_iAnnPviewID = iID;}
00671     void                killAnnotationPreview();
00672     bool                cmdEditAnnotationWithDialog(UT_uint32 aID);
00673     fl_AnnotationLayout * insertAnnotationDescription(UT_uint32 aID, AP_Dialog_Annotation *pDialog);
00674     fl_AnnotationLayout * getAnnotationLayout(UT_uint32 iAnnotation) const;
00675     bool                selectAnnotation(fl_AnnotationLayout * pAL);
00676     UT_uint32           countAnnotations(void) const;
00677 
00678     FV_View_BubbleBlocker getBubbleBlocker();
00679     bool                  bubblesAreBlocked() const;
00680 // ----------------------
00681 
00682     bool        gotoTarget(AP_JumpTarget type, const UT_UCSChar * data);
00683     bool        gotoTarget(AP_JumpTarget type, const char *numberString);
00684 
00685     void            changeNumColumns(UT_uint32 iNumColumns);
00686 
00687 // ----------------------
00688 
00689     // find and replace
00690 
00691     void            findSetFindString   (const UT_UCSChar* string);
00692     void            findSetReplaceString(const UT_UCSChar* string);
00693     void            findSetReverseFind  (bool newValue);
00694     void            findSetMatchCase    (bool newValue);
00695     void            findSetWholeWord    (bool newValue);
00696     UT_UCSChar *    findGetFindString   (void);
00697     UT_UCSChar *    findGetReplaceString(void);
00698     bool            findGetReverseFind  ();
00699     bool            findGetMatchCase    ();
00700     bool            findGetWholeWord    ();
00701 
00702     bool            findAgain(void);
00703 
00704     void            findSetStartAt(PT_DocPosition pos);
00705     void            findSetStartAtInsPoint(void);
00706 
00707     bool            findNext(bool& bDoneEntireDocument);
00708     bool            findNext(const UT_UCSChar* pFind, bool& bDoneEntireDocument);
00709 
00710     UT_uint32*      _computeFindPrefix(const UT_UCSChar* pFind);
00711 
00712     bool            _findNext(UT_uint32* pPrefix,
00713                              bool& bDoneEntireDocument);
00714 
00715     bool            findPrev(bool& bDoneEntireDocument);
00716     bool            findPrev(const UT_UCSChar* pFind, bool& bDoneEntireDocument);
00717 
00718     bool            _findPrev(UT_uint32* pPrefix,
00719                               bool& bDoneEntireDocument);
00720 
00721     bool            findReplaceReverse(bool& bDoneEntireDocument);
00722 
00723     bool            _findReplaceReverse(UT_uint32* pPrefix,
00724                                         bool& bDoneEntireDocument,
00725                                         bool bNoUpdate);
00726 
00727     bool            _findReplace(UT_uint32* pPrefix,
00728                                  bool& bDoneEntireDocument,
00729                                  bool bNoUpdate);
00730 
00731 
00732     bool            findReplace(bool& bDoneEntireDocument);
00733 
00734     UT_uint32       findReplaceAll();
00735 
00736 // ----------------------
00737 
00738 #if defined(PT_TEST) || defined(FMT_TEST) || defined(UT_TEST)
00739     void            Test_Dump(void);
00740 #endif
00741 
00742 // ----------------------
00743 
00744     FV_DocCount         countWords(bool bActuallyCountWords = true);
00745 
00746 // -----------------------
00747 
00748     bool                insertPageNum(const PP_PropertyVector & props, HdrFtrType hfType);
00749     virtual void        setPoint(UT_uint32 pt);
00750     void                ensureInsertionPointOnScreen(void);
00751     void                removeCaret(const std::string& sCaretID);
00752     void                addCaret(PT_DocPosition docPos,UT_sint32 iAuthorId);
00753     void                setPointRemote(PT_DocPosition docPos);
00754     void                updateCarets(PT_DocPosition docPos, UT_sint32 iLen);
00755     void            fixInsertionPointCoords(void);
00756 
00757 // -----------------------
00758     void                killBlink(void);
00759     void                setShowPara(bool);
00760     inline bool     getShowPara(void) const { return m_bShowPara; };
00761 
00762     const fp_PageSize&  getPageSize(void) const;
00763     virtual UT_uint32   calculateZoomPercentForPageWidth() const;
00764     virtual UT_uint32   calculateZoomPercentForPageHeight() const;
00765     virtual UT_uint32   calculateZoomPercentForWholePage() const;
00766     void                setViewMode (ViewMode vm);
00767     ViewMode            getViewMode (void) const  {return m_viewMode;}
00768     bool                isPreview(void) const {return VIEW_PREVIEW == m_viewMode;}
00769     void                setPreviewMode(PreViewMode pre) {m_previewMode = pre;}
00770     PreViewMode         getPreviewMode(void) { return m_previewMode;}
00771 
00772     UT_uint32           getTabToggleAreaWidth() const;
00773     UT_sint32           getNormalModeXOffset() const;
00774 
00775     void                setScreenUpdateOnGeneralUpdate( bool bDoit)
00776         {m_bDontUpdateScreenOnGeneralUpdate = !bDoit;}
00777     bool                shouldScreenUpdateOnGeneralUpdate(void) const
00778         { return !m_bDontUpdateScreenOnGeneralUpdate;}
00779 
00780     inline PD_Document * getDocument (void) const {return m_pDoc;}
00781 
00782     /* Revision related functions */
00783     void                toggleMarkRevisions();
00784     void                cmdAcceptRejectRevision(bool bReject, UT_sint32 x, UT_sint32 y);
00785     // NB: 'mark revisions' state is document-wide
00786     bool                isMarkRevisions() const;
00787     // NB: 'show revisions' state is view-specific
00788     bool                isShowRevisions() const {return m_bShowRevisions;}
00789     void                toggleShowRevisions();
00790     void                setShowRevisions(bool bShow);
00791 
00792     void                cmdSetRevisionLevel(UT_uint32 i);
00793     UT_uint32           getRevisionLevel()const;
00794     void                setRevisionLevel(UT_uint32 i);
00795 
00796     bool                cmdFindRevision(bool bNext, UT_sint32 xPos, UT_sint32 yPos);
00797     bool                doesSelectionContainRevision() const;
00798 
00799     void                updateRevisionMode();
00800   protected:
00801     void                _fixInsertionPointAfterRevision();
00802     bool                _makePointLegal(void);
00803   public:
00804 
00805     /* Table related functions */
00806     bool                isPointLegal(PT_DocPosition pos) const;
00807     bool                isPointLegal(void) const;
00808     bool                isInTable() const;
00809     fl_TableLayout *    getTableAtPos(PT_DocPosition) const;
00810     bool                isInTable(PT_DocPosition pos) const;
00811     bool                cmdAutoSizeCols(void);
00812     bool                cmdTextToTable(UT_uint32 iDelim);
00813     bool                cmdAutoSizeRows(void);
00814     bool                cmdAdvanceNextPrevCell(bool bGoNext);
00815     fp_CellContainer *  getCellAtPos(PT_DocPosition pos) const;
00816     PT_DocPosition      findCellPosAt(PT_DocPosition posTable, UT_sint32 row, UT_sint32 col) const;
00817     bool                _deleteCellAt(PT_DocPosition posTable,UT_sint32 row, UT_sint32 col);
00818     bool                _restoreCellParams(PT_DocPosition posTable, pf_Frag_Strux* tableSDH);
00819     bool                _changeCellParams(PT_DocPosition posTable,pf_Frag_Strux* tableSDH );
00820     bool                deleteCellAt(PT_DocPosition posTable,UT_sint32 row, UT_sint32 col);
00821     bool                cmdDeleteCell(PT_DocPosition pos);
00822     bool                cmdDeleteCol(PT_DocPosition pos);
00823     bool                cmdDeleteRow(PT_DocPosition pos);
00824     bool                cmdDeleteTable(PT_DocPosition pos, bool bDontNotify=false);
00825     bool                cmdInsertRow(PT_DocPosition posTable, bool bBfore);
00826     bool                cmdInsertCol(PT_DocPosition posTable, bool bBefore);
00827     bool                cmdSplitCells(AP_CellSplitType iSplitType);
00828     bool                cmdSelectColumn(PT_DocPosition posOfColumn);
00829     bool                cmdAutoFitTable(void);
00830     bool                cmdMergeCells(PT_DocPosition posSource, PT_DocPosition posDestination);
00831     bool                cmdTableToText(PT_DocPosition posSource,UT_sint32 iSepType);
00832 
00833     bool                _MergeCells( PT_DocPosition posDestination,PT_DocPosition posSource, bool bBefore);
00834     bool                getCellParams(PT_DocPosition posCol, UT_sint32 *iLeft,
00835                                       UT_sint32 *iRight,UT_sint32 *iTop, UT_sint32 *iBot) const;
00836     bool                getCellLineStyle(PT_DocPosition posCell, UT_sint32 * pLeft, UT_sint32 * pRight,
00837                                          UT_sint32 * pTop, UT_sint32 * pBot) const;
00838     bool                setCellFormat(const PP_PropertyVector & properties, FormatTable applyTo, const FG_ConstGraphicPtr & pFG, UT_String & sDataID);
00839     bool                getCellProperty(PT_DocPosition pos, const gchar * szPropName, gchar * &szPropValue) const;
00840     bool                setTableFormat(const PP_PropertyVector & properties);
00841     bool                setTableFormat(PT_DocPosition pos,const PP_PropertyVector & properties);
00842     bool                getCellFormat(PT_DocPosition pos, std::string & sCellProps) const;
00843 
00844     UT_Error            cmdInsertTable(UT_sint32 numRows, UT_sint32 numCols,
00845                                        const PP_PropertyVector & pPropsArray);
00846     void                _generalUpdate(void);
00847 
00848     UT_RGBColor         getColorShowPara(void) const { return m_colorShowPara; }
00849 #ifdef ENABLE_SPELL
00850     UT_RGBColor         getColorSquiggle(FL_SQUIGGLE_TYPE iSquiggleType) const;
00851 #endif
00852     UT_RGBColor         getColorMargin(void) const { return m_colorMargin; }
00853     UT_RGBColor         getColorSelBackground(void);
00854     UT_RGBColor         getColorSelForeground(void) const;
00855     UT_RGBColor         getColorFieldOffset(void) const { return m_colorFieldOffset; }
00856     UT_RGBColor         getColorImage(void) const { return m_colorImage; }
00857     UT_RGBColor         getColorImageResize(void) const { return m_colorImageResize; }
00858     UT_RGBColor         getColorHyperLink(void) const { return m_colorHyperLink; }
00859     UT_RGBColor         getColorAnnotation(const fp_Run * pRun) const;
00860     UT_RGBColor         getColorAnnotation(fp_Page * pPage,UT_uint32 pid) const;
00861     UT_RGBColor         getColorRDFAnchor(const fp_Run * pRun) const;
00862     UT_RGBColor         getColorRevisions(int rev) const {
00863         if ((rev < 0) || (rev > 9)) rev = 9;
00864         return m_colorRevisions[rev]; }
00865     UT_RGBColor         getColorHdrFtr(void) const { return m_colorHdrFtr; }
00866     UT_RGBColor         getColorColumnLine(void) const { return m_colorColumnLine; }
00867 
00868     void                getVisibleDocumentPagesAndRectangles(UT_GenericVector<UT_Rect*> &vRect,
00869                                                              UT_GenericVector<fp_Page*> &vPages) const;
00870 
00871     //
00872     // image selection && resizing && dragging functions
00873     //
00874     UT_sint32           getImageSelInfo() const;
00875     GR_Graphics::Cursor getImageSelCursor() const;
00876     bool                isImageSelected(void) const;
00877 
00878 //
00879 // Table resizing
00880 //
00881     void                setDragTableLine(bool bSet)
00882                         { m_bDragTableLine = bSet;}
00883     bool                getDragTableLine(void) const
00884                         { return m_bDragTableLine;}
00885     void                setTopRuler(AP_TopRuler * pRuler)
00886                         { m_pTopRuler = pRuler;}
00887     AP_TopRuler *       getTopRuler(void) const
00888                         { return m_pTopRuler;}
00889     void                setLeftRuler(AP_LeftRuler * pRuler)
00890                         { m_pLeftRuler = pRuler;}
00891     AP_LeftRuler *       getLeftRuler(void) const
00892                         { return m_pLeftRuler;}
00893 
00894 
00895     PP_PropertyVector   getViewPersistentProps() const;
00896     FV_BIDI_Order       getBidiOrder()const {return m_eBidiOrder;}
00897     void                setBidiOrder(FV_BIDI_Order o) {m_eBidiOrder = o;}
00898 
00899     bool                isMathSelected(UT_sint32 x, UT_sint32 y, PT_DocPosition & pos) const;
00900     // -- plugins
00901         bool                isMathLoaded(void) const;
00902     bool                isGrammarLoaded(void) const;
00903     // --
00904 
00905     UT_uint32           getNumHorizPages(void) const; 
00906     void                calculateNumHorizPages(void);
00907     UT_uint32           getMaxHeight(UT_uint32 iRow) const;
00908     UT_uint32           getWidthPrevPagesInRow(UT_uint32 iPageNumber) const;
00909     UT_uint32           getWidthPagesInRow(fp_Page *page) const;
00910     UT_uint32           getHorizPageSpacing(void) const;
00911     bool                rtlPages(void) const;
00912 
00913 protected:
00914     void                _updateDatesBeforeSave(bool bOverwriteCreated);
00915     void                _saveAndNotifyPieceTableChange(void);
00916     void                _restorePieceTableState(void);
00917 
00918     void                _draw(UT_sint32, UT_sint32, UT_sint32, UT_sint32, bool bDirtyRunsOnly, bool bClip=false);
00919 
00920     void                _drawBetweenPositions(PT_DocPosition left, PT_DocPosition right);
00921     bool                _clearBetweenPositions(PT_DocPosition left, PT_DocPosition right, bool bFullLineHeightRect);
00922     bool                        _drawOrClearBetweenPositions(PT_DocPosition iPos1, PT_DocPosition iPos2, bool bClear, bool bFullLineHeight);
00923     bool                _ensureInsertionPointOnScreen();
00924     void                _moveInsPtNextPrevPage(bool bNext);
00925     void                _moveInsPtNextPrevScreen(bool bNext, bool bClearSelection);
00926     void                _moveInsPtNextPrevLine(bool bNext);
00927     fp_Line *           _getNextLineInDoc(fp_Container * pCon) const;
00928     fp_Page *           _getCurrentPage(void) const;
00929     void                _moveInsPtNthPage(UT_sint32 n);
00930     void                _moveInsPtToPage(fp_Page *page);
00931     void                _insertSectionBreak(void);
00932     void                _getPageXandYOffset(const fp_Page* pPage, UT_sint32& xoff, UT_sint32& yoff, bool bYOnly) const;
00933 
00934     PT_DocPosition      _getDocPosFromPoint(PT_DocPosition iPoint, FV_DocPos dp, bool bKeepLooking=true) const;
00935     PT_DocPosition      _getDocPos(FV_DocPos dp, bool bKeepLooking=true) const;
00936     void                _findPositionCoords(PT_DocPosition pos,
00937                                             bool b,
00938                                             UT_sint32& x,
00939                                             UT_sint32& y,
00940                                             UT_sint32& x2, //these are needed for BiDi split carret
00941                                             UT_sint32& y2,
00942 
00943                                             UT_uint32& height,
00944                                             bool& bDirection,
00945                                             fl_BlockLayout** ppBlock,
00946                                             fp_Run** ppRun)const;
00947 
00948     fl_BlockLayout*     _findBlockAtPosition(PT_DocPosition pos) const;
00949 
00950     fp_Page*            _getPageForXY(UT_sint32 xPos,
00951                                       UT_sint32 yPos,
00952                                       UT_sint32& xClick,
00953                                       UT_sint32& yClick) const;
00954     bool                _insertField(const char* szName,
00955                                      const PP_PropertyVector & extra_attrs = PP_NOPROPS,
00956                                      const PP_PropertyVector & extra_props = PP_NOPROPS);
00957     void                _moveToSelectionEnd(bool bForward);
00958     void                _eraseSelection(void);
00959     void                _clearSelection(bool bRedraw = true);
00960     void                _resetSelection(void);
00961     void                _setSelectionAnchor(void);
00962     void                _deleteSelection(PP_AttrProp *p_AttrProp_Before = NULL,
00963                              bool bNoUpdate = false,
00964                              bool bCaretLeft = false);
00965     bool                _insertFormatPair(const gchar * szName, const gchar * properties[]);
00966     void                _updateInsertionPoint();
00967     void                _fixInsertionPointCoords(bool bIgnoreAll = false);
00968     void                _fixInsertionPointCoords(fv_CaretProps * pCP) const;
00969     void                _fixAllInsertionPointCoords(void) const;
00970 
00971     void                _drawSelection();
00972     void                _extSel(UT_uint32 iOldPoint);
00973     void                _extSelToPos(PT_DocPosition pos);
00974     UT_Error            _insertGraphic(const FG_ConstGraphicPtr&, const char*);
00975     UT_Error            _insertGraphic(const FG_ConstGraphicPtr&, const char*, PT_DocPosition pos);
00976 
00977     UT_UCSChar *        _lookupSuggestion(fl_BlockLayout* pBL, const fl_PartOfBlockPtr& pPOB, UT_sint32 ndx);
00978 
00979     static void         _autoScroll(UT_Worker * pTimer);
00980     static void         _actuallyScroll(UT_Worker * pTimer);
00981 
00982     // localize handling of insertion point logic
00983     void                _setPoint(PT_DocPosition pt, bool bEOL = false);
00984     void                _setPoint(fv_CaretProps * pCP, PT_DocPosition pt, UT_sint32 iLen) const;
00985     UT_uint32           _getDataCount(UT_uint32 pt1, UT_uint32 pt2) const;
00986     bool                _charMotion(bool bForward,UT_uint32 countChars, bool bSkipCannotContainPoint = true);
00987     void                _doPaste(bool bUseClipboard, bool bHonorFormatting = true);
00988     void                _clearIfAtFmtMark(PT_DocPosition dpos);
00989 
00990 #ifdef ENABLE_SPELL
00991     void                _checkPendingWordForSpell(void);
00992 #endif
00993 
00994     bool                _isSpaceBefore(PT_DocPosition pos) const;
00995     void                _removeThisHdrFtr(fl_HdrFtrSectionLayout * pHdrFtr);
00996     void                _cmdEditHdrFtr(HdrFtrType hfType);
00997 
00998     UT_Error            _deleteBookmark(const char* szName, bool bSignal, PT_DocPosition * pos1 = NULL, PT_DocPosition * pos2 = NULL);
00999     UT_Error            _deleteHyperlink(PT_DocPosition &i, bool bSignal);
01000 
01001     UT_Error            _deleteXMLID( const std::string& xmlid, bool bSignal, PT_DocPosition& posStart, PT_DocPosition& posEnd );
01002     UT_Error            _deleteXMLID( const std::string& xmlid, bool bSignal );
01003     fp_HyperlinkRun *   _getHyperlinkInRange(PT_DocPosition &posStart,
01004                                              PT_DocPosition &posEnd);
01005     bool                _charInsert(const UT_UCSChar * text, UT_uint32 count, bool bForce = false);
01006 
01007     void                _adjustDeletePosition(UT_uint32 &iDocPos, UT_uint32 &iCount);
01008 
01009 
01010     void                incremenetBubbleBlockerCount();
01011     void                decremenetBubbleBlockerCount();
01012     bool                _changeCellTo(PT_DocPosition posTable,UT_sint32 rowOld,
01013                                       UT_sint32 colOld, UT_sint32 left, UT_sint32 right,
01014                                       UT_sint32 top, UT_sint32 bot);
01015     bool                _insertCellAt(PT_DocPosition posCell, UT_sint32 left, UT_sint32 right, UT_sint32 top,
01016                                       UT_sint32 bot,
01017                                       const PP_PropertyVector & attrsBlock,
01018                                       const PP_PropertyVector & propsBlock);
01019     bool                _changeCellAttach(PT_DocPosition posCell, UT_sint32 left, UT_sint32 right,
01020                                       UT_sint32 top, UT_sint32 bot);
01021 
01022 
01023 private:
01024 
01025     UT_uint32           m_iNumHorizPages; 
01026     UT_uint32           m_getNumHorizPagesCachedWindowWidth;
01027     bool                m_autoNumHorizPages;
01028     UT_uint32           m_horizPageSpacing;
01029 
01030     PT_DocPosition      m_iInsPoint;
01031     UT_sint32           m_xPoint;
01032     UT_sint32           m_yPoint;
01033     //the followingare BiDi specific, but need to be in place because of the
01034     //change to the signature of findPointCoords
01035     UT_sint32           m_xPoint2;
01036     UT_sint32           m_yPoint2;
01037     bool                m_bPointDirection;
01038     bool                m_bDefaultDirectionRtl;
01039     bool                m_bUseHebrewContextGlyphs;
01040     UT_uint32           m_iPointHeight;
01041     UT_sint32           m_xPointSticky;     // used only for _moveInsPtNextPrevLine()
01042 
01043     bool                m_bPointVisible;
01044     bool                m_bPointEOL;
01045     FL_DocLayout*       m_pLayout;
01046     PD_Document*        m_pDoc;
01047     GR_Graphics*        m_pG;
01048     void*               m_pParentData;
01049 
01050     // autoscroll stuff
01051     UT_Timer *          m_pAutoScrollTimer;
01052     UT_sint32           m_xLastMouse;
01053     UT_sint32           m_yLastMouse;
01054 
01055     bool                m_bCursorIsOn;
01056     bool                m_bEraseSaysStopBlinking;
01057     bool                m_bCursorBlink;
01058 
01059     bool                m_bdontSpellCheckRightNow;
01060     fv_ChangeState      m_chg;
01061 
01062     // find and replace stuff
01063     bool                m_wrappedEnd;
01064     PT_DocPosition      m_startPosition;
01065 
01066     bool                m_doneFind;
01067 
01068     bool                m_bEditHdrFtr;
01069     fl_HdrFtrShadow *   m_pEditShadow;
01070     PT_DocPosition      m_iSavedPosition;
01071     bool                m_bNeedSavedPosition;
01072     PT_DocPosition      _BlockOffsetToPos(fl_BlockLayout * block, PT_DocPosition offset) const;
01073 
01074     fl_BlockLayout *    _findGetCurrentBlock(void) const;
01075     PT_DocPosition      _findGetCurrentOffset(void) const;
01076     UT_UCSChar *        _findGetNextBlockBuffer(fl_BlockLayout ** block, PT_DocPosition *offset);
01077     UT_UCSChar *        _findGetPrevBlockBuffer(fl_BlockLayout ** block, PT_DocPosition *offset, UT_sint32& endIndex);
01078 
01079     bool                m_bReverseFind;
01080     bool                m_bWholeWord;
01081     bool                m_bMatchCase;
01082     UT_UCSChar *        m_sFind;
01083     UT_UCSChar *        m_sReplace;
01084 
01085     UT_sint32           _findBlockSearchRegexp(const UT_UCSChar * haystack, const UT_UCSChar * needle);
01086 
01087     // prefs listener - to change cursor blink on/off (and possibly others)
01088     static void _prefsListener( XAP_Prefs *, UT_StringPtrMap *, void *);
01089 
01090     bool                 m_bShowPara;
01091     ViewMode             m_viewMode;
01092     PreViewMode          m_previewMode;
01093     bool                 m_bDontUpdateScreenOnGeneralUpdate;
01094     //#TF had to change the whole logic of storing PT state, since
01095     //the earlier implementation did not work with nested calls to
01096     //_saveAndNotifyPieceTableChange();
01097     UT_uint32           m_iPieceTableState;
01098 
01099     UT_sint32           m_iMouseX;
01100     UT_sint32           m_iMouseY;
01101 
01102     UT_uint32           m_iViewRevision;
01103 
01104     bool                m_bWarnedThatRestartNeeded;
01105 
01106     // properties for image selection
01107     UT_Rect             m_selImageRect;
01108     GR_Graphics::Cursor m_imageSelCursor;
01109     UT_sint32           m_ixResizeOrigin;
01110     UT_sint32           m_iyResizeOrigin;
01111     bool                m_bIsResizingImage;
01112     UT_Rect             m_curImageSel;
01113 #if XAP_DONTUSE_XOR
01114     GR_Image*           m_curImageSelCache;
01115 #endif
01116     // properties for image dragging
01117     bool                m_bIsDraggingImage;
01118     fp_Run *            m_pDraggedImageRun;
01119     UT_Rect             m_dragImageRect;
01120     UT_sint32           m_ixDragOrigin;
01121     UT_sint32           m_iyDragOrigin;
01122 
01123     // default color values
01124     UT_RGBColor         m_colorShowPara;
01125     UT_RGBColor         m_colorSpellSquiggle;
01126     UT_RGBColor         m_colorGrammarSquiggle;
01127     UT_RGBColor         m_colorMargin;
01128     UT_RGBColor         m_colorFieldOffset;
01129     UT_RGBColor         m_colorImage;
01130     UT_RGBColor         m_colorImageResize;
01131     UT_RGBColor         m_colorHyperLink;
01132     UT_RGBColor         m_colorRevisions[10];
01133     UT_RGBColor         m_colorHdrFtr;
01134     UT_RGBColor         m_colorColumnLine;
01135     UT_RGBColor         m_colorAnnotations[10];
01136     UT_RGBColor         m_colorRDFAnchors[10];
01137 
01138     UT_uint32 m_countDisable; // cursor disable count
01139     bool                m_bDragTableLine;
01140     EV_EditMouseContext m_prevMouseContext;
01141     AP_TopRuler *       m_pTopRuler;
01142     AP_LeftRuler *      m_pLeftRuler;
01143     bool                m_bInFootnote;
01144 
01145     FV_Caret_Listener * m_caretListener;
01146     bool m_bgColorInitted;
01147     PT_DocPosition      m_iLowDrawPoint;
01148     PT_DocPosition      m_iHighDrawPoint;
01149     mutable fv_PropCache        m_CharProps;
01150     mutable fv_PropCache        m_BlockProps;
01151     mutable fv_PropCache        m_SecProps;
01152     AV_ListenerId       m_CaretListID;
01153 #ifdef TOOLKIT_GTK_ALL
01154     FV_UnixFrameEdit    m_FrameEdit;
01155 #else
01156     FV_FrameEdit        m_FrameEdit;
01157 #endif
01158 #ifdef TOOLKIT_GTK_ALL
01159     FV_UnixVisualDrag   m_VisualDragText;
01160 #else
01161     FV_VisualDragText   m_VisualDragText;
01162 #endif
01163     FV_Selection        m_Selection;
01164     bool                m_bShowRevisions;
01165 
01166     FV_BIDI_Order       m_eBidiOrder;
01167     UT_uint32           m_iFreePass;
01168     bool                m_bDontNotifyListeners;
01169     UT_ByteBuf *        m_pLocalBuf;
01170     UT_sint32           m_iGrabCell;
01171 #ifdef TOOLKIT_GTK_ALL
01172     FV_UnixVisualInlineImage  m_InlineImage;
01173 #else
01174     FV_VisualInlineImage  m_InlineImage;
01175 #endif
01176     bool                m_bInsertAtTablePending;
01177     PT_DocPosition      m_iPosAtTable;
01178     UT_GenericVector<fv_CaretProps *> m_vecCarets;
01179     std::string       m_sDocUUID;
01180     bool                m_bAnnotationPreviewActive;
01181     UT_uint32           m_iAnnPviewID;
01182     bool                m_bAllowSmartQuoteReplacement;  // Enable/disable replacing of quote with smart quote
01183                                                         // This allows temporarily disabling smart quotes to allow inserting ANSI quote.
01184     int                 m_bubbleBlockerCount;
01185     UT_sint32           m_iOldPageCount;
01186 
01187 #if defined(TOOLKIT_GTK_ALL)
01188     FV_UnixSelectionHandles m_SelectionHandles;
01189 #else
01190     FV_SelectionHandles m_SelectionHandles;
01191 #endif
01192 
01193 public:
01194     bool registerDoubleBufferingObject(FV_ViewDoubleBuffering *obj);
01195     bool unregisterDoubleBufferingObject(FV_ViewDoubleBuffering *obj);
01196 private:
01197     FV_ViewDoubleBuffering *m_pViewDoubleBufferingObject;
01198 };
01199 
01200 #endif /* FV_VIEW_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1