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

Generated on Thu May 23 2013 for AbiWord by  doxygen 1.7.1