2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:18:45 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:18:45 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:18:45 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:18:45 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:18:45 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 13:18:45 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
#ifndef _LAYACT_HXX
|
|
|
|
#define _LAYACT_HXX
|
|
|
|
#include "swtypes.hxx"
|
|
|
|
#include "swrect.hxx"
|
|
|
|
|
|
|
|
class SwRootFrm;
|
|
|
|
class SwLayoutFrm;
|
|
|
|
class SwPageFrm;
|
|
|
|
class SwFlyFrm;
|
|
|
|
class SwCntntFrm;
|
|
|
|
class SwTabFrm;
|
|
|
|
class SwViewImp;
|
|
|
|
class SwCntntNode;
|
|
|
|
class SwWait;
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i28701#
|
2004-08-02 13:05:30 +00:00
|
|
|
class SfxProgress;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Die Verwendung der LayAction laeuft immer gleich ab:
|
|
|
|
//
|
|
|
|
// 1. Erzeugen des LayAction-Objektes.
|
|
|
|
// 2. Einstellen des gewuenschten Verhaltens mittels der Set-Methoden
|
|
|
|
// 3. Aufruf von Action()
|
|
|
|
// 4. Baldiges Zerstoeren des Objektes.
|
|
|
|
//
|
|
|
|
// Das Objekt meldet sich im CTor beim SwViewImp an und erst im DTor
|
|
|
|
// wieder ab! Es handelt sich mithin um ein typisches Stackobjekt.
|
|
|
|
|
|
|
|
|
|
|
|
class SwLayAction
|
|
|
|
{
|
|
|
|
SwRootFrm *pRoot;
|
|
|
|
SwViewImp *pImp; //Hier Meldet sich die Action an und ab.
|
|
|
|
|
|
|
|
//Zur Optimierung, damit die Tabellen etwas besser am Crsr kleben beim
|
|
|
|
//Return/Backspace davor.
|
|
|
|
//Wenn der erste TabFrm, der sich Paintet (pro Seite) traegt sich im
|
|
|
|
//Pointer ein. Die CntntFrms unterhalb der Seite brauchen sich
|
|
|
|
//dann nicht mehr bei der Shell zum Painten anmelden.
|
|
|
|
const SwTabFrm *pOptTab;
|
|
|
|
|
|
|
|
SwWait *pWait;
|
|
|
|
|
2002-11-01 14:33:33 +00:00
|
|
|
SfxProgress * pProgress;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//Wenn ein Absatz - oder was auch immer - bei der Formatierung mehr
|
|
|
|
//als eine Seite rueckwaerts floss traegt er seine neue Seitennummer
|
|
|
|
//hier ein. Die Steuerung der InternalAction kann dann geeignet reagieren.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nPreInvaPage;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uLong nStartTicks; //Startzeitpunkt der Aktion, vergeht zu viel Zeit kann
|
2000-09-18 23:08:29 +00:00
|
|
|
//der WaitCrsr per CheckWaitCrsr() eingeschaltet werden.
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nInputType; //Bei welchem Input soll die Verarbeitung abgebrochen
|
2000-09-18 23:08:29 +00:00
|
|
|
//werden?
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nEndPage; //StatBar Steuerung.
|
|
|
|
sal_uInt16 nCheckPageNum; //CheckPageDesc() wurde verzoegert wenn != USHRT_MAX
|
2000-09-18 23:08:29 +00:00
|
|
|
//ab dieser Seite Checken.
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bPaint; //Painten oder nur Formatieren?
|
|
|
|
sal_Bool bComplete; //Alles bis zum sichtbaren Bereich Formatieren oder
|
2000-09-18 23:08:29 +00:00
|
|
|
//oder nur den sichtbaren Bereich?
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bCalcLayout; //Vollstaendige Reformatierung?
|
|
|
|
sal_Bool bAgain; //Zur automatisch wiederholten Action wenn Seiten
|
2000-09-18 23:08:29 +00:00
|
|
|
//geloscht werden.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bNextCycle; //Wiederaufsetzen bei der ersten Ungueltigen Seite.
|
|
|
|
sal_Bool bInput; //Zum Abbrechen der Verarbeitung wenn ein Input anliegt.
|
|
|
|
sal_Bool bIdle; //True wenn die Layaction vom Idler ausgeloest wurde.
|
|
|
|
sal_Bool bReschedule; //Soll das Reschedule - abhaengig vom Progress -
|
2000-09-18 23:08:29 +00:00
|
|
|
//gerufen werden?
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bCheckPages; //CheckPageDescs() ausfuehren oder verzoegern.
|
|
|
|
sal_Bool bUpdateExpFlds;//Wird gesetzt wenn nach dem Formatierien noch eine
|
2000-09-18 23:08:29 +00:00
|
|
|
//Runde fuer den ExpFld laufen muss.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bBrowseActionStop; //Action fruehzeitig beenden (per bInput) und den
|
2000-09-18 23:08:29 +00:00
|
|
|
//Rest dem Idler ueberlassen.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bWaitAllowed; //Wartecursor erlaubt?
|
|
|
|
sal_Bool bPaintExtraData; //Anzeige von Zeilennumerierung o. ae. eingeschaltet?
|
|
|
|
sal_Bool bActionInProgress; // wird in Action() anfangs gesetzt und zum Schluss geloescht
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2003-04-28 14:17:17 +00:00
|
|
|
// OD 14.04.2003 #106346# - new flag for content formatting on interrupt.
|
|
|
|
sal_Bool mbFormatCntntOnInterrupt;
|
2004-08-02 13:05:30 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#ifdef _LAYACT_CXX
|
|
|
|
|
|
|
|
void PaintCntnt( const SwCntntFrm *, const SwPageFrm *,
|
|
|
|
const SwRect &rOldRect, long nOldBottom );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool PaintWithoutFlys( const SwRect &, const SwCntntFrm *,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwPageFrm * );
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_Bool _PaintCntnt( const SwCntntFrm *, const SwPageFrm *,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwRect & );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool FormatLayout( SwLayoutFrm *, sal_Bool bAddRect = sal_True );
|
|
|
|
sal_Bool FormatLayoutTab( SwTabFrm *, sal_Bool bAddRect = sal_True );
|
|
|
|
sal_Bool FormatCntnt( const SwPageFrm* pPage );
|
2003-04-28 14:17:17 +00:00
|
|
|
void _FormatCntnt( const SwCntntFrm* pCntnt,
|
|
|
|
const SwPageFrm* pPage );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsShortCut( SwPageFrm *& );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool TurboAction();
|
|
|
|
sal_Bool _TurboAction( const SwCntntFrm * );
|
2000-09-18 23:08:29 +00:00
|
|
|
void InternalAction();
|
|
|
|
|
|
|
|
SwPageFrm *CheckFirstVisPage( SwPageFrm *pPage );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool RemoveEmptyBrowserPages();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
inline void CheckIdleEnd();
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uLong GetStartTicks() { return nStartTicks; }
|
2002-11-01 14:33:33 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
public:
|
|
|
|
SwLayAction( SwRootFrm *pRt, SwViewImp *pImp );
|
|
|
|
~SwLayAction();
|
|
|
|
|
|
|
|
#ifdef _LAYACT_CXX
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetIdle ( sal_Bool bNew ) { bIdle = bNew; }
|
|
|
|
void SetCheckPages ( sal_Bool bNew ) { bCheckPages = bNew; }
|
|
|
|
void SetBrowseActionStop(sal_Bool bNew ) { bBrowseActionStop = bNew; }
|
|
|
|
void SetNextCycle ( sal_Bool bNew ) { bNextCycle = bNew; }
|
|
|
|
|
|
|
|
sal_Bool IsWaitAllowed() const { return bWaitAllowed; }
|
|
|
|
sal_Bool IsNextCycle() const { return bNextCycle; }
|
|
|
|
sal_Bool IsInput() const { return bInput; }
|
|
|
|
sal_Bool IsWait() const { return 0 != pWait; }
|
|
|
|
sal_Bool IsPaint() const { return bPaint; }
|
|
|
|
sal_Bool IsIdle() const { return bIdle; }
|
|
|
|
sal_Bool IsReschedule() const { return bReschedule; }
|
|
|
|
sal_Bool IsPaintExtraData() const { return bPaintExtraData;}
|
|
|
|
sal_Bool IsStopPrt() const;
|
|
|
|
sal_Bool IsInterrupt() const { return IsInput() || IsStopPrt(); }
|
|
|
|
|
|
|
|
sal_uInt16 GetInputType() const { return nInputType; }
|
2000-09-18 23:08:29 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//Einstellen der Action auf das gewuenschte Verhalten.
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetPaint ( sal_Bool bNew ) { bPaint = bNew; }
|
|
|
|
void SetComplete ( sal_Bool bNew ) { bComplete = bNew; }
|
|
|
|
void SetStatBar ( sal_Bool bNew );
|
|
|
|
void SetInputType ( sal_uInt16 nNew ) { nInputType = nNew; }
|
|
|
|
void SetCalcLayout ( sal_Bool bNew ) { bCalcLayout = bNew; }
|
|
|
|
void SetReschedule ( sal_Bool bNew ) { bReschedule = bNew; }
|
|
|
|
void SetWaitAllowed ( sal_Bool bNew ) { bWaitAllowed = bNew; }
|
|
|
|
|
|
|
|
void SetAgain() { bAgain = sal_True; }
|
|
|
|
void SetUpdateExpFlds() {bUpdateExpFlds = sal_True; }
|
2002-11-01 14:33:33 +00:00
|
|
|
void SetProgress(SfxProgress * _pProgress = NULL)
|
|
|
|
{ pProgress = _pProgress; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline void SetCheckPageNum( sal_uInt16 nNew );
|
|
|
|
inline void SetCheckPageNumDirect( sal_uInt16 nNew ) { nCheckPageNum = nNew; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
void Action(); //Jetzt gehts loos...
|
|
|
|
void Reset(); //Zurueck auf CTor-Defaults.
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool IsAgain() const { return bAgain; }
|
|
|
|
sal_Bool IsComplete() const { return bComplete; }
|
|
|
|
sal_Bool IsExpFlds() const { return bUpdateExpFlds; }
|
|
|
|
sal_Bool IsCalcLayout() const { return bCalcLayout; }
|
|
|
|
sal_Bool IsCheckPages() const { return bCheckPages; }
|
|
|
|
sal_Bool IsBrowseActionStop() const { return bBrowseActionStop; }
|
|
|
|
sal_Bool IsActionInProgress() const { return bActionInProgress; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 GetCheckPageNum() const { return nCheckPageNum; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Auch andere sollen den Wartecrsr einschalten koennen.
|
|
|
|
void CheckWaitCrsr();
|
2004-08-02 13:05:30 +00:00
|
|
|
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i28701# - method is now public;
|
2004-08-02 13:05:30 +00:00
|
|
|
// delete 2nd parameter, because its not used;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool FormatLayoutFly( SwFlyFrm * );
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i28701# - method is now public
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool _FormatFlyCntnt( const SwFlyFrm * );
|
2004-08-02 13:05:30 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SwLayIdle
|
|
|
|
{
|
|
|
|
|
|
|
|
SwRootFrm *pRoot;
|
|
|
|
SwViewImp *pImp; // Hier Meldet sich der Idler an und ab.
|
|
|
|
SwCntntNode *pCntntNode; // Hier wird die aktuelle Cursorposition
|
|
|
|
xub_StrLen nTxtPos; // zwischengespeichert.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bPageValid; // Konnte die Seite alles validiert werden?
|
|
|
|
sal_Bool bAllValid; // Konnte alles validiert werden?
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-11-24 00:52:00 +01:00
|
|
|
#ifdef DBG_UTIL
|
|
|
|
bool m_bIndicator;
|
2000-09-18 23:08:29 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _LAYACT_CXX
|
|
|
|
|
2011-11-24 00:52:00 +01:00
|
|
|
#ifdef DBG_UTIL
|
2000-09-18 23:08:29 +00:00
|
|
|
void ShowIdle( ColorData eName );
|
|
|
|
#endif
|
|
|
|
|
2007-01-02 15:48:07 +00:00
|
|
|
enum IdleJobType{ ONLINE_SPELLING, AUTOCOMPLETE_WORDS, WORD_COUNT, SMART_TAGS }; // SMARTTAGS
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool _DoIdleJob( const SwCntntFrm*, IdleJobType );
|
|
|
|
sal_Bool DoIdleJob( IdleJobType, sal_Bool bVisAreaOnly );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
public:
|
|
|
|
SwLayIdle( SwRootFrm *pRt, SwViewImp *pImp );
|
|
|
|
~SwLayIdle();
|
|
|
|
};
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline void SwLayAction::SetCheckPageNum( sal_uInt16 nNew )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( nNew < nCheckPageNum )
|
|
|
|
nCheckPageNum = nNew;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //_LAYACT_HXX
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|