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 14:30:35 +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 14:30:35 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:30:35 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 14:30:35 +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 14:30:35 +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 14:30:35 +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 _PORTAB_HXX
|
|
|
|
#define _PORTAB_HXX
|
|
|
|
|
|
|
|
#include "porglue.hxx"
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTabPortion
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwTabPortion : public SwFixPortion
|
|
|
|
{
|
|
|
|
const KSHORT nTabPos;
|
|
|
|
const xub_Unicode cFill;
|
2011-10-31 17:39:16 +01:00
|
|
|
const bool bAutoTabStop;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// Das Format() verzweigt entweder in Pre- oder PostFormat()
|
|
|
|
sal_Bool PreFormat( SwTxtFormatInfo &rInf );
|
|
|
|
public:
|
2011-10-31 17:39:16 +01:00
|
|
|
SwTabPortion( const KSHORT nTabPos, const xub_Unicode cFill = '\0', const bool bAutoTab = true );
|
2000-09-18 23:08:29 +00:00
|
|
|
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
|
|
|
|
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
|
|
|
|
virtual void FormatEOL( SwTxtFormatInfo &rInf );
|
|
|
|
sal_Bool PostFormat( SwTxtFormatInfo &rInf );
|
|
|
|
inline sal_Bool IsFilled() const { return 0 != cFill; }
|
|
|
|
inline KSHORT GetTabPos() const { return nTabPos; }
|
2011-10-31 17:39:16 +01:00
|
|
|
inline sal_Bool IsAutoTabStop() const { return bAutoTabStop; }
|
2002-02-28 11:42:19 +00:00
|
|
|
|
|
|
|
// Accessibility: pass information about this portion to the PortionHandler
|
|
|
|
virtual void HandlePortion( SwPortionHandler& rPH ) const;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
OUTPUT_OPERATOR
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTabLeftPortion
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwTabLeftPortion : public SwTabPortion
|
|
|
|
{
|
|
|
|
public:
|
2011-10-31 17:39:16 +01:00
|
|
|
inline SwTabLeftPortion( const KSHORT nTabPosVal, const xub_Unicode cFillChar='\0', bool bAutoTab = true )
|
|
|
|
: SwTabPortion( nTabPosVal, cFillChar, bAutoTab )
|
2000-09-18 23:08:29 +00:00
|
|
|
{ SetWhichPor( POR_TABLEFT ); }
|
|
|
|
OUTPUT_OPERATOR
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTabRightPortion
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwTabRightPortion : public SwTabPortion
|
|
|
|
{
|
|
|
|
public:
|
2007-09-27 08:18:42 +00:00
|
|
|
inline SwTabRightPortion( const KSHORT nTabPosVal, const xub_Unicode cFillChar='\0' )
|
|
|
|
: SwTabPortion( nTabPosVal, cFillChar )
|
2000-09-18 23:08:29 +00:00
|
|
|
{ SetWhichPor( POR_TABRIGHT ); }
|
|
|
|
OUTPUT_OPERATOR
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTabCenterPortion
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwTabCenterPortion : public SwTabPortion
|
|
|
|
{
|
|
|
|
public:
|
2007-09-27 08:18:42 +00:00
|
|
|
inline SwTabCenterPortion( const KSHORT nTabPosVal, const xub_Unicode cFillChar='\0' )
|
|
|
|
: SwTabPortion( nTabPosVal, cFillChar )
|
2000-09-18 23:08:29 +00:00
|
|
|
{ SetWhichPor( POR_TABCENTER ); }
|
|
|
|
OUTPUT_OPERATOR
|
|
|
|
};
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwTabDecimalPortion
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwTabDecimalPortion : public SwTabPortion
|
|
|
|
{
|
2006-02-09 12:45:03 +00:00
|
|
|
const xub_Unicode mcTab;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* During text formatting, we already store the width of the portions
|
|
|
|
* following the tab stop up to the decimal position. This value is
|
|
|
|
* evaluated during pLastTab->FormatEOL. FME 2006-01-06 #127428#.
|
|
|
|
*/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 mnWidthOfPortionsUpTpDecimalPosition;
|
2006-02-09 12:45:03 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
public:
|
2007-09-27 08:18:42 +00:00
|
|
|
inline SwTabDecimalPortion( const KSHORT nTabPosVal, const xub_Unicode cTab,
|
|
|
|
const xub_Unicode cFillChar = '\0' )
|
|
|
|
: SwTabPortion( nTabPosVal, cFillChar ),
|
2006-02-09 12:45:03 +00:00
|
|
|
mcTab(cTab),
|
|
|
|
mnWidthOfPortionsUpTpDecimalPosition( USHRT_MAX )
|
2000-09-18 23:08:29 +00:00
|
|
|
{ SetWhichPor( POR_TABDECIMAL ); }
|
2006-02-09 12:45:03 +00:00
|
|
|
|
|
|
|
inline xub_Unicode GetTabDecimal() const { return mcTab; }
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline void SetWidthOfPortionsUpToDecimalPosition( sal_uInt16 nNew )
|
2006-02-09 12:45:03 +00:00
|
|
|
{
|
|
|
|
mnWidthOfPortionsUpTpDecimalPosition = nNew;
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_uInt16 GetWidthOfPortionsUpToDecimalPosition() const
|
2006-02-09 12:45:03 +00:00
|
|
|
{
|
|
|
|
return mnWidthOfPortionsUpTpDecimalPosition;
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
OUTPUT_OPERATOR
|
|
|
|
};
|
|
|
|
|
2004-03-25 11:53:13 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* class SwAutoTabDecimalPortion
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
class SwAutoTabDecimalPortion : public SwTabDecimalPortion
|
|
|
|
{
|
|
|
|
public:
|
2007-09-27 08:18:42 +00:00
|
|
|
inline SwAutoTabDecimalPortion( const KSHORT nTabPosVal, const xub_Unicode cTab,
|
|
|
|
const xub_Unicode cFillChar = '\0' )
|
|
|
|
: SwTabDecimalPortion( nTabPosVal, cTab, cFillChar )
|
2004-03-25 11:53:13 +00:00
|
|
|
{ SetLen( 0 ); }
|
|
|
|
virtual void Paint( const SwTxtPaintInfo &rInf ) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
CLASSIO( SwTabPortion )
|
|
|
|
CLASSIO( SwTabLeftPortion )
|
|
|
|
CLASSIO( SwTabRightPortion )
|
|
|
|
CLASSIO( SwTabCenterPortion )
|
|
|
|
CLASSIO( SwTabDecimalPortion )
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|