diff options
Diffstat (limited to '')
120 files changed, 16904 insertions, 0 deletions
diff --git a/lotuswordpro/inc/localtime.hxx b/lotuswordpro/inc/localtime.hxx new file mode 100644 index 000000000..1722b60d3 --- /dev/null +++ b/lotuswordpro/inc/localtime.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_LOCALTIME_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LOCALTIME_HXX + +struct LtTm +{ + long tm_sec; /* seconds after the minute - [0,59] */ + long tm_min; /* minutes after the hour - [0,59] */ + long tm_hour; /* hours since midnight - [0,23] */ + long tm_mday; /* day of the month - [1,31] */ + long tm_mon; /* months since January - [0,11] */ + long tm_year; /* years since 1900 */ + long tm_wday; /* days since Sunday - [0,6] */ + long tm_yday; /* days since January 1 - [0,365] */ + LtTm() + : tm_sec(0) + , tm_min(0) + , tm_hour(0) + , tm_mday(0) + , tm_mon(0) + , tm_year(0) + , tm_wday(0) + , tm_yday(0) + { + } +}; +bool LtgGmTime(long rtime,LtTm& rtm); +bool LtgLocalTime(long rtime,LtTm& rtm); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpatomholder.hxx b/lotuswordpro/inc/lwpatomholder.hxx new file mode 100644 index 000000000..fc7084f27 --- /dev/null +++ b/lotuswordpro/inc/lwpatomholder.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPATOMHOLDER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPATOMHOLDER_HXX + +#include <config_lgpl.h> +#include "lwpdefs.hxx" +#include "lwpobjstrm.hxx" +/** + * @brief AtomHolder class of Word Pro to hold a string +*/ +class LwpAtomHolder +{ +public: + LwpAtomHolder(); +private: + sal_Int32 m_nAtom; + sal_Int32 m_nAssocAtom; + OUString m_String; + //OUString m_UniString; //no use temporarily +public: + void Read(LwpObjectStream *pStrm); + void ReadPathAtom(LwpObjectStream *pStrm); + void Skip(LwpObjectStream *pStrm); + const OUString& str() const {return m_String;} + inline bool HasValue() const; +}; +inline bool LwpAtomHolder::HasValue() const +{ + return (m_nAtom != BAD_ATOM); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpbasetype.hxx b/lotuswordpro/inc/lwpbasetype.hxx new file mode 100644 index 000000000..20b4c625c --- /dev/null +++ b/lotuswordpro/inc/lwpbasetype.hxx @@ -0,0 +1,124 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * basic classes for Word Pro filter, + * PanoseNumber, Point + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPBASETYPE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPBASETYPE_HXX + +#include "lwpobjstrm.hxx" +#include <config_lgpl.h> + +/** + * @brief used for lwpfont for font description +*/ +class LwpPanoseNumber +{ +public: + LwpPanoseNumber() + : m_nFamilyType(0) + , m_nSerifStyle(0) + , m_nWeight(0) + , m_nProportion(0) + , m_nContrast(0) + , m_nStrokeVariation(0) + , m_nArmStyle(0) + , m_nLetterform(0) + , m_nMidline(0) + , m_nXHeight(0) + { + } +public: + void Read(LwpObjectStream *pStrm); +private: + sal_uInt8 m_nFamilyType; + sal_uInt8 m_nSerifStyle; + sal_uInt8 m_nWeight; + sal_uInt8 m_nProportion; + sal_uInt8 m_nContrast; + sal_uInt8 m_nStrokeVariation; + sal_uInt8 m_nArmStyle; + sal_uInt8 m_nLetterform; + sal_uInt8 m_nMidline; + sal_uInt8 m_nXHeight; +}; +/** + * @brief point class +*/ +class LwpPoint final +{ +public: + LwpPoint(); + void Read(LwpObjectStream *pStrm); + void Reset(); + sal_Int32 GetX() const {return m_nX;} + sal_Int32 GetY() const {return m_nY;} + inline void SetX(sal_Int32 nX); + inline void SetY(sal_Int32 nY); +private: + sal_Int32 m_nX; + sal_Int32 m_nY; +}; + +void LwpPoint::SetX(sal_Int32 nX){m_nX = nX;} +void LwpPoint::SetY(sal_Int32 nY){m_nY = nY;} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpbookmarkmgr.hxx b/lotuswordpro/inc/lwpbookmarkmgr.hxx new file mode 100644 index 000000000..3cc02b121 --- /dev/null +++ b/lotuswordpro/inc/lwpbookmarkmgr.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPBOOKMARKMGR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPBOOKMARKMGR_HXX + +#include <config_lgpl.h> + +#include <map> + +#include <rtl/ref.hxx> + +#include "xfilter/xfbookmark.hxx" + +class LwpBookmarkMgr +{ +public: + void AddXFBookmarkEnd(const OUString& sName, XFBookmarkEnd* pMark); + void AddXFBookmarkStart(const OUString& sName, XFBookmarkStart* pMark); + bool FindBookmark(const OUString& sName); + ~LwpBookmarkMgr(); + LwpBookmarkMgr(); + +private: + std::map<OUString, rtl::Reference<XFBookmarkStart>> m_MapStart; + std::map<OUString, rtl::Reference<XFBookmarkEnd>> m_MapEnd; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpchangemgr.hxx b/lotuswordpro/inc/lwpchangemgr.hxx new file mode 100644 index 000000000..b436024e8 --- /dev/null +++ b/lotuswordpro/inc/lwpchangemgr.hxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPCHANGEMGR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPCHANGEMGR_HXX + +#include <map> +#include <vector> +#include <config_lgpl.h> +#include "lwpfrib.hxx" +#include "xfilter/xfchange.hxx" +#include "xfilter/xfcontentcontainer.hxx" + +class LwpChangeMgr +{ +public: + void AddChangeFrib(LwpFrib* pFrib); + OUString GetChangeID(LwpFrib* pFrib); + void ConvertAllChange(IXFStream* pStream); + void SetHeadFootFribMap(bool bFlag); + void SetHeadFootChange(XFContentContainer* pCont); + ~LwpChangeMgr(); + LwpChangeMgr(); + +private: + std::map<LwpFrib*, OUString>* m_pFribMap; + std::map<LwpFrib*, OUString> m_DocFribMap; + std::map<LwpFrib*, OUString> m_HeadFootFribMap; + std::vector<rtl::Reference<XFChangeRegion>> m_ChangeList; + sal_uInt32 m_nCounter; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpcolor.hxx b/lotuswordpro/inc/lwpcolor.hxx new file mode 100644 index 000000000..b555302bd --- /dev/null +++ b/lotuswordpro/inc/lwpcolor.hxx @@ -0,0 +1,124 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPCOLOR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPCOLOR_HXX + +#include "lwpobjstrm.hxx" +#include <config_lgpl.h> +/** + * @brief lwpcolor class + * (red, green, blue, extra) +*/ +class LwpColor +{ +public: + LwpColor():m_nRed(0), m_nGreen(0), m_nBlue(0), m_nExtra(0){} +public: + void Read(LwpObjectStream *pStrm); + sal_uInt16 GetRed() const; + sal_uInt16 GetGreen() const; + sal_uInt16 GetBlue() const; + bool IsValidColor() const; + sal_uInt32 To24Color(); + bool IsTransparent() const; +private: + sal_uInt16 m_nRed; // When extra is AGLRGB_INDEX, m_nRed holds the + sal_uInt16 m_nGreen; // hi 16 bits and m_nGreen holds the lo 16 bits of + sal_uInt16 m_nBlue; // the 32-bit LUT index. + sal_uInt16 m_nExtra; + enum ColorOverride { + AGLRGB_RGB = 0, + AGLRGB_BLACK = 1, + AGLRGB_WHITE = 2, + AGLRGB_GRAY = 3, + AGLRGB_LTGRAY = 4, + AGLRGB_DKGRAY = 5, + AGLRGB_RED = 6, + AGLRGB_GREEN = 7, + AGLRGB_BLUE = 8, + AGLRGB_INDEX = 98, + AGLRGB_INVALID = 99, + AGLRGB_TRANSPARENT = 100 + }; +}; +inline sal_uInt16 LwpColor::GetRed() const +{ + return m_nRed; +} +inline sal_uInt16 LwpColor::GetGreen() const +{ + return m_nGreen; +} +inline sal_uInt16 LwpColor::GetBlue() const +{ + return m_nBlue; +} +inline bool LwpColor::IsValidColor() const +{ + return ((m_nExtra!=AGLRGB_INVALID) && (m_nExtra!=AGLRGB_TRANSPARENT)); +} +inline bool LwpColor::IsTransparent() const +{ + return (m_nExtra==AGLRGB_TRANSPARENT); +} +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpdefs.hxx b/lotuswordpro/inc/lwpdefs.hxx new file mode 100644 index 000000000..2cf89eaa6 --- /dev/null +++ b/lotuswordpro/inc/lwpdefs.hxx @@ -0,0 +1,211 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * definitions for all object types VO_TYPE + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPDEFS_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPDEFS_HXX + +#define BAD_OFFSET 0xFFFFFFFFUL +#define BAD_ATOM (sal_Int32(-1)) // Invalid Atom ID + +//Please remove the item from the commented defines after you add the tag to the following enum. +enum VO_TYPE +{ + VO_PARA = 0, + VO_DOCUMENT = 5, + VO_STORY = 13, + VO_VERQTR = 40, + VO_HEADCONTENT = 47, + VO_HEADLAYOUT = 142, + VO_PAGELAYOUT = 143, + VO_DOCSOCK = 155, + VO_DIVISIONINFO = 7, + VO_HEADHOLDER = 90, + VO_DIVOPTS = 176, + VO_DOCDATA = 137, + VO_HEADERLAYOUT = 139, + VO_FOOTERLAYOUT = 140, + VO_FRAMELAYOUT = 141, + VO_TOCSUPERTABLELAYOUT = 149, + VO_TOCLEVELDATA = 171, + VO_LAYOUTGEOMETRY = 185, + VO_LAYOUTSCALE = 186, + VO_LAYOUTMARGINS = 187, + VO_LAYOUTCOLUMNS = 188, + VO_LAYOUTBORDERSTUFF = 189, + VO_LAYOUTGUTTERSTUFF = 190, + VO_LAYOUTBACKGROUNDSTUFF = 191, + VO_LAYOUTJOINSTUFF = 192, + VO_LAYOUTSHADOW = 193, + VO_LAYOUTNUMERICS = 194, + VO_LAYOUTRELATIVITY = 195, + VO_LAYOUTEXTERNALBORDERSTUFF = 219, + VO_GRAPHIC = 41, + VO_VERGTR = 205, + + VO_PARASTYLE = 23, + VO_CHARACTERSTYLE = 106, + VO_SILVERBULLET = 127, + VO_ALIGNMENTPIECE = 196, + VO_INDENTPIECE = 197, + VO_SPACINGPIECE = 199, + VO_CHARBORDERPIECE = 202, + VO_AMIKAKEPIECE = 203, + + VO_TABRACK = 38, + VO_PARABORDERPIECE = 198, + VO_BREAKSPIECE = 200, + VO_NUMBERINGPIECE = 201, + VO_TABPIECE = 204, + VO_PARABACKGROUNDPIECE = 218, + + VO_SECTION = 136, + VO_INDEXSECTION = 48, + VO_HEADTAILHOLDER = 169, + VO_PAGEHINT = 10, + VO_OBJECTHOLDER = 98, + VO_POBJECTHOLDER = 133, + // added for OLE + VO_OLEOBJECT = 54, + + // added for table + VO_TABLE = 17, + VO_CELLLAYOUT = 18, + VO_SUPERTABLELAYOUT = 109, + VO_TABLELAYOUT = 31, + VO_SUPERTABLE = 115, + VO_ROWLAYOUT = 32, + VO_ROWLIST = 76, + VO_CELLLIST = 74, + VO_NUMERICVALUE = 123, + VO_FORMULAINFO = 82, + VO_COLUMNLAYOUT = 35, + VO_TABLERANGE = 66, + VO_CELLRANGE = 67, + VO_FOLDER = 75, + VO_DEPENDENT = 77, + VO_CONNECTEDCELLLAYOUT = 28, + VO_HIDDENCELLLAYOUT = 29, + VO_TABLEHEADINGLAYOUT = 117, + VO_ROWHEADINGLAYOUT = 118, + VO_TABLEHEADING = 209, + VO_TABLEHINT = 19, + + VO_DROPCAPLAYOUT = 217, + VO_CHBLKMARKER = 94, + VO_PROPLIST = 165, + VO_BOOKMARK = 64, + VO_FIELDMARKER = 87, + + //for footnote + VO_FOOTNOTE = 53, + VO_FOOTNOTEOPTS = 177, + VO_FOOTNOTELAYOUT = 65, + VO_FNROWLAYOUT = 59, + VO_FNCELLLAYOUT = 61, + VO_ENDNOTELAYOUT = 138, + VO_ENSUPERTABLELAYOUT = 113, + VO_FNSUPERTABLELAYOUT = 111, + VO_FOOTNOTETABLE = 58, + VO_CONTONLAYOUT = 145, + VO_CONTFROMLAYOUT = 146, + + //for frame group + VO_GROUPLAYOUT = 108, + VO_GROUPFRAME = 173, + + //For index manager + VO_ROOTLEAFOBJINDEX = 0xFFFB, // Root Index with no kids + VO_ROOTOBJINDEX = 0xFFFC, // Root Index with kids + + //Add new type of index + VO_OBJINDEX = 0xFFFD, // Obj Index with kids + + VO_LEAFOBJINDEX = 0xFFFE , // Leaf Index + + VO_LISTLIST = 100, + + //For comment notes + VO_NOTELAYOUT = 159, + VO_NOTEHEADERLAYOUT = 178, + VO_NOTETEXTLAYOUT = 166, + VO_VPLAYOUT = 132, + + // for parallel column + VO_SUPERPARALLELCOLUMNLAYOUT = 174, + VO_PCOLLAYOUT = 206, + VO_PCOLBLOCK = 207, + VO_PARALLELCOLUMNS = 163, + + //for ruby mark + VO_RUBYMARKER = 179, + VO_RUBYLAYOUT = 180, + + VO_GLOSSARY = 157, + VO_SUPERGLOSSARYLAYOUT = 175, + //for default tab distance + VO_VERDOCUMENT = 161, + + //The last one + VO_INVALID = -1 +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpdocdata.hxx b/lotuswordpro/inc/lwpdocdata.hxx new file mode 100644 index 000000000..b04c00bb1 --- /dev/null +++ b/lotuswordpro/inc/lwpdocdata.hxx @@ -0,0 +1,182 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPDOCDATA_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPDOCDATA_HXX +#include <config_lgpl.h> +#include "lwpobj.hxx" +#include "lwpatomholder.hxx" +#include "localtime.hxx" +#include "lwpcolor.hxx" + +struct LwpDocOptions +{ + sal_uInt16 nOptionFlag; + LwpAtomHolder encrypt1password; + LwpAtomHolder encrypt2password; + LwpAtomHolder characterSet; + LwpAtomHolder grammerSet; + sal_uInt16 nMarginMarks; + sal_uInt16 nMarginMarksLocation; + sal_uInt16 nMarginMarksChar; +}; +struct LwpDocInfo +{ + LwpAtomHolder description; + LwpAtomHolder keywords; + LwpAtomHolder createdBy; + sal_Int32 nCreationTime; + sal_Int32 nLastRevisionTime; + sal_Int32 nTotalEditTime; + LwpObjectID cpVerDocInfo; + sal_uInt16 nNumEditedBy; + //skip editor list +}; +struct LwpDocControl +{ + LwpAtomHolder cGreeting; + sal_uInt16 nFlags; + sal_uInt16 nDocControlProtection; + sal_uInt16 nLen1; + //skip doc control password string + sal_uInt16 nFileProtection; + sal_uInt16 nLen2; + //skip file password string + sal_uInt16 nAutoVersioning; + LwpAtomHolder cDocControlOnlyEditor; + sal_uInt16 nEditorVerification; +}; +struct LwpFontDescriptionOverrideBase +{ + sal_uInt8 cOverrideBits; + sal_uInt8 cApplyBits; + sal_Int32 cPointSize; + sal_uInt8 cOverstrike; + sal_uInt16 cTightness; + //lcolor cColor; + //lcolor cBackgroundColor; + LwpColor cColor; + LwpColor cBackgroundColor; +}; +struct LwpFontAttributeOverride +{ + sal_uInt16 cAttrBits; + sal_uInt16 cAttrOverrideBits; + sal_uInt16 cAttrApplyBits; + sal_uInt8 cAttrOverrideBits2; + sal_uInt8 cAttrApplyBits2; + sal_uInt8 cCase; + sal_uInt8 cUnder; +}; +struct LwpFontDescriptionOverride +{ + LwpFontAttributeOverride cFontAttributeOverride; + LwpFontDescriptionOverrideBase cFontDescriptionOverrideBase; + LwpAtomHolder cFaceName; + LwpAtomHolder cAltFaceName; +}; +struct LwpOverrideOg +{ + sal_uInt16 cValues; + sal_uInt16 cOverride; + sal_uInt16 cApply; +}; +struct LwpTextAttributeOverrideOg +{ + LwpOverrideOg cOverride; + sal_uInt16 cHideLevels; + sal_Int32 cBaselineOffset; +}; +struct LwpEditorAttr +{ + LwpAtomHolder cName; + LwpAtomHolder cInitials; + LwpColor cHiLiteColor; + sal_uInt16 nID; + LwpFontDescriptionOverride cInsFontOver; + LwpFontDescriptionOverride cDelFontOver; + sal_uInt16 nAbilities; + sal_uInt16 nLocks; + sal_uInt16 nSuggestions; + LwpTextAttributeOverrideOg cDelTextAttr; +}; +class LwpDocData : public LwpObject +{ +public: + LwpDocData(LwpObjectHeader const& objHdr, LwpSvStream* pStrm); + +private: + virtual ~LwpDocData() override; + + LwpDocOptions m_DocOptions; + LwpDocInfo m_DocInfo; + LwpDocControl m_DocControl; + +private: + LtTm m_nCreationTime; + LtTm m_nLastRevisionTime; + LtTm m_nTotalEditTime; + +private: + static OUString DateTimeToOUString(LtTm const& dt); + static OUString TimeToOUString(LtTm const& dt); + +public: + void Read() override; + void Parse(IXFStream* pOutputStream) override; +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpdropcapmgr.hxx b/lotuswordpro/inc/lwpdropcapmgr.hxx new file mode 100644 index 000000000..6ad122e69 --- /dev/null +++ b/lotuswordpro/inc/lwpdropcapmgr.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPDROPCAPMGR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPDROPCAPMGR_HXX + +#include "xfilter/xfparagraph.hxx" + +class LwpDropcapMgr +{ +public: + LwpDropcapMgr(); + ~LwpDropcapMgr(); + void SetXFPara(XFParagraph* pXFPara); + XFParagraph* GetXFPara() { return m_pXFPara; } + +private: + XFParagraph* m_pXFPara; +}; +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpfilehdr.hxx b/lotuswordpro/inc/lwpfilehdr.hxx new file mode 100644 index 000000000..2bb49127a --- /dev/null +++ b/lotuswordpro/inc/lwpfilehdr.hxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPFILEHDR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPFILEHDR_HXX + +#include "lwpobjid.hxx" +/** + * @brief LWP7 object +*/ +class LwpFileHeader +{ +public: + LwpFileHeader(); +private: //data member + sal_uInt16 m_nAppRevision; + sal_uInt16 m_nAppReleaseNo; + sal_uInt16 m_nRequiredAppRevision; + sal_uInt16 m_nRequiredFileRevision; + LwpObjectID m_cDocumentID; + sal_uInt32 m_nRootIndexOffset; +public: + static sal_uInt16 m_nFileRevision; + void Read(LwpSvStream *pStrm); + sal_uInt32 GetRootIndexOffset() const; + LwpObjectID& GetDocID(); +}; +inline sal_uInt32 LwpFileHeader::GetRootIndexOffset() const +{ + return m_nRootIndexOffset; +} +inline LwpObjectID& LwpFileHeader::GetDocID() +{ + return m_cDocumentID; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpfont.hxx b/lotuswordpro/inc/lwpfont.hxx new file mode 100644 index 000000000..301c65e9e --- /dev/null +++ b/lotuswordpro/inc/lwpfont.hxx @@ -0,0 +1,289 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Font manager related classes header file + * LwpFontTableEntry, LwpFontTable, LwpFontNameEntry, + * LwpFontAttrEntry, LwpFontNameManager,LwpFontAttrManager, + * LwpFontManager + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPFONT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPFONT_HXX + +#include <config_lgpl.h> +#include <rtl/ref.hxx> +#include "lwpobjstrm.hxx" +#include "lwpatomholder.hxx" +#include "lwpcolor.hxx" +#include "xfilter/xffont.hxx" +#include <memory> + +class LwpFontTableEntry +{ +public: + LwpFontTableEntry(){} +public: + void Read(LwpObjectStream *pStrm); + OUString const & GetFaceName() const; +private: + LwpAtomHolder m_WindowsFaceName; //font face name under windows + LwpAtomHolder m_FaceName; //font face name + void RegisterFontDecl(); + //Not useful now, so skip + //LwpPanoseNumber m_PanoseNumber; +}; + +class LwpFontTable +{ +public: + LwpFontTable(); + ~LwpFontTable(); +public: + void Read(LwpObjectStream *pStrm); + OUString GetFaceName(sal_uInt16 index); //index: start from 1 +// void RegisterFontDecls(); +private: + sal_uInt16 m_nCount; + std::unique_ptr<LwpFontTableEntry[]> m_pFontEntries; +}; + +class LwpFontNameEntry +{ +public: + LwpFontNameEntry() + : m_nOverrideBits(0) + , m_nApplyBits(0) + , m_nPointSize(0) + , m_nOverstrike(0) + , m_nTightness(0) + , m_nFaceName(0) + , m_nAltFaceName(0) + {} +public: + void Read(LwpObjectStream *pStrm); + sal_uInt16 GetFaceID() const {return m_nFaceName;} + sal_uInt16 GetAltFaceID() const {return m_nAltFaceName;} + void Override(rtl::Reference<XFFont> const & pFont); + inline bool IsFaceNameOverridden() const; + inline bool IsAltFaceNameOverridden() const; +private: + //Data of CFontDescriptionOverrideBase + sal_uInt8 m_nOverrideBits; + sal_uInt8 m_nApplyBits; + sal_uInt32 m_nPointSize; + sal_uInt16 m_nOverstrike; + sal_uInt16 m_nTightness; + LwpColor m_Color; + LwpColor m_BackColor; + //Data of LwpFontNameEntry + sal_uInt16 m_nFaceName; //CFontTableID + sal_uInt16 m_nAltFaceName; //CFontTableID + enum + { + POINTSIZE = 0x01, + COLOR = 0x02, + OVERSTRIKE = 0x04, + TIGHTNESS = 0x08, + FACENAME = 0x10, + BKCOLOR = 0x20, + ALTFACENAME = 0x40, + ALL_BITS = (POINTSIZE | COLOR | OVERSTRIKE + | ALTFACENAME + | TIGHTNESS | FACENAME | BKCOLOR) + }; + + inline bool IsPointSizeOverridden() const; + inline bool IsColorOverridden() const; + inline bool IsBackgroundColorOverridden() const; +//TODO +// inline sal_Bool IsTightnessOverridden(); +// inline sal_Bool IsAnythingOverridden(); +}; + +class LwpFontNameManager +{ +public: + LwpFontNameManager(); + ~LwpFontNameManager(); + OUString GetNameByIndex(sal_uInt16 index); +private: + sal_uInt16 m_nCount; + std::unique_ptr<LwpFontNameEntry[]> m_pFontNames; + LwpFontTable m_FontTbl; + +public: + void Read(LwpObjectStream *pStrm); + void Override(sal_uInt16 index, rtl::Reference<XFFont> const & pFont); +}; + +class LwpFontAttrEntry +{ +public: + LwpFontAttrEntry() + : m_nAttrBits(0) + , m_nAttrOverrideBits(0) + , m_nAttrApplyBits(0) + , m_nAttrOverrideBits2(0) + , m_nAttrApplyBits2(0) + , m_nCase(0) + , m_nUnder(0) + {} +public: + void Read(LwpObjectStream *pStrm); + void Override(rtl::Reference<XFFont> const & pFont); +private: + sal_uInt16 m_nAttrBits; + sal_uInt16 m_nAttrOverrideBits; + sal_uInt16 m_nAttrApplyBits; + sal_uInt8 m_nAttrOverrideBits2; + sal_uInt8 m_nAttrApplyBits2; + sal_uInt8 m_nCase; + sal_uInt8 m_nUnder; + enum + { + BOLD = 0x0001, + ITALIC = 0x0002, + STRIKETHRU = 0x0004, + + SUPERSCRIPT = 0x0100, + SUBSCRIPT = 0x0200, + + SMALLCAPS = 0x0400, + + ALL_ATTRS = BOLD | ITALIC | STRIKETHRU + | SUPERSCRIPT | SUBSCRIPT + | SMALLCAPS, + + CASE_DONTCARE = 0, + CASE_NORMAL = 1, + CASE_UPPER = 2, + CASE_LOWER = 3, + CASE_INITCAPS = 4, + CASE_STYLE = 7, + + UNDER_DONTCARE = 0, + UNDER_OFF = 1, + UNDER_SINGLE = 2, + UNDER_DOUBLE = 3, + UNDER_WORD_SINGLE = 4, + UNDER_WORD_DOUBLE = 5, + UNDER_STYLE = 7, + + CASE = 0x01, + UNDER = 0x02, + ALL_ATTRS2 = CASE | UNDER + }; + bool Is(sal_uInt16 Attr); + bool IsBoldOverridden() const; + bool IsItalicOverridden() const; + bool IsStrikeThruOverridden() const; + bool IsSmallCapsOverridden() const; + bool IsSuperOverridden() const; + bool IsSubOverridden() const; + bool IsUnderlineOverridden() const; + bool IsCaseOverridden() const; + +}; + +class LwpFontAttrManager +{ +public: + LwpFontAttrManager() + : m_nCount(0) + {} + ~LwpFontAttrManager(); +public: + void Read(LwpObjectStream *pStrm); + void Override(sal_uInt16 index, rtl::Reference<XFFont> const & pFont); +private: + sal_uInt16 m_nCount; + std::unique_ptr<LwpFontAttrEntry[]> m_pFontAttrs; +}; + +class LwpFontManager +{ +public: + LwpFontManager(){} +private: + LwpFontNameManager m_FNMgr; + LwpFontAttrManager m_AttrMgr; + +public: + void Read(LwpObjectStream *pStrm); + rtl::Reference<XFFont> CreateOverrideFont(sal_uInt32 fontID, sal_uInt32 overID); + rtl::Reference<XFFont> CreateFont(sal_uInt32 fontID); + OUString GetNameByID(sal_uInt32 fontID); + +private: + void Override(sal_uInt32 fontID, rtl::Reference<XFFont> const & pFont); + static inline sal_uInt16 GetFontNameIndex(sal_uInt32 fontID); + static inline sal_uInt16 GetFontAttrIndex(sal_uInt32 fontID); +}; + +sal_uInt16 LwpFontManager::GetFontNameIndex(sal_uInt32 fontID) +{ + return static_cast<sal_uInt16>((fontID>>16)&0xFFFF); +} + +sal_uInt16 LwpFontManager::GetFontAttrIndex(sal_uInt32 fontID) +{ + return static_cast<sal_uInt16>(fontID); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpfoundry.hxx b/lotuswordpro/inc/lwpfoundry.hxx new file mode 100644 index 000000000..36919dd9d --- /dev/null +++ b/lotuswordpro/inc/lwpfoundry.hxx @@ -0,0 +1,305 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPFOUNDRY_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPFOUNDRY_HXX + +#include <config_lgpl.h> +#include "lwpobjid.hxx" +#include "lwpobjstrm.hxx" +#include "lwpfont.hxx" +#include "lwpdropcapmgr.hxx" +#include "xfilter/ixfstyle.hxx" +#include <unordered_map> + +class LwpDocument; +class LwpBookMark; + +#include <memory> + +class LwpVersionManager +{ +public: + LwpVersionManager() = delete; + static void Read(LwpObjectStream *pStrm); + static void Skip(LwpObjectStream *pStrm); +}; + +class LwpObjectManager +{ +public: + LwpObjectManager(){} +private: + LwpObjectID m_Division; +public: + void Read(LwpObjectStream *pStrm); +}; + +class LwpNumberManager +{ +public: + LwpNumberManager(){} +private: + LwpObjectID m_TableRange; +public: + void Read(LwpObjectStream *pStrm); + const LwpObjectID& GetTableRangeID() const { return m_TableRange;} +}; + +class LwpBulletManager +{ +public: + LwpBulletManager(){} +private: + LwpObjectID m_Head; +public: + void Read(LwpObjectStream *pStrm); + LwpObjectID& GetHeadID() { return m_Head;} +}; + +class LwpContent; +class LwpContentManager +{ +public: + LwpContentManager(){} +private: + LwpObjectID m_ContentList; + LwpObjectID m_EnumHead; + LwpObjectID m_EnumTail; + LwpObjectID m_OleObjCount; + + LwpObjectID m_GrapHead; + LwpObjectID m_GrapTail; + LwpObjectID m_OleHead; + LwpObjectID m_OleTail; +public: + LwpObjectID& GetContentList() { return m_ContentList; } + LwpObjectID& GetGraphicListHead() { return m_GrapHead; } + LwpContent* EnumContents(LwpContent* pContent); + +public: + void Read(LwpObjectStream *pStrm); +}; + +class LwpPieceManager +{ +public: + LwpPieceManager(){} +private: + LwpObjectID m_GeometryPieceList; + LwpObjectID m_ScalePieceList; + LwpObjectID m_MarginsPieceList; + LwpObjectID m_ColumnsPieceList; + LwpObjectID m_BorderStuffPieceList; + LwpObjectID m_GutterStuffPieceList; + LwpObjectID m_BackgroundStuffPieceList; + LwpObjectID m_JoinStuffPieceList; + LwpObjectID m_ShadowPieceList; + LwpObjectID m_NumericsPieceList; + LwpObjectID m_RelativityPieceList; + LwpObjectID m_AlignmentPieceList; + LwpObjectID m_IndentPieceList; + LwpObjectID m_ParaBorderPieceList; + LwpObjectID m_SpacingPieceList; + LwpObjectID m_BreaksPieceList; + LwpObjectID m_NumberingPieceList; + LwpObjectID m_TabPieceList; + LwpObjectID m_CharacterBorderPieceList; + LwpObjectID m_AmikakePieceList; + + LwpObjectID m_ParaBackgroundPieceList; + LwpObjectID m_ExternalBorderStuffPieceList; + LwpObjectID m_ExternalJoinStuffPieceList; + +public: + void Read(LwpObjectStream *pStrm); +}; + +class LwpOrderedObject; +class LwpListList; +class LwpOrderedObjectManager final +{ +public: + LwpOrderedObjectManager(){} + void Read(LwpObjectStream *pStrm); + LwpOrderedObject* Enumerate(LwpOrderedObject* pLast); +private: + LwpListList* GetNextActiveListList(LwpListList* pLast); + + LwpObjectID m_Head; +}; + +class LwpStyleManager; +class LwpSection; +class LwpBulletStyleMgr; +class LwpFoundry +{ +public: + LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc ); + ~LwpFoundry(); + void Read(LwpObjectStream *pStrm); + void RegisterAllLayouts(); +private: + LwpDocument* m_pDoc; + bool m_bRegisteredAll; +private: //file members + LwpObjectManager m_ObjMgr; + LwpObjectID m_MarkerHead; + LwpObjectID m_FootnoteMgr; + LwpNumberManager m_NumMgr; + LwpBulletManager m_BulMgr; + LwpOrderedObjectManager m_SectionList; + + LwpObjectID m_Layout; //The head layout + LwpObjectID m_TextStyle; + LwpObjectID m_DefaultTextStyle; + LwpObjectID m_DefaultClickStyle; + LwpObjectID m_PageStyle; + LwpObjectID m_FrameStyle; + LwpObjectID m_TableStyle; + LwpObjectID m_CellStyle; + LwpObjectID m_DftFrameStyle; + LwpObjectID m_DftPageStyle; + LwpObjectID m_DftTableStyle; + LwpObjectID m_DftCellStyle; + LwpObjectID m_DftColumnStyle; + LwpObjectID m_DftLeftColumnStyle; + LwpObjectID m_DftRighColumnStyle; + + LwpObjectID m_BookMarkHead; + LwpObjectID m_DdeLinkHead; + LwpObjectID m_DirtBagHead; + LwpObjectID m_NamedOutlineSeqHead; + LwpObjectID m_EnumLayoutHead; + LwpObjectID m_EnumLayoutTail; + + LwpObjectID m_NamedObjects; + sal_uInt32 m_nLastClickHere; + + LwpObjectID m_SmartTextMgr; + + LwpContentManager m_ContentMgr; + LwpFontManager m_FontMgr; + std::unique_ptr<LwpPieceManager> m_xPieceMgr; + + LwpObjectID m_DftDropCapStyle; + LwpObjectID m_DftHeaderStyle; + + LwpObjectID m_DftFooterStyle; +private: + void ReadStyles(LwpObjectStream *pStrm); +public: + LwpContentManager& GetContentManager() { return m_ContentMgr; } + LwpObjectID& GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); } + LwpFontManager& GetFontManger() { return m_FontMgr;} + LwpObjectID& GetTextStyleHead() { return m_TextStyle;} + LwpObjectID& GetLayout() {return m_Layout;} + LwpObjectID& GetBulletManagerID() { return m_BulMgr.GetHeadID();} + LwpDocument* GetDocument(){ return m_pDoc;} + LwpNumberManager& GetNumberManager() { return m_NumMgr;} + LwpObjectID * GetDefaultTextStyle() ; +private: + std::unique_ptr<LwpStyleManager> m_xStyleMgr; + std::unique_ptr<LwpDropcapMgr> m_xDropcapMgr; + std::unique_ptr<LwpBulletStyleMgr> m_xBulletStyleMgr; +public: + LwpStyleManager* GetStyleManager() { return m_xStyleMgr.get(); } + LwpBookMark* GetBookMark(LwpObjectID objMarker); + LwpDropcapMgr* GetDropcapMgr() { return m_xDropcapMgr.get(); } + LwpContent* EnumContents(LwpContent* pContent); + LwpSection* EnumSections(LwpSection* pSection); + LwpBulletStyleMgr* GetBulletStyleMgr() { return m_xBulletStyleMgr.get(); } + + LwpObjectID* FindParaStyleByName(const OUString& name); + OUString FindActuralStyleName(const OUString& name); +}; + +class LwpStyleManager +{ +public: + LwpStyleManager(); + ~LwpStyleManager(); +private: + LwpFoundry* m_pFoundry; + struct hashFunc + { + size_t operator()( const LwpObjectID& rName ) const + { + return rName.HashCode(); + } + }; + struct eqFunc + { + bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const + { + return(rKey1==rKey2); + } + }; + + typedef std::unordered_map<LwpObjectID, IXFStyle*, hashFunc, eqFunc> LwpStyleMap; + LwpStyleMap m_StyleList; +public: + void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;} + void AddStyle(LwpObjectID styleObjID, std::unique_ptr<IXFStyle> pStyle); + IXFStyle* GetStyle(const LwpObjectID &styleObjID); +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpfrib.hxx b/lotuswordpro/inc/lwpfrib.hxx new file mode 100644 index 000000000..9af56ab38 --- /dev/null +++ b/lotuswordpro/inc/lwpfrib.hxx @@ -0,0 +1,137 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPFRIB_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPFRIB_HXX +#include <map> +#include <memory> +#include <config_lgpl.h> +#include "lwpobjid.hxx" +#include "lwpobjstrm.hxx" +#include "lwpoverride.hxx" +#include "lwpfoundry.hxx" +#include "xfilter/xfcolor.hxx" + +struct ModifierInfo +{ + sal_uInt32 FontID; + LwpObjectID CharStyleID; + LwpTextLanguageOverride Language; + LwpTextAttributeOverride aTxtAttrOverride; + sal_uInt16 CodePage; + bool HasCharStyle; + bool HasLangOverride; + bool HasHighlight; + sal_uInt8 RevisionType; + bool RevisionFlag; +}; + +class LwpPara; +class LwpHyperlinkMgr; +class LwpFrib +{ +public: + explicit LwpFrib(LwpPara* pPara); + virtual ~LwpFrib(); + static LwpFrib* CreateFrib(LwpPara* pPara, LwpObjectStream* pObjStrm, sal_uInt8 fribtag, sal_uInt8 editID); + virtual void Read(LwpObjectStream* pObjStrm, sal_uInt16 len); + LwpFrib* GetNext(){return m_pNext;} + void SetNext(LwpFrib* next){m_pNext = next;} + sal_uInt8 GetType() const { return m_nFribType;} + OUString GetEditor(); + XFColor GetHighlightColor(); +protected: + std::map<LwpFrib*,OUString>* m_pFribMap; + LwpPara* m_pPara; + LwpFrib* m_pNext; + sal_uInt8 m_nFribType; + std::unique_ptr<ModifierInfo> m_pModifiers; + OUString m_StyleName; +public: + bool m_ModFlag; + const OUString& GetStyleName() const {return m_StyleName;} + void SetModifiers(ModifierInfo* pModifiers); + ModifierInfo* GetModifiers(){return m_pModifiers.get();} + virtual void RegisterStyle(LwpFoundry* pFoundry); + bool HasNextFrib(); + void ConvertChars(XFContentContainer* pXFPara,const OUString& text); + void ConvertHyperLink(XFContentContainer* pXFPara, const LwpHyperlinkMgr* pHyperlink,const OUString& text); + rtl::Reference<XFFont> GetFont(); + + sal_uInt8 GetRevisionType() const {return m_nRevisionType;} + bool GetRevisionFlag() const {return m_bRevisionFlag;} + enum{ + REV_INSERT =0, + REV_DELETE = 1, + }; + + void Register(std::map<LwpFrib*,OUString>* pFribMap); + void Deregister(); +private: + static void ReadModifiers(LwpObjectStream* pObjStrm,ModifierInfo* pModInfo); +protected: + sal_uInt8 m_nRevisionType; + bool m_bRevisionFlag; + sal_uInt8 m_nEditor; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpglobalmgr.hxx b/lotuswordpro/inc/lwpglobalmgr.hxx new file mode 100644 index 000000000..9bfc5e3d6 --- /dev/null +++ b/lotuswordpro/inc/lwpglobalmgr.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPGLOBALMGR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPGLOBALMGR_HXX + +#include <memory> +#include <map> +#include <config_lgpl.h> +#include "lwpsvstream.hxx" +#include "lwpobjfactory.hxx" +#include "lwpbookmarkmgr.hxx" +#include "lwpchangemgr.hxx" +#include "xfilter/xffontfactory.hxx" +#include "xfilter/xfstylemanager.hxx" +#include "lwpdocdata.hxx" +#include "xfilter/xfcolor.hxx" + +class LwpGlobalMgr +{ +public: + ~LwpGlobalMgr(); + static LwpGlobalMgr* GetInstance(LwpSvStream* pSvStream=nullptr); + static void DeleteInstance(); + LwpObjectFactory* GetLwpObjFactory(){return m_pObjFactory.get();} + LwpBookmarkMgr* GetLwpBookmarkMgr(){return m_pBookmarkMgr.get();} + LwpChangeMgr* GetLwpChangeMgr(){return m_pChangeMgr.get();} + XFFontFactory* GetXFFontFactory(){return m_pXFFontFactory.get();} + XFStyleManager* GetXFStyleManager(){return m_pXFStyleManager.get();} + void SetEditorAttrMap(sal_uInt16 nID, LwpEditorAttr* pAttr); + OUString GetEditorName(sal_uInt8 nID); + XFColor GetHighlightColor(sal_uInt8 nID); +private: + explicit LwpGlobalMgr(LwpSvStream* pSvStream); +private: + static std::map< sal_uInt32,LwpGlobalMgr* > m_ThreadMap; + std::unique_ptr<LwpObjectFactory> m_pObjFactory; + std::unique_ptr<LwpBookmarkMgr> m_pBookmarkMgr; + std::unique_ptr<LwpChangeMgr> m_pChangeMgr; + std::unique_ptr<XFFontFactory> m_pXFFontFactory; + std::unique_ptr<XFStyleManager> m_pXFStyleManager; + std::map<sal_uInt16, std::unique_ptr<LwpEditorAttr>> m_EditorAttrMap; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpidxmgr.hxx b/lotuswordpro/inc/lwpidxmgr.hxx new file mode 100644 index 000000000..e3165cdce --- /dev/null +++ b/lotuswordpro/inc/lwpidxmgr.hxx @@ -0,0 +1,113 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * index manager, to maintain the map between object id and offset + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPIDXMGR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPIDXMGR_HXX + +#include <config_lgpl.h> +#include "lwpobjid.hxx" +#include "lwpobjstrm.hxx" + +/** + * @brief key structure used to map id to offset +*/ +struct LwpKey +{ + LwpObjectID id; + sal_uInt32 offset = 0; +}; + +/** + * @brief LwpIndexManager, to read all index records and maintain the index information +*/ +class LwpIndexManager final +{ +public: + LwpIndexManager(); +private: + static const sal_uInt8 MAXOBJECTIDS; + std::vector<LwpKey> m_ObjectKeys; //the <id, offset> ordered vector + std::vector<LwpKey> m_RootObjs; //For those object ids in RootObjIndex + std::vector<sal_uInt32> m_TimeTable; //Time table for object low id compression + + //sal_uInt16 m_nKeyCount; + sal_uInt32 m_nKeyCount; //the count of all object + std::vector<sal_uInt32> m_TempVec; // a temp vector , store the offset of leafindex + + sal_uInt32 m_ChildIndex[256]; //Offset of leaf index + sal_uInt16 m_nLeafCount; + + void ReadRootData(LwpObjectStream *pObjStrm ); //Read root index data + + //Add new method to handle ObjIndex + void ReadObjIndexData(LwpObjectStream* pObjStrm); + void ReadObjIndex( LwpSvStream *pStrm ); //Read Obj index + + void ReadLeafIndex( LwpSvStream *pStrm ); //Read leaf index obj + void ReadLeafData( LwpObjectStream *pStrm ); //Read leaf index obj data + void ReadTimeTable( LwpObjectStream *pStrm ); +public: + void Read( LwpSvStream *pStrm ); + sal_uInt32 GetObjOffset( LwpObjectID objid ); + sal_uInt32 GetObjTime( sal_uInt16 index ) { return m_TimeTable.at(index-1); } +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpobj.hxx b/lotuswordpro/inc/lwpobj.hxx new file mode 100644 index 000000000..e9b6c98fa --- /dev/null +++ b/lotuswordpro/inc/lwpobj.hxx @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + /** + * @file + * Base class of all Lwp VO objects + */ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPOBJ_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPOBJ_HXX + +#include <memory> +#include <sal/config.h> + +#include <stdexcept> + +#include <salhelper/simplereferenceobject.hxx> + +#include <config_lgpl.h> + +#include "lwpobjhdr.hxx" +#include "lwpobjstrm.hxx" +#include "xfilter/ixfstream.hxx" +#include "xfilter/xfcontentcontainer.hxx" + +class LwpFoundry; +/** + * @brief Base class of all Lwp VO objects +*/ +class LwpObject: public salhelper::SimpleReferenceObject +{ +public: + LwpObject(LwpObjectHeader objHdr, LwpSvStream* pStrm); +protected: + virtual ~LwpObject() override; + LwpObjectHeader m_ObjHdr; + std::unique_ptr<LwpObjectStream> m_pObjStrm; + LwpFoundry* m_pFoundry; + LwpSvStream* m_pStrm; + bool m_bRegisteringStyle; + bool m_bParsingStyle; + bool m_bConvertingContent; +protected: + virtual void Read(); + virtual void RegisterStyle(); + virtual void Parse(IXFStream* pOutputStream); + virtual void XFConvert(XFContentContainer* pCont); +public: + void QuickRead(); + //calls RegisterStyle but bails if DoRegisterStyle is called + //on the same object recursively + void DoRegisterStyle() + { + if (m_bRegisteringStyle) + throw std::runtime_error("recursion in styles"); + m_bRegisteringStyle = true; + RegisterStyle(); + m_bRegisteringStyle = false; + } + //calls Parse but bails if DoParse is called + //on the same object recursively + void DoParse(IXFStream* pOutputStream) + { + if (m_bParsingStyle) + throw std::runtime_error("recursion in parsing"); + m_bParsingStyle = true; + Parse(pOutputStream); + m_bParsingStyle = false; + } + //calls XFConvert but bails if DoXFConvert is called + //on the same object recursively + void DoXFConvert(XFContentContainer* pCont) + { + if (m_bConvertingContent) + throw std::runtime_error("recursion in parsing"); + m_bConvertingContent = true; + XFConvert(pCont); + m_bConvertingContent = false; + } + + LwpFoundry* GetFoundry(){return m_pFoundry;} + void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;} + LwpObjectID& GetObjectID(){ return m_ObjHdr.GetID();} + sal_uInt32 GetTag() const { return m_ObjHdr.GetTag();} +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpobjfactory.hxx b/lotuswordpro/inc/lwpobjfactory.hxx new file mode 100644 index 000000000..b1d644b0d --- /dev/null +++ b/lotuswordpro/inc/lwpobjfactory.hxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPOBJFACTORY_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPOBJFACTORY_HXX + +#include <sal/config.h> + +#include <config_lgpl.h> + +#include <rtl/ref.hxx> + +#include "lwpobjid.hxx" +#include "lwpobj.hxx" +#include "lwpobjhdr.hxx" +#include "lwpidxmgr.hxx" + +#include <unordered_map> +#include <vector> + +/** + * @brief object factory used for lwp object creation and maintenance +*/ +class LwpObjectFactory final +{ +public: + explicit LwpObjectFactory(LwpSvStream* pSvStream); + ~LwpObjectFactory(); + +//For object Factory and object manager +private: + LwpSvStream* m_pSvStream; + std::vector<LwpObjectID> m_aObjsIDInCreation; + struct hashFunc + { + size_t operator()( const LwpObjectID& rName ) const + { + return rName.HashCode(); + } + }; + struct eqFunc + { + bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const + { + return(rKey1==rKey2); + } + }; + typedef std::unordered_map<LwpObjectID, rtl::Reference<LwpObject>, hashFunc, eqFunc> LwpIdToObjMap; + LwpIdToObjMap m_IdToObjList; + LwpIndexManager m_IndexMgr; + + rtl::Reference<LwpObject> FindObject(const LwpObjectID &objID); +public: + rtl::Reference<LwpObject> CreateObject(sal_uInt32 type, LwpObjectHeader &objHdr); + rtl::Reference<LwpObject> QueryObject(const LwpObjectID &objID); + void ReleaseObject(const LwpObjectID &objID); + void ReadIndex(LwpSvStream* pStrm); + LwpIndexManager& GetIndexManager(){return m_IndexMgr;} + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpobjhdr.hxx b/lotuswordpro/inc/lwpobjhdr.hxx new file mode 100644 index 000000000..e61b587f3 --- /dev/null +++ b/lotuswordpro/inc/lwpobjhdr.hxx @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPOBJHDR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPOBJHDR_HXX + +#include <config_lgpl.h> +#include "lwpobjid.hxx" + +/** + * @brief Base class of all Lwp VO objects +*/ +class LwpObjectHeader +{ +public: + LwpObjectHeader(); +private: + sal_uInt32 m_nTag; + LwpObjectID m_ID; + sal_uInt32 m_nSize; //Data size + bool m_bCompressed; + + //localize the following members to save memory + //sal_uInt8 m_nFlagBits; + //sal_uInt32 m_nVersionID; + //sal_uInt32 m_nRefCount; + //sal_uInt32 m_nNextVersionOffset; + //sal_uInt32 m_nNextVersionID; + //sal_uInt32 m_nHeaderSize; + + enum + { + VERSION_BITS = 0x03, + DEFAULT_VERSION = 0x00, + ONE_BYTE_VERSION = 0x01, + TWO_BYTE_VERSION = 0x02, + FOUR_BYTE_VERSION = 0x03, + + REFCOUNT_BITS = 0x0C, + ONE_BYTE_REFCOUNT = 0x04, + TWO_BYTE_REFCOUNT = 0x08, + FOUR_BYTE_REFCOUNT = 0x0C, + + SIZE_BITS = 0x30, + ONE_BYTE_SIZE = 0x10, + TWO_BYTE_SIZE = 0x20, + FOUR_BYTE_SIZE = 0x30, + + HAS_PREVOFFSET = 0x40, + DATA_COMPRESSED = 0x80 + }; + +public: + bool Read(LwpSvStream &pStrm); + inline sal_uInt32 GetTag() const; + inline sal_uInt32 GetSize() const; + inline LwpObjectID& GetID(); + inline bool IsCompressed() const; +}; + +inline sal_uInt32 LwpObjectHeader::GetTag() const +{ + return m_nTag; +} +inline sal_uInt32 LwpObjectHeader::GetSize() const +{ + return m_nSize; +} +inline LwpObjectID& LwpObjectHeader::GetID() +{ + return m_ID; +} +inline bool LwpObjectHeader::IsCompressed() const +{ + return m_bCompressed; +} +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpobjid.hxx b/lotuswordpro/inc/lwpobjid.hxx new file mode 100644 index 000000000..b35e58450 --- /dev/null +++ b/lotuswordpro/inc/lwpobjid.hxx @@ -0,0 +1,143 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPOBJID_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPOBJID_HXX + +#include <sal/config.h> + +#include <config_lgpl.h> + +#include <rtl/ref.hxx> + +#include "lwpobjstrm.hxx" +#include "lwpdefs.hxx" + +class LwpObject; + +/** + * @brief object id class +*/ +class LwpObjectID +{ +public: + LwpObjectID(); +private: + sal_uInt32 m_nLow; + sal_uInt16 m_nHigh; + sal_uInt8 m_nIndex; + bool m_bIsCompressed; +public: + void Read( LwpSvStream *pStrm ); + sal_uInt32 Read( LwpObjectStream *pStrm ); + void ReadIndexed( LwpSvStream* pStrm ); + sal_uInt32 ReadIndexed( LwpObjectStream *pStrm ); + void ReadCompressed( LwpObjectStream* pObj, LwpObjectID const & prev ); + + /** + * @descr return the size of object id with format: low(4bytes)+high(2bytes) + */ + static sal_uInt32 DiskSize() { return sizeof(sal_uInt32) + sizeof(sal_uInt16); } // sizeof(m_nLow) + sizeof(m_nHigh) + sal_uInt32 DiskSizeIndexed() const; + bool IsNull() const; + + sal_uInt32 GetLow() const ; + sal_uInt16 GetHigh() const ; + + bool operator == (const LwpObjectID &Other) const; + bool operator != (const LwpObjectID &Other) const; + rtl::Reference<LwpObject> obj(VO_TYPE tag=VO_INVALID) const; + size_t HashCode() const; +}; + +inline bool LwpObjectID::IsNull() const +{ + return (m_nLow == 0) && (m_nHigh == 0); +} + +inline bool LwpObjectID::operator == (const LwpObjectID &Other) const +{ + return (m_nHigh == Other.m_nHigh) && (m_nLow == Other.m_nLow); +} + +inline bool LwpObjectID::operator != (const LwpObjectID &Other) const +{ + return (m_nHigh != Other.m_nHigh) || (m_nLow != Other.m_nLow); +} + +inline sal_uInt32 LwpObjectID::GetLow() const +{ + return m_nLow; +} + +inline sal_uInt16 LwpObjectID::GetHigh() const +{ + return m_nHigh; +} + +inline size_t LwpObjectID::HashCode() const +{ + return static_cast<size_t>( + (m_nIndex == 0 ? 23 * m_nLow : 27 * m_nIndex) + 29 * m_nHigh); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpobjstrm.hxx b/lotuswordpro/inc/lwpobjstrm.hxx new file mode 100644 index 000000000..adde15593 --- /dev/null +++ b/lotuswordpro/inc/lwpobjstrm.hxx @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * object stream header file + * stream for one LwpObject body data + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPOBJSTRM_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPOBJSTRM_HXX + +#include <config_lgpl.h> + +#include <rtl/ustring.hxx> +#include <vector> + +#include "lwpsvstream.hxx" + +/** + * @brief stream class for LwpObject body data + * provide stream like interface to read object data +*/ +class LwpObjectStream +{ +public: + LwpObjectStream(LwpSvStream *pStrm, bool isCompressed, sal_uInt16 size); + ~LwpObjectStream(); +private: + sal_uInt8* m_pContentBuf; //The content buffer of the object + sal_uInt8 m_SmallBuffer[100]; //To avoid frequent new + std::vector<sal_uInt8> m_BigBuffer; //otherwise use this + enum + { + IO_BUFFERSIZE = 0xFF00 //Refer to LWP, not sure if it is enough + }; + sal_uInt16 m_nBufSize; //The total size of m_pContentBuf + sal_uInt16 m_nReadPos; //The position of the quick read + LwpSvStream* m_pStrm; + bool m_bCompressed; +public: + sal_uInt16 remainingSize() const; + sal_uInt16 QuickRead(void* buf, sal_uInt16 len); + sal_uInt16 GetPos() const { return m_nReadPos; } + void SeekRel(sal_uInt16 pos); + void Seek( sal_uInt16 pos); + void SkipExtra(); + sal_uInt16 CheckExtra(); + + bool QuickReadBool(); + sal_uInt32 QuickReaduInt32(bool *pFailure=nullptr); + sal_uInt16 QuickReaduInt16(bool *pFailure=nullptr); + sal_uInt8 QuickReaduInt8(bool *pFailure=nullptr); + sal_Int32 QuickReadInt32(); + sal_Int16 QuickReadInt16(); + double QuickReadDouble(); + + OUString QuickReadStringPtr(); + + void ReadComplete(); + LwpSvStream *GetStream(); +private: + void Read2Buffer(); + sal_uInt8* AllocBuffer(sal_uInt16 size); + static sal_uInt16 DecompressBuffer(sal_uInt8* pDst, sal_uInt8* pSrc, sal_uInt16 Size); + void ReleaseBuffer(); +}; + +inline LwpSvStream *LwpObjectStream::GetStream() +{ + return m_pStrm; +} +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpobjtags.hxx b/lotuswordpro/inc/lwpobjtags.hxx new file mode 100644 index 000000000..9d011c338 --- /dev/null +++ b/lotuswordpro/inc/lwpobjtags.hxx @@ -0,0 +1,237 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPOBJTAGS_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPOBJTAGS_HXX + +// file header object +#define TAG_AMI 0x3750574CUL // "LWP7" + +// layout sub-objects +#define TAG_ENDSUBOBJ 0x646E4553UL // "SEnd" +#define TAG_LAY_GEOMETRY 0x6F65474CUL // "LGeo" +#define TAG_LAY_OFFSET 0x66664F4CUL // "LOff" +#define TAG_LAY_SCALE 0x6C63534CUL // "LScl" +#define TAG_LAY_MARGINS 0x72614D4CUL // "LMar" +#define TAG_LAY_RELATIVITY 0x6C65524CUL // "LRel" +#define TAG_LAY_COLUMNS 0x6C6F434CUL // "LCol" +#define TAG_LAY_BORDER 0x726F424CUL // "LBor" +#define TAG_LAY_GUTTER 0x7475474CUL // "LGut" +#define TAG_LAY_JOIN 0x696F4A4CUL // "LJoi" +#define TAG_LAY_BACKGROUND 0x6B63424CUL // "LBck" +#define TAG_LAY_SHADOW 0x7764534CUL // "LSdw" +#define TAG_LAY_LEADERDOTS 0x72644C4CUL // "LLdr" +#define TAG_LAY_NUMERICS 0x6D754E4CUL // "LNum" +#define TAG_LAY_HIERARCHY 0x6569484CUL // "LHie" + +// Paragraph properties +#define TAG_PARA_SHOW 0x65644850UL // "PHde" +#define TAG_PARA_HIDE 0x77685350UL // "PShw" +#define TAG_PARA_ALIGN 0x6e6c4150UL // "PAln" +#define TAG_PARA_INDENT 0x74644950UL // "PIdt" +#define TAG_PARA_SPACING 0x63705350UL // "PSpc" +#define TAG_PARA_BORDER 0x64724250UL // "PBrd" +#define TAG_PARA_BACKGROUND 0x6b614250UL // "PBak" +#define TAG_PARA_BREAKS 0x6b724250UL // "PBrk" +#define TAG_PARA_BULLET 0x746c4250UL // "PBlt" +#define TAG_PARA_NUMBERING 0x6d754e50UL // "PNum" +#define TAG_PARA_TAB 0x62615450UL // "PTab" +#define TAG_PARA_KINSOKU 0x6e694b50UL // "PKin" +#define TAG_PARA_PROPLIST 0x70725050UL // "PPrp" + +#define TAG_SLVLIST 0x734C4C53UL // "SLLs" +#define TAG_DLFVLIST 0x4C464C44UL // "DLFL" +#define TAG_DLVLISTHEAD 0x64484C44UL // "DLHd" +#define TAG_DLNFVLIST 0x464E4C44UL // "DLNF" +#define TAG_DLVLIST 0x734C4C44UL // "DLLs" + +#define TAG_DOCUMENT 0x20636F44UL // "Doc " +#define TAG_VERDOCUMENT 0x636F4456UL // "VDoc" +#define TAG_DOCDATA 0x44636F44UL // "DocD" +#define TAG_OBJINDEX 0x78644E4FUL // "ONdx" +#define TAG_DIVISIONINFO 0x49766944UL // "DivI" +#define TAG_CONTENT 0x746E6F43UL // "Cont" +#define TAG_HEADCONTENT 0x746E4348UL // "HCnt" +#define TAG_STORY 0x79727453UL // "Stry" +#define TAG_TABLE 0x6C626154UL // "Tabl" +#define TAG_SUPERTABLE 0x62547553UL // "SuTb" +#define TAG_GLOSSARY 0x736F6C47UL // "Glos" +#define TAG_PARALLELCOLUMNS 0x6C6F4350UL // "PCol" +#define TAG_PARALLELCOLUMNSLAYOUT 0x794C4350UL // "PCLy" +#define TAG_PARALLELCOLUMNSBLOCK 0x6C424350UL // "PCBl" +#define TAG_PARALLELCOLUMNSCONNECTEDBLOCK 0x42434350UL // "PCCB" +#define TAG_FOOTNOTETABLE 0x62546E46UL // "FnTb" +#define TAG_PARAGRAPH 0x61726150UL // "Para" +#define TAG_BOOKMARK 0x6B4D6B42UL // "BkMk" +#define TAG_DDELINK 0x4C656444UL // "DdeL" +#define TAG_VIRTUALLAYOUT 0x79614C56UL // "VLay" +#define TAG_LITELAYOUT 0x79614C4CUL // "LLay" +#define TAG_LAYOUT 0x2079614CUL // "Lay " +#define TAG_PERMISSIVELAYOUT 0x79614C50UL // "PLay" +#define TAG_HEADLAYOUT 0x79614C48UL // "HLay" +#define TAG_FRAMELAYOUT 0x6D617246UL // "Fram" +#define TAG_DROPCAPLAYOUT 0x70614344UL // "DCap" +#define TAG_NOTELAYOUT 0x794C744EUL // "NtLy" +#define TAG_NOTETEXTLAYOUT 0x6C54744EUL // "NtTl" +#define TAG_NOTEHEADERLAYOUT 0x6C48744EUL // "NtHl" +#define TAG_PAGELAYOUT 0x65676150UL // "Page" +#define TAG_HEADERLAYOUT 0x4C726448UL // "HdrL" +#define TAG_FOOTERLAYOUT 0x4C727446UL // "FtrL" +#define TAG_ROWLAYOUT 0x4C776F52UL // "RowL" +#define TAG_COLUMNLAYOUT 0x4C6C6F43UL // "ColL" +#define TAG_FNROWLAYOUT 0x4C526E46UL // "FnRL" +#define TAG_CELLLAYOUT 0x4C6C6543UL // "CelL" +#define TAG_VIEWPORTLAYOUT 0x794C7056UL // "VpLy" +#define TAG_CONNECTEDCELLLAYOUT 0x4C436E43UL // "CnCL" +#define TAG_HIDDENCELLLAYOUT 0x4C436E48UL // "HnCL" +#define TAG_TABLEHEADINGLAYOUT 0x4C486254UL // "TbHL" +#define TAG_ROWHEADINGLAYOUT 0x4C486F52UL // "RoHL" +#define TAG_FNCELLLAYOUT 0x4C436E46UL // "FnCL" +#define TAG_FOOTNOTELAYOUT 0x794C6E46UL // "FnLy" +#define TAG_TABLELAYOUT 0x794C6254UL // "TbLy" +#define TAG_SUPERTABLELAYOUT 0x4C625453UL // "STbL" +#define TAG_FNSUPERTABLELAYOUT 0x4C545346UL // "FSTL" +#define TAG_ENSUPERTABLELAYOUT 0x4C545345UL // "ESTL" +#define TAG_SUPERPARALLELCOLUMNLAYOUT 0x4C435053UL // "SPCL" +#define TAG_SUPERGLOSSARYLAYOUT 0x534C4753UL // "SGLS" +#define TAG_CONTONLAYOUT 0x4C6E4F43UL // "COnL" +#define TAG_CONTFROMLAYOUT 0x4C724643UL // "CFrL" +#define TAG_CHARSTYLE 0x79745343UL // "CSty" +#define TAG_PARASTYLE 0x79745350UL // "PSty" +#define TAG_TABRACK 0x20626154UL // "Tab " +#define TAG_GROUPLAYOUT 0x4c707247UL // "GrpL" +#define TAG_GROUPFRAME 0x46707247UL // "GrpF" +#define TAG_SILVERBULLET 0x6c754253UL // "SBul" +#define TAG_TABLEHEADING 0x486c6254UL // "TblH" +#define TAG_LINEHINT 0x746e484cUL // "LHnt" +#define TAG_TABLEHINT 0x746e4854UL // "THnt" +#define TAG_PAGEHINT 0x746e4850UL // "PHnt" +#define TAG_NUMBERHINT 0x746e484EUL // "NHnt" +#define TAG_FOOTNOTESEEN 0x65655346UL // "FSee" +#define TAG_OBJECTHOLDER 0x646c6F48UL // "Hold" +#define TAG_LISTLIST 0x744c744cUL // "LtLt" +#define TAG_FOOTNOTELISTLIST 0x744c7446UL // "FtLt" +#define TAG_ENDNOTELAYOUT 0x794C6E45UL // "EnLy" +#define TAG_FOOTNOTE 0x746F4E46UL // "FNot" +#define TAG_CELLNUMBERHINT 0x74486e43UL // "CnHt" +#define TAG_MARKER 0x6b72614DUL // "Mark" +#define TAG_STORYMARKER 0x6b724d53UL // "SMrk" +#define TAG_TABLEMARKER 0x6b724d54UL // "TMrk" +#define TAG_FIELDMARKER 0x4c724d54UL // "FMrk" +#define TAG_NUMERICVALUE 0x6c61564eUL // "NVal" +#define TAG_TEXTVALUE 0x6c615654UL // "TVal" +#define TAG_REFERENCEVALUE 0x6c615652UL // "RVal" +#define TAG_CELLLIST 0x64734c43UL // "CLst" +#define TAG_DEPENDENT 0x74647044UL // "Dpdt" +#define TAG_FORMULAINFO 0x616c7246UL // "Frla" +#define TAG_TABLERANGE 0x676e5254UL // "TRng" +#define TAG_CELLRANGE 0x676e5243UL // "CRng" +#define TAG_FOLDER 0x726c6446UL // "Fldr" +#define TAG_ROWLIST 0x74734c52UL // "RLst" +#define TAG_SECTION 0x74636553UL // "Sect" +#define TAG_INDEXSECTION 0x63657349UL // "Isec" +#define TAG_GRAPHIC 0x68707247UL // "Grph" +#define TAG_DIRTBAG 0x74726944UL // "Dirt" +#define TAG_NAMEDOUTLINESEQ 0x71534f4eUL // "NOSq" +#define TAG_OUTLINESEQITEM 0x7449534fUL // "OSIt" +#define TAG_TOCSUPERTABLELAYOUT 0x6C747354UL // "Tstl" +#define TAG_DOCSOCKET 0x786F5344UL // "DSox" +#define TAG_USER_VERSION 0x72655655UL // "UVer" +#define TAG_NOTE 0x65746F4EUL // "Note" +#define TAG_MARKERLIST 0x74734c4dUL // "MLst" +#define TAG_BOOKMARKMARKERLIST 0x744c4d42UL // "BMLt" +#define TAG_DDEMARKMARKERLIST 0x744c4d44UL // "DMLt" +#define TAG_FIELDMARKERLIST 0x744c6c46UL // "FlLt" +#define TAG_CHBLKMARKER 0x6b4d4843UL // "CHMk" +#define TAG_CHBMARKERLIST 0x424d4c43UL // "CMLt" +#define TAG_PPTRHOLDER 0x72745070UL // "pPtr" +#define TAG_QPTRHOLDER 0x72745071UL // "qPtr" +#define TAG_GPTRHOLDER 0x72745067UL // "gPtr" +#define TAG_PROPLIST 0x706f7250UL // "Prop" +#define TAG_HEADHOLDER 0x646C4848UL // "HHld" +#define TAG_HEADTAILHOLDER 0x72485448UL // "HTHr" +#define TAG_OLEOBJECT 0x4F656C4FUL // "OleO" +#define TAG_ENUMOBJHD 0x64484F45UL // "EOHd" +#define TAG_TOCLEVELDATA 0x4C6f6354UL // "TocL" +#define TAG_VERPTR 0x72745056UL // "VPtr" +#define TAG_VERQTR 0x72745156UL // "VQtr" +#define TAG_VERDOCINFO 0x6E494456UL // "VDIn" +#define TAG_TOMBSTONE 0x20504952UL // "RIP " +#define TAG_NOTIFY 0x7966744EUL // "Ntfy" +#define TAG_LONGHOLDER 0x676E6F4CUL // "Long" + +#define TAG_DIVOPTS 0x74704f44UL // "DOpt" +#define TAG_FOOTNOTEOPTS 0x704f4e46UL // "FNOp" + +#ifdef RUBY +#define TAG_RUBYLAYOUT 0x794C6252UL // "RbLy" +#define TAG_RUBYMARKER 0x6b724d52UL // "RMrk" +#define TAG_RUBYMARKERLIST 0x744c6252UL // "RbLt" +#endif + +#define TAG_ALIGNMENTPIECE 0x63506c41UL // "AlPc" +#define TAG_INDENTPIECE 0x63506e49UL // "InPc" +#define TAG_PARABORDERPIECE 0x63504250UL // "PBPc" +#define TAG_PARABACKGROUNDPIECE 0x63505250UL // "PRPc" +#define TAG_SPACINGPIECE 0x63507053UL // "SpPc" +#define TAG_BREAKSPIECE 0x63507242UL // "BrPc" +#define TAG_NUMBERINGPIECE 0x6350724eUL // "NrPc" +#define TAG_CHARBORDERPIECE 0x63504243UL // "CBPc" +#define TAG_AMIKAKEPIECE 0x63504b41UL // "AKPc" +#define TAG_TABPIECE 0x63506254UL // "TbPc" + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpoverride.hxx b/lotuswordpro/inc/lwpoverride.hxx new file mode 100644 index 000000000..036492e51 --- /dev/null +++ b/lotuswordpro/inc/lwpoverride.hxx @@ -0,0 +1,483 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPOVERRIDE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPOVERRIDE_HXX + +#include "lwpobjid.hxx" +#include "lwptools.hxx" +#include <o3tl/safeint.hxx> +#include <memory> + +class LwpObjectStream; + +enum STATE +{ + STATE_OFF = 0, + STATE_ON = 1, + STATE_STYLE = 2 +}; + +class LwpOverride +{ +public: + LwpOverride() : m_nValues(0), m_nOverride(0), m_nApply(0) {} + + virtual ~LwpOverride(){} + + virtual LwpOverride* clone() const = 0; + + virtual void Read(LwpObjectStream* pStrm) = 0; + + void ReadCommon(LwpObjectStream* pStrm); + + void Clear(); + + void Override(sal_uInt16 nBits, STATE eState); + +protected: + explicit LwpOverride(LwpOverride const& rOther); + +private: + LwpOverride& operator=(LwpOverride const& rOther) = delete; + +protected: + sal_uInt16 m_nValues; + sal_uInt16 m_nOverride; + sal_uInt16 m_nApply; +}; + +class LwpTextLanguageOverride final : public LwpOverride +{ +public: + LwpTextLanguageOverride() : m_nLanguage(0) {} + + virtual LwpTextLanguageOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + +private: + LwpTextLanguageOverride(LwpTextLanguageOverride const& rOther); + LwpTextLanguageOverride& operator=(LwpTextLanguageOverride const& rOther) = delete; + + sal_uInt16 m_nLanguage; +}; + +class LwpTextAttributeOverride final : public LwpOverride +{ +public: + LwpTextAttributeOverride() : m_nHideLevels(0), m_nBaseLineOffset(0) {} + + virtual LwpTextAttributeOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + + inline sal_uInt16 GetHideLevels() const; + + bool IsHighlight() const; + +private: + LwpTextAttributeOverride(LwpTextAttributeOverride const& rOther); + LwpTextAttributeOverride& operator=(LwpTextAttributeOverride const& rOther) = delete; + + enum{ + TAO_HIGHLIGHT = 0x08, + }; + sal_uInt16 m_nHideLevels; + sal_uInt32 m_nBaseLineOffset; +}; + +inline sal_uInt16 LwpTextAttributeOverride::GetHideLevels() const +{ + return m_nHideLevels; +} + +class LwpKinsokuOptsOverride final : public LwpOverride +{ +public: + LwpKinsokuOptsOverride() : m_nLevels(0) {} + + virtual LwpKinsokuOptsOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + +private: + LwpKinsokuOptsOverride(LwpKinsokuOptsOverride const& rOther); + LwpKinsokuOptsOverride& operator=(LwpKinsokuOptsOverride const& rOther) = delete; + + sal_uInt16 m_nLevels; +}; + +class LwpBulletOverride final : public LwpOverride +{ +public: + LwpBulletOverride() {m_bIsNull = true;} + + virtual LwpBulletOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + + inline const LwpObjectID& GetSilverBullet() const; + + void Override(LwpBulletOverride* pOther); + + inline bool IsSilverBulletOverridden() const; + inline bool IsSkipOverridden() const; + inline bool IsRightAlignedOverridden() const; + inline bool IsSkip() const; + inline bool IsRightAligned() const; + inline bool IsEditable() const; + + void OverrideSilverBullet(LwpObjectID aID); + void OverrideSkip(bool bOver); + void OverrideRightAligned(bool bOver); + + inline void RevertSilverBullet(); + inline void RevertSkip(); + inline void RevertRightAligned(); + + bool IsInValid() const {return m_bIsNull;} + +private: + LwpBulletOverride(LwpBulletOverride const& rOther); + LwpBulletOverride& operator=(LwpBulletOverride const& rOther) = delete; + + enum + { + BO_SILVERBULLET = 0x01, + // 0x02 is free + BO_RIGHTALIGN = 0x04, + BO_EDITABLE = 0x08, + BO_SKIP = 0x10 + }; + + LwpObjectID m_SilverBullet; + bool m_bIsNull; +}; + +inline const LwpObjectID& LwpBulletOverride::GetSilverBullet() const +{ + return m_SilverBullet; +} + +inline bool LwpBulletOverride::IsSilverBulletOverridden() const +{ + return ((m_nOverride & BO_SILVERBULLET) != 0); +} + +inline bool LwpBulletOverride::IsSkipOverridden() const +{ + return ((m_nOverride & BO_SKIP) != 0); +} + +inline bool LwpBulletOverride::IsRightAlignedOverridden() const +{ + return ((m_nOverride & BO_RIGHTALIGN) != 0); +} + +inline bool LwpBulletOverride::IsSkip() const +{ + return ((m_nValues & BO_SKIP) != 0); +} + +inline bool LwpBulletOverride::IsEditable() const +{ + return ((m_nValues & BO_EDITABLE) != 0); +} + +inline bool LwpBulletOverride::IsRightAligned() const +{ + return ((m_nValues & BO_RIGHTALIGN) != 0); +} + +inline void LwpBulletOverride::RevertSilverBullet() +{ + LwpOverride::Override(BO_SILVERBULLET, STATE_STYLE); +} + +inline void LwpBulletOverride::RevertSkip() +{ + LwpOverride::Override(BO_SKIP, STATE_STYLE); +} + +inline void LwpBulletOverride::RevertRightAligned() +{ + LwpOverride::Override(BO_RIGHTALIGN, STATE_STYLE); +} + +class LwpAlignmentOverride final : public LwpOverride +{ +public: + LwpAlignmentOverride() : m_nAlignType(ALIGN_LEFT), m_nPosition(0), m_nAlignChar(0){} + + virtual LwpAlignmentOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + + enum AlignType + { + ALIGN_LEFT = 0, + ALIGN_RIGHT = 1, + ALIGN_CENTER = 2, + ALIGN_JUSTIFY = 3, + ALIGN_JUSTIFYALL = 4, + ALIGN_NUMERICLEFT = 5, + ALIGN_NUMERICRIGHT = 6, + ALIGN_SQUEEZE = 7 + }; + + AlignType GetAlignType() const { return m_nAlignType; } + void Override(LwpAlignmentOverride* other); + void OverrideAlignment(AlignType val); + +private: + LwpAlignmentOverride(LwpAlignmentOverride const& rOther); + LwpAlignmentOverride& operator=(LwpAlignmentOverride const& rOther) = delete; + + enum + { + AO_TYPE = 0x01, + AO_POSITION = 0x02, + AO_CHAR = 0x04 + }; + + AlignType m_nAlignType; + sal_uInt32 m_nPosition; + sal_uInt16 m_nAlignChar; +}; + +class LwpSpacingCommonOverride final : public LwpOverride +{ +public: + LwpSpacingCommonOverride() : m_nSpacingType(SPACING_NONE), m_nAmount(0), m_nMultiple(65536){} + + virtual LwpSpacingCommonOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + + enum SpacingType + { + SPACING_DYNAMIC = 0, + SPACING_LEADING = 1, + SPACING_CUSTOM = 2, + SPACING_NONE = 3 + }; + + SpacingType GetType() const {return m_nSpacingType;} + sal_Int32 GetAmount() const {return m_nAmount;} + sal_Int32 GetMultiple() const {return m_nMultiple;} + + void Override(LwpSpacingCommonOverride* other); + void OverrideType(SpacingType val); + void OverrideAmount(sal_Int32 val); + void OverrideMultiple(sal_Int32 val); + +private: + LwpSpacingCommonOverride(LwpSpacingCommonOverride const& rOther); + LwpSpacingCommonOverride& operator=(LwpSpacingCommonOverride const& rOther) = delete; + + enum + { + SPO_TYPE = 0x01, + SPO_AMOUNT = 0x02, + SPO_MULTIPLE= 0x04 + }; + SpacingType m_nSpacingType;//sal_uInt16 + sal_Int32 m_nAmount; + sal_Int32 m_nMultiple; +}; + +class LwpSpacingOverride final : public LwpOverride +{ +public: + LwpSpacingOverride(); + virtual ~LwpSpacingOverride() override; + + virtual LwpSpacingOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + + void Override(LwpSpacingOverride* other); + + LwpSpacingCommonOverride* GetSpacing(){return m_pSpacing.get();} + LwpSpacingCommonOverride* GetAboveLineSpacing(){return m_pAboveLineSpacing.get();} + LwpSpacingCommonOverride* GetAboveSpacing(){return m_pParaSpacingAbove.get();} + LwpSpacingCommonOverride* GetBelowSpacing(){return m_pParaSpacingBelow.get();} + +private: + LwpSpacingOverride(LwpSpacingOverride const& rOther); + LwpSpacingOverride& operator=(LwpSpacingOverride const& rOther) = delete; + + std::unique_ptr<LwpSpacingCommonOverride> m_pSpacing; + std::unique_ptr<LwpSpacingCommonOverride> m_pAboveLineSpacing; + std::unique_ptr<LwpSpacingCommonOverride> m_pParaSpacingAbove; + std::unique_ptr<LwpSpacingCommonOverride> m_pParaSpacingBelow; +}; + +class LwpIndentOverride final : public LwpOverride +{ +public: + LwpIndentOverride() : m_nAll(0), m_nFirst(0), m_nRest(0), m_nRight(0) {} + + virtual LwpIndentOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + + enum + { + RELATIVE_FIRST, RELATIVE_REST, RELATIVE_ALL + }; + + inline double GetFirst() const; + inline double GetLeft() const; + inline double GetRight() const; + + sal_uInt16 GetRelative() const; + bool IsUseRelative() const; + void Override(LwpIndentOverride* other); + void OverrideIndentAll(sal_Int32 val); + void OverrideIndentFirst(sal_Int32 val); + void OverrideIndentRight(sal_Int32 val); + void OverrideIndentRest(sal_Int32 val); + void OverrideUseRelative(bool use); + void OverrideRelative(sal_uInt16 relative); + sal_Int32 GetMAll() const {return m_nAll;} + sal_Int32 GetMFirst() const {return m_nFirst;} + sal_Int32 GetMRest() const {return m_nRest;} + sal_Int32 GetMRight() const {return m_nRight;} + void SetMAll(sal_Int32 val){m_nAll=val;} + void SetMFirst(sal_Int32 val){m_nFirst=val;} + void SetMRest(sal_Int32 val){m_nRest=val;} + void SetMRight(sal_Int32 val){m_nRight=val;} + +private: + LwpIndentOverride(LwpIndentOverride const& rOther); + LwpIndentOverride& operator=(LwpIndentOverride const& rOther) = delete; + + enum + { + IO_ALL = 0x0001, + IO_FIRST = 0x0002, + IO_REST = 0x0004, + IO_RIGHT = 0x0008, + IO_HANGING = 0x0010, + IO_EQUAL = 0x0020, + IO_BODY = 0x0040, + IO_REL_ALL = 0x0080, + IO_REL_FIRST = 0x0100, + IO_REL_REST = 0x0200, + IO_REL_FLAGS = (IO_REL_ALL | IO_REL_FIRST | IO_REL_REST), + IO_USE_RELATIVE = 0x0400 + }; + + sal_Int32 m_nAll; + sal_Int32 m_nFirst; + sal_Int32 m_nRest; + sal_Int32 m_nRight; +}; + +inline double LwpIndentOverride::GetFirst() const +{ + sal_Int32 nRes; + if (o3tl::checked_sub(m_nFirst, m_nRest, nRes)) + throw std::range_error("bad len"); + return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(nRes)); +} +inline double LwpIndentOverride::GetLeft() const +{ + sal_Int32 nRes; + if (o3tl::checked_add(m_nAll, m_nRest, nRes)) + throw std::range_error("bad len"); + return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(nRes)); +} +inline double LwpIndentOverride::GetRight() const +{ + return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nRight)); +} + +class LwpBackgroundStuff; +class LwpAmikakeOverride final : public LwpOverride +{ +public: + LwpAmikakeOverride(); + + virtual ~LwpAmikakeOverride() override; + + virtual LwpAmikakeOverride* clone() const override; + + void Read(LwpObjectStream* pStrm) override; + enum + { + AMIKAKE_NONE = 0, + AMIKAKE_BACKGROUND = 1, + AMIKAKE_CHARACTER = 2 + }; + +private: + LwpAmikakeOverride(LwpAmikakeOverride const& rOther); + LwpAmikakeOverride& operator=(LwpAmikakeOverride const& rOther) = delete; + + std::unique_ptr<LwpBackgroundStuff> m_pBackgroundStuff; + sal_uInt16 m_nType; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwpsvstream.hxx b/lotuswordpro/inc/lwpsvstream.hxx new file mode 100644 index 000000000..445c2df5d --- /dev/null +++ b/lotuswordpro/inc/lwpsvstream.hxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPSVSTREAM_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPSVSTREAM_HXX + +#include <config_lgpl.h> + +#include <sal/types.h> + +class SvStream; + +/** + * @brief encapsulate XInputStream to provide SvStream like interfaces +*/ +class LwpSvStream +{ +public: + LwpSvStream(SvStream* pStream, LwpSvStream * pCompressed = nullptr); + size_t Read(void* bytes, size_t nBytesToRead); + void SeekRel(sal_Int64 pos); + sal_Int64 Tell(); + sal_Int64 Seek(sal_Int64 pos); + bool CheckSeek(sal_Int64 pos); + + LwpSvStream& ReadUInt8( sal_uInt8& rUInt8 ); + LwpSvStream& ReadUInt16( sal_uInt16& rUInt16 ); + LwpSvStream& ReadUInt32( sal_uInt32& rUInt32 ); + + static const sal_uInt32 LWP_STREAM_BASE; + + LwpSvStream * GetCompressedStream() + { + return m_pCompressedStream; + }; + SvStream * GetStream() + { + return m_pStream; + } + +private: + // when the file opened is small file, m_pStream is the decompressed stream + // when not, m_pStream contains the normal stream + SvStream* m_pStream; + + // when the file opened is small file, this stream is for saving the + // compressed stream which is to be used for Chart/OLE as BENTO container + LwpSvStream * m_pCompressedStream; +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/lwptools.hxx b/lotuswordpro/inc/lwptools.hxx new file mode 100644 index 000000000..7a360cdda --- /dev/null +++ b/lotuswordpro/inc/lwptools.hxx @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * to provide basic utilities for word pro filter + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPTOOLS_HXX +#define INCLUDED_LOTUSWORDPRO_INC_LWPTOOLS_HXX + +#include <config_lgpl.h> + +#include "lwpobjstrm.hxx" +#include "localtime.hxx" +#include "xfilter/xfdatestyle.hxx" +#include "xfilter/xftimestyle.hxx" +#include <rtl/textenc.h> +#include <stdexcept> + +// 01/19/2005 +const sal_uInt32 UNITS_PER_INCH = 65536L * 72L; +const double CM_PER_INCH = 2.54; +const double INCHT_PER_CM = 1.0 / CM_PER_INCH; +//end + +const double POINTS_PER_INCH = 72.27; +const double TWIPS_PER_POINT = 20.0; +const double TWIPS_PER_INCH = TWIPS_PER_POINT * POINTS_PER_INCH; +const double TWIPS_PER_CM = TWIPS_PER_INCH/CM_PER_INCH; +/** + * @brief tool class (unicode, conversion) for lwp filter. +*/ +class LwpTools +{ + +public: + static void QuickReadUnicode( LwpObjectStream* pObjStrm, + OUString& str, sal_uInt16 strlen, rtl_TextEncoding aEncoding ); + static bool IsUnicodePacked(LwpObjectStream* pObjStrm, sal_uInt16 len); + + inline static double ConvertFromUnits(sal_Int32 nUnits); + inline static double ConvertToMetric(double fInch); + inline static double ConvertFromUnitsToMetric(sal_Int32 nUnits); + + inline static bool IsOddNumber(sal_uInt16 nNumber); + inline static bool IsEvenNumber(sal_uInt16 nNumber); + + static bool isFileUrl(const OString& fileName); + static OUString convertToFileUrl(const OString& fileName); + static OUString DateTimeToOUString(const LtTm& dt); + + static std::unique_ptr<XFDateStyle> GetSystemDateStyle(bool bLongFormat); + static std::unique_ptr<XFTimeStyle> GetSystemTimeStyle(); +}; + +inline double LwpTools::ConvertFromUnits(sal_Int32 nUnits) +{ + return static_cast<double>(nUnits)/UNITS_PER_INCH; +} +inline double LwpTools::ConvertToMetric(double fInch) +{ + return fInch*CM_PER_INCH; +} +inline double LwpTools::ConvertFromUnitsToMetric(sal_Int32 nUnits) +{ + double fInch = ConvertFromUnits(nUnits); + return ConvertToMetric(fInch); +} +inline bool LwpTools::IsOddNumber(sal_uInt16 nNumber) +{ + return (nNumber%2) != 0; +} +inline bool LwpTools::IsEvenNumber(sal_uInt16 nNumber) +{ + return (nNumber%2) == 0; +} + +class BadSeek : public std::runtime_error +{ +public: + BadSeek() : std::runtime_error("Lotus Word Pro Bad Seek") { } +}; + +class BadRead: public std::runtime_error +{ +public: + BadRead() : std::runtime_error("Lotus Word Pro Bad Read") { } +}; + +class BadDecompress : public std::runtime_error +{ +public: + BadDecompress() : std::runtime_error("Lotus Word Pro Bad Decompress") { } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/pch/precompiled_lwpft.cxx b/lotuswordpro/inc/pch/precompiled_lwpft.cxx new file mode 100644 index 000000000..2f3866c72 --- /dev/null +++ b/lotuswordpro/inc/pch/precompiled_lwpft.cxx @@ -0,0 +1,12 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "precompiled_lwpft.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/pch/precompiled_lwpft.hxx b/lotuswordpro/inc/pch/precompiled_lwpft.hxx new file mode 100644 index 000000000..2135f0b3d --- /dev/null +++ b/lotuswordpro/inc/pch/precompiled_lwpft.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +/* + This file has been autogenerated by update_pch.sh. It is possible to edit it + manually (such as when an include file has been moved/renamed/removed). All such + manual changes will be rewritten by the next run of update_pch.sh (which presumably + also fixes all possible problems, so it's usually better to use it). + + Generated on 2020-02-01 10:57:44 using: + ./bin/update_pch lotuswordpro lwpft --cutoff=2 --exclude:system --exclude:module --exclude:local + + If after updating build fails, use the following command to locate conflicting headers: + ./bin/update_pch_bisect ./lotuswordpro/inc/pch/precompiled_lwpft.hxx "make lotuswordpro.build" --find-conflicts +*/ + +#if PCH_LEVEL >= 1 +#include <algorithm> +#include <assert.h> +#include <cassert> +#include <cstddef> +#include <cstring> +#include <limits> +#include <memory> +#include <new> +#include <ostream> +#include <stddef.h> +#include <stdexcept> +#include <stdio.h> +#include <string.h> +#include <string_view> +#include <type_traits> +#include <utility> +#include <vector> +#include <boost/cast.hpp> +#endif // PCH_LEVEL >= 1 +#if PCH_LEVEL >= 2 +#include <osl/diagnose.h> +#include <osl/endian.h> +#include <osl/file.h> +#include <osl/file.hxx> +#include <osl/process.h> +#include <osl/thread.h> +#include <osl/thread.hxx> +#include <osl/time.h> +#include <rtl/ref.hxx> +#include <rtl/string.hxx> +#include <rtl/stringconcat.hxx> +#include <rtl/stringutils.hxx> +#include <rtl/tencinfo.h> +#include <rtl/textenc.h> +#include <rtl/unload.h> +#include <rtl/ustrbuf.hxx> +#include <rtl/ustring.h> +#include <rtl/ustring.hxx> +#include <sal/config.h> +#include <sal/log.hxx> +#include <sal/macros.h> +#include <sal/saldllapi.h> +#include <sal/types.h> +#include <sal/typesizes.h> +#include <vcl/dllapi.h> +#include <vcl/svapp.hxx> +#endif // PCH_LEVEL >= 2 +#if PCH_LEVEL >= 3 +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/uno/Reference.h> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <cppuhelper/supportsservice.hxx> +#include <o3tl/numeric.hxx> +#include <o3tl/safeint.hxx> +#include <o3tl/sorted_vector.hxx> +#include <sfx2/dllapi.h> +#include <tools/color.hxx> +#include <tools/solar.h> +#include <tools/stream.hxx> +#include <xmloff/attrlist.hxx> +#endif // PCH_LEVEL >= 3 +#if PCH_LEVEL >= 4 +#endif // PCH_LEVEL >= 4 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/ixfattrlist.hxx b/lotuswordpro/inc/xfilter/ixfattrlist.hxx new file mode 100644 index 000000000..1fb79b60d --- /dev/null +++ b/lotuswordpro/inc/xfilter/ixfattrlist.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Interface for the attribute list of a xml element. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_IXFATTRLIST_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_IXFATTRLIST_HXX + +#include <rtl/ustring.hxx> + +/** + * @brief + * Attribute list interface for sax writer. + * Implement this interface for different sax writer. For OOo,i use the XDocumentHandler stream; + * for outputting the local file system,It's just a vector container. + */ +class IXFAttrList +{ +public: + virtual ~IXFAttrList() {} + /** + * @descr: Add an attribute to the attribute list. + */ + virtual void AddAttribute(const OUString& name, const OUString& value) = 0; + + /** + * @descr: Clear all the attributes in the attribute list. + */ + virtual void Clear() = 0; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/ixfstream.hxx b/lotuswordpro/inc/xfilter/ixfstream.hxx new file mode 100644 index 000000000..922e79952 --- /dev/null +++ b/lotuswordpro/inc/xfilter/ixfstream.hxx @@ -0,0 +1,111 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Sax stream to export xml to SODC. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_IXFSTREAM_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_IXFSTREAM_HXX + +#include <rtl/ustring.hxx> + +class IXFAttrList; + +/** + * @brief + * Stream wrapper for sax writer. + */ +class IXFStream +{ +public: + virtual ~IXFStream(){} + /** + * @descr Called when start write.Usually you can output document type info and xml encoding info. + */ + virtual void StartDocument() = 0; + + /** + * @descr called when end output. + */ + virtual void EndDocument() = 0; + + /** + * @descr Wrap XDocumentHandler::startElement() + * @param oustr element tag name. + */ + virtual void StartElement(const OUString& oustr) = 0; + + /** + * @descr Wrap XDocumentHandler::endElement() + * @param oustr element tag name. + */ + virtual void EndElement(const OUString& oustr) = 0; + + /** + * @descr output text node. + * @param oustr text content. + */ + virtual void Characters(const OUString& oustr) = 0; + + /** + * @descr return the Attribute list interface. + * @return attribute list. + */ + virtual IXFAttrList* GetAttrList() = 0; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/ixfstyle.hxx b/lotuswordpro/inc/xfilter/ixfstyle.hxx new file mode 100644 index 000000000..878c8af65 --- /dev/null +++ b/lotuswordpro/inc/xfilter/ixfstyle.hxx @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Interface for all style object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_IXFSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_IXFSTYLE_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfdefs.hxx> + +/** + * @descr + * Interface for all style object. + */ +class IXFStyle +{ +public: + IXFStyle() = default; + IXFStyle(IXFStyle const &) = default; + IXFStyle(IXFStyle &&) = default; + IXFStyle & operator =(IXFStyle const &) = default; + IXFStyle & operator =(IXFStyle &&) = default; + + virtual ~IXFStyle(){} + /** + * @descr: return the style name. + */ + virtual OUString GetStyleName() = 0; + + /** + * @descr: set the name of the style. + */ + virtual void SetStyleName(const OUString& styleName) = 0; + + /** + * @descr return the parent style name. + */ + virtual OUString GetParentStyleName() = 0; + /** + * @descr: Parent paragraph style. + */ + virtual void SetParentStyleName(const OUString& parent) = 0; + /** + * @descr: return the style family. You can reference to enumXFStyle. + */ + virtual enumXFStyle GetStyleFamily() = 0; + + /** + * @descr: Compare whatever two style object are the same. Used only by XFStyleManager. + * @param: pStyle the style to be compared. + * @return: return sal_True if equals, else sal_False. + */ + virtual bool Equal(IXFStyle *pStyle) = 0; + + virtual void ToXml(IXFStream * stream) = 0; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfannotation.hxx b/lotuswordpro/inc/xfilter/xfannotation.hxx new file mode 100644 index 000000000..5987ed665 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfannotation.hxx @@ -0,0 +1,108 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Annotation object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFANNOTATION_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFANNOTATION_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfcontentcontainer.hxx> + +class XFAnnotation : public XFContentContainer +{ +public: + void SetDate(const OUString& date); + + void SetAuthor(const OUString& author); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + OUString m_strDate; + OUString m_strAuthor; +}; + +inline void XFAnnotation::SetDate(const OUString& date) +{ + m_strDate = date; +} + +inline void XFAnnotation::SetAuthor(const OUString& author) +{ + m_strAuthor = author; +} + +inline void XFAnnotation::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + if( !m_strDate.isEmpty() ) + pAttrList->AddAttribute( "office:create-date", m_strDate ); + if( !m_strAuthor.isEmpty() ) + pAttrList->AddAttribute( "office:author", m_strAuthor); + pStrm->StartElement( "office:annotation" ); + + XFContentContainer::ToXml(pStrm); + + pStrm->EndElement( "office:annotation" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfarrowstyle.hxx b/lotuswordpro/inc/xfilter/xfarrowstyle.hxx new file mode 100644 index 000000000..c356318f8 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfarrowstyle.hxx @@ -0,0 +1,129 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Line Arrow. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFARROWSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFARROWSTYLE_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfstyle.hxx> + +class XFArrowStyle : public XFStyle +{ +public: + XFArrowStyle(); + +public: + void SetArrowName(const OUString& name); + + void SetViewbox(const OUString& viewBox); + + void SetSVGPath(const OUString& path); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + OUString m_strName; + OUString m_strViewBox; + OUString m_strPath; +}; + +inline XFArrowStyle::XFArrowStyle() +{ +} + +inline void XFArrowStyle::SetArrowName(const OUString& name) +{ + m_strName = name; +} + +inline void XFArrowStyle::SetViewbox(const OUString& viewBox) +{ + m_strViewBox = viewBox; +} + +inline void XFArrowStyle::SetSVGPath(const OUString& path) +{ + m_strPath = path; +} + +inline enumXFStyle XFArrowStyle::GetStyleFamily() +{ + return enumXFStyleArrow; +} + +inline void XFArrowStyle::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + if( !m_strName.isEmpty() ) + pAttrList->AddAttribute( "draw:name", m_strName ); + else + pAttrList->AddAttribute( "draw:name", GetStyleName() ); + + pAttrList->AddAttribute( "svg:viewBox", m_strViewBox ); + pAttrList->AddAttribute( "svg:d", m_strPath ); + pStrm->StartElement("draw:marker"); + pStrm->EndElement("draw:marker"); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfbgimage.hxx b/lotuswordpro/inc/xfilter/xfbgimage.hxx new file mode 100644 index 000000000..ea14229f4 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfbgimage.hxx @@ -0,0 +1,153 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Background image. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFBGIMAGE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFBGIMAGE_HXX + +#include <xfilter/xfstyle.hxx> + +/** + * @brief + * Background image object. + */ +class XFBGImage : public XFStyle +{ +public: + XFBGImage(); + +public: + /** + * @descr Use file link as image source. + */ + void SetFileLink(const OUString& fileName); + + /** + * @descr Use base64 stream as image source. + */ + void SetImageData(sal_uInt8 const *buf, int len); + + /** + * @descr Set the image position type. + */ + void SetPosition(enumXFAlignType horiAlign = enumXFAlignCenter, enumXFAlignType vertAlign = enumXFAlignCenter); + + /** + * @descr Set background image repeat style. + */ + void SetRepeate(); + + /** + * @descr Set whether the image should be stretched to fill the owner object. + */ + void SetStretch(); + + /** + * @descr decide whether there has been a style that is the same as this object. + * If it use base64 stream, i'll simply return sal_False because it's too slow to compare two base64 stream. + */ + virtual bool Equal(IXFStyle *pStyle) override; + + virtual void ToXml(IXFStream *pStrm) override; + + friend bool operator==(XFBGImage const & img1, XFBGImage const & img2); + friend bool operator!=(XFBGImage const & img1, XFBGImage const & img2); +private: + OUString m_strFileName; + OUString m_strData; + bool m_bUserFileLink; + bool m_bRepeate; + bool m_bStretch; + bool m_bPosition; + enumXFAlignType m_eHoriAlign; + enumXFAlignType m_eVertAlign; +}; + +inline void XFBGImage::SetFileLink(const OUString& fileName) +{ + m_strFileName = fileName; + m_bUserFileLink = true; +} + +inline void XFBGImage::SetPosition(enumXFAlignType horiAlign, enumXFAlignType vertAlign) +{ + m_bPosition = true; + m_eHoriAlign = horiAlign; + m_eVertAlign = vertAlign; + + m_bStretch = false; + m_bRepeate = false; +} + +inline void XFBGImage::SetRepeate() +{ + m_bRepeate = true; + m_bStretch = false; + m_bPosition = false; +} + +inline void XFBGImage::SetStretch() +{ + m_bStretch = true; + m_bRepeate = false; + m_bPosition = false; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfbookmark.hxx b/lotuswordpro/inc/xfilter/xfbookmark.hxx new file mode 100644 index 000000000..1dd473f94 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfbookmark.hxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Bookmark ref. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFBOOKMARK_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFBOOKMARK_HXX + +#include <sal/config.h> + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfcontent.hxx> + +/** + * @brief + * Bookmark object. + */ +class XFBookmark : public XFContent +{ +public: + explicit XFBookmark(bool isStart) + { + m_bStart = isStart; + } + + const OUString& GetDivision() const {return m_strDivision;} + void SetDivision(const OUString& sDivName){m_strDivision = sDivName;} + const OUString& GetName() const {return m_strName;} + +public: + /** + * @descr Set bookmark name, which will be used in bookmark-ref or formula. + */ + void SetName(const OUString& name) + { + m_strName = name; + } + + virtual void ToXml(IXFStream *pStrm) override + { + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + pAttrList->AddAttribute( "text:name", m_strName ); + if( m_bStart ) + { + pStrm->StartElement( "text:bookmark-start" ); + pStrm->EndElement( "text:bookmark-start" ); + } + else + { + pStrm->StartElement( "text:bookmark-end" ); + pStrm->EndElement( "text:bookmark-end" ); + } + } + +private: + bool m_bStart; + OUString m_strName; + OUString m_strDivision; +}; + +class XFBookmarkStart : public XFBookmark +{ +public: + XFBookmarkStart():XFBookmark(true){} +}; + +class XFBookmarkEnd : public XFBookmark +{ +public: + XFBookmarkEnd():XFBookmark(false){} +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfborders.hxx b/lotuswordpro/inc/xfilter/xfborders.hxx new file mode 100644 index 000000000..2f9eadf48 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfborders.hxx @@ -0,0 +1,190 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Border object,now only used by paragraph object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFBORDERS_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFBORDERS_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfdefs.hxx> + +/** + * @brief + * Single border object for all objects with borders. + */ +class XFBorder +{ +public: + XFBorder(); + +public: + /** + * @descr Set border color. + */ + void SetColor(XFColor const & color); + + /** + * @descr Set border width in cm. + */ + void SetWidth(double width); + + /** + * @descr Set whether the border has double line. + */ + void SetDoubleLine(bool dual,bool bSameWidth); + + /** + * @descr Set inner line width for border with double line. + */ + void SetWidthInner(double inner); + + /** + * @descr Set space between double lines of border. + */ + void SetWidthSpace(double space); + + /** + * @descr Set outer line width for border with double line. + */ + void SetWidthOuter(double outer); + +private: + /** + * @descr First line width to OOo border width format. + */ + OUString GetLineWidth(); + + OUString ToString(); + + friend bool operator==(XFBorder const & b1, XFBorder const & b2); + friend bool operator!=(XFBorder const & b1, XFBorder const & b2); + friend class XFBorders; + +private: + XFColor m_aColor; + bool m_bDouble; + bool m_bSameWidth; + double m_fWidthInner; + double m_fWidthSpace; + double m_fWidthOuter; +}; + +/** + * @brief + * Borders for object with borders. + * Borders may include (right,left,top,bottom) borders. + */ +class XFBorders +{ +public: + XFBorders(){} + +public: + /** + * @descr Set color of border side. + */ + void SetColor(enumXFBorder side, XFColor const & color); + + /** + * @descr Set width or border side. + */ + void SetWidth(enumXFBorder side, double width); + + /** + * @descr Set border side as double line. + */ + void SetDoubleLine(enumXFBorder side); + + /** + * @descr Set inner border with of border side. + */ + void SetWidthInner(enumXFBorder side, double inner); + + /** + * @descr Set space between two borders of border side. + */ + void SetWidthSpace(enumXFBorder side, double space); + + /** + * @descr Set outer border width of border side. + */ + void SetWidthOuter(enumXFBorder side, double outer); + + XFBorder& GetLeft() {return m_aBorderLeft;} + + XFBorder& GetRight() {return m_aBorderRight;} + + XFBorder& GetTop() {return m_aBorderTop;} + + XFBorder& GetBottom() {return m_aBorderBottom;} + + void ToXml(IXFStream *pStrm); + + friend bool operator==(XFBorders const & b1, XFBorders const & b2); + friend bool operator!=(XFBorders const & b1, XFBorders const & b2); + +private: + XFBorder m_aBorderLeft; + XFBorder m_aBorderRight; + XFBorder m_aBorderTop; + XFBorder m_aBorderBottom; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfbreaks.hxx b/lotuswordpro/inc/xfilter/xfbreaks.hxx new file mode 100644 index 000000000..fe2d7cee1 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfbreaks.hxx @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Breaks of paragraph. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFBREAKS_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFBREAKS_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfdefs.hxx> + +/** + * @descr Page|Column break object. + */ +class XFBreaks +{ +public: + XFBreaks(); + + /** + * @descr Set break type, pls refer to enumXFBreaks. + */ + void SetBreakType(enumXFBreaks breaks); + + /** + * @descr Output breaks object. + */ + void ToXml(IXFStream *pStrm); + + friend bool operator==(XFBreaks const & b1, XFBreaks const & b2); + friend bool operator!=(XFBreaks const & b1, XFBreaks const & b2); + +private: + enumXFBreaks m_eBreaks; +}; + +inline XFBreaks::XFBreaks() : m_eBreaks(enumXFBreakAuto) +{} + +inline void XFBreaks::SetBreakType(enumXFBreaks breaks) +{ + m_eBreaks = breaks; +} + +inline void XFBreaks::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + switch(m_eBreaks) + { + case enumXFBreakAuto: + break; + case enumXFBreakBefPage: + pAttrList->AddAttribute( "fo:break-before", "page" ); + break; + case enumXFBreakBefColumn: + pAttrList->AddAttribute( "fo:break-before", "column" ); + break; + case enumXFBreakAftPage: + pAttrList->AddAttribute( "fo:break-after", "page" ); + break; + case enumXFBreakAftColumn: + pAttrList->AddAttribute( "fo:break-after", "column" ); + break; + case enumXFBreakKeepWithNext: + pAttrList->AddAttribute( "fo:keep-with-next", "true" ); + break; + } +} + +inline bool operator==(XFBreaks const & b1, XFBreaks const & b2) +{ + return b1.m_eBreaks == b2.m_eBreaks; +} + +inline bool operator!=(XFBreaks const & b1, XFBreaks const & b2) +{ + return !(b1==b2); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfcell.hxx b/lotuswordpro/inc/xfilter/xfcell.hxx new file mode 100644 index 000000000..81ab8aa59 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfcell.hxx @@ -0,0 +1,194 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Table cell. + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCELL_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCELL_HXX + +#include <xfilter/xfcontent.hxx> +#include <xfilter/xfcontentcontainer.hxx> + +class XFTable; +class XFRow; + +/** + * @descr Table cell object. + */ +class XFCell : public XFContentContainer +{ +public: + XFCell(); + + virtual ~XFCell() override; + +public: + using XFContentContainer::Add; + + /** + * @descr Add content for table cell. + */ + void Add(XFContent *pContent) override; + + /** + * @descr If cell spans more the one column, then set column span. + */ + void SetColumnSpaned(sal_Int32 num); + + /** + * @descr Set whether the following cells use the same style and content. + */ + void SetRepeated(sal_Int32 num); + + /** + * @descr Set cell number value. + */ + void SetValue(double value); + + /** + * @descr Set cell number value. + */ + void SetValue(const OUString& value); + + /** + * @descr Set cell formula. + */ + void SetFormula(const OUString& formula); + + /** + * @descr Set cell protected. + */ + void SetProtect(bool protect); + + /** + * @descr Set cell column id. + */ + void SetCol(sal_Int32 col); + + /** + * @descr Set cell owner row. + */ + void SetOwnerRow(XFRow *pRow); + + /** + * @descr Return cell name. It's a tool function for formula. + */ + OUString GetCellName(); + + /** + * @descr return cell column span property. + */ + sal_Int32 GetColSpaned() const; + + /** + * @descr Output cell as xml element. + */ + virtual void ToXml(IXFStream *pStrm) override; + + const XFTable* GetSubTable() const { return m_pSubTable.get(); } + +private: + XFRow *m_pOwnerRow; + rtl::Reference<XFTable> + m_pSubTable; + sal_Int32 m_nCol; + sal_Int32 m_nColSpaned; + sal_Int32 m_nRepeated; + enumXFValueType m_eValueType; + OUString m_strValue; + OUString m_strFormula; + bool m_bProtect; +}; + +inline void XFCell::SetColumnSpaned(sal_Int32 num) +{ + m_nColSpaned = num; +} + +inline void XFCell::SetRepeated(sal_Int32 repeated) +{ + m_nRepeated = repeated; +} + +inline void XFCell::SetFormula(const OUString& formula) +{ + m_strFormula = formula; +} + +inline void XFCell::SetProtect(bool protect/* =sal_True */) +{ + m_bProtect = protect; +} + +inline void XFCell::SetCol(sal_Int32 col) +{ + m_nCol = col; +} + +inline void XFCell::SetOwnerRow(XFRow *pRow) +{ + m_pOwnerRow = pRow; +} + +inline sal_Int32 XFCell::GetColSpaned() const +{ + return m_nColSpaned; +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfcellstyle.hxx b/lotuswordpro/inc/xfilter/xfcellstyle.hxx new file mode 100644 index 000000000..ff081b58a --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfcellstyle.hxx @@ -0,0 +1,162 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Table cell style. Number format, string value, and so on... + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCELLSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCELLSTYLE_HXX + +#include <sal/config.h> + +#include <rtl/ref.hxx> + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfmargins.hxx> +#include <xfilter/xfpadding.hxx> +#include <xfilter/xfshadow.hxx> + +#include <memory> + +class XFBorders; +class XFFont; +class XFBorders; +class XFMargins; +class XFBGImage; + +/** + * @descr Style object for cell. + */ +class XFCellStyle : public XFStyle +{ +public: + XFCellStyle(); + + virtual ~XFCellStyle() override; + +public: + /** + * @descr Set cell data format style name. + */ + void SetDataStyle(const OUString& style); + + /** + * @descr: Set the padding of the paragraph.This is the distance + between the border and the top of the text. + * @param: indent value of the padding. + */ + void SetPadding(double left, double right, double top, double bottom); + + /** + * @descr: Set alignment property of the cell. + * @param: eAlign alignment type,left,right,center or justify. + */ + void SetAlignType(enumXFAlignType hori, enumXFAlignType vert); + + /** + * @descr: The borders are complex, so you have to create one before use. + Very few paragraphs will already have borders property, this way + we can save much memory. + * @param: pBorders borders of the paragraph, please reference the XFBorders. + */ + void SetBorders(XFBorders *pBorders); + + /** + * @descr: Set background color of the cell. + * @param: color value of the back color. + */ + void SetBackColor(XFColor const & color); + + /** + * descr: set cell background image. + */ + void SetBackImage(std::unique_ptr<XFBGImage>& rImage); + + virtual enumXFStyle GetStyleFamily() override; + + virtual bool Equal(IXFStyle *pStyle) override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + OUString m_strDataStyle; + enumXFAlignType m_eHoriAlign; + enumXFAlignType m_eVertAlign; + + XFColor m_aBackColor; + std::unique_ptr<XFBGImage> m_xBackImage; + XFMargins m_aMargin; + XFPadding m_aPadding; + rtl::Reference<XFFont> m_pFont; + XFShadow m_aShadow; + std::unique_ptr<XFBorders> m_pBorders; +}; + +inline void XFCellStyle::SetAlignType(enumXFAlignType hori, enumXFAlignType vert) +{ + m_eHoriAlign = hori; + m_eVertAlign = vert; +} + +inline void XFCellStyle::SetDataStyle(const OUString& style) +{ + m_strDataStyle = style; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfchange.hxx b/lotuswordpro/inc/xfilter/xfchange.hxx new file mode 100644 index 000000000..29519e847 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfchange.hxx @@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * For LWP filter architecture prototype + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCHANGE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCHANGE_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfcontent.hxx> +#include <xfilter/xfcontentcontainer.hxx> +#include <rtl/ustring.hxx> + +class XFChangeList : public XFContentContainer +{ +public: + XFChangeList(){} + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFChangeRegion : public XFContentContainer +{ +public: + XFChangeRegion(){} + virtual void ToXml(IXFStream *pStrm) override; + void SetChangeID(const OUString& sID){m_sID=sID;} + void SetEditor(const OUString& sEditor){m_sEditor=sEditor;} +protected: + OUString m_sID; + OUString m_sEditor; +}; + +class XFChangeInsert : public XFChangeRegion +{ +public: + XFChangeInsert(){} + void ToXml(IXFStream *pStrm) override; +}; + +class XFChangeDelete : public XFChangeRegion +{ +public: + XFChangeDelete(){} + void ToXml(IXFStream *pStrm) override; +}; + +class XFChangeStart : public XFContent +{ +public: + XFChangeStart(){} + void ToXml(IXFStream *pStrm) override; + void SetChangeID(const OUString& sID){m_sID=sID;} +private: + OUString m_sID; +}; + +class XFChangeEnd : public XFContent +{ +public: + XFChangeEnd(){} + void ToXml(IXFStream *pStrm) override; + void SetChangeID(const OUString& sID){m_sID=sID;} +private: + OUString m_sID; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfcolor.hxx b/lotuswordpro/inc/xfilter/xfcolor.hxx new file mode 100644 index 000000000..ffb16c3bf --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfcolor.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Color object to serial to xml filter. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCOLOR_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCOLOR_HXX + +#include <rtl/ustring.hxx> + +/** + * @brief + * Color object. + */ +class XFColor +{ +public: + XFColor():m_nRed(sal_Int8(0)),m_nGreen(sal_Int8(0)),m_nBlue(sal_Int8(0)) + { + m_bValid = false; + } + XFColor(sal_Int32 red, sal_Int32 green, sal_Int32 blue) + :m_nRed(static_cast<sal_Int8>(red)),m_nGreen(static_cast<sal_Int8>(green)),m_nBlue(static_cast<sal_Int8>(blue)) + { + m_bValid = true; + } + explicit XFColor(sal_uInt32 color) + { + unsigned int c = color&0x00ffffff; + unsigned int temp = c; + m_nRed = static_cast<sal_uInt8>(temp&0x000000ff); + + temp = c; + m_nGreen = static_cast<sal_uInt8>((temp&0x0000ff00)>>8); + + temp = c; + m_nBlue = static_cast<sal_uInt8>((temp&0x00ff0000)>>16); + + m_bValid = true; + } + + /** + * @descr helper function to assert whether a color is valid. + */ + bool IsValid() const{ return m_bValid;} + + OUString ToString ()const; + + friend bool operator==(XFColor const & c1, XFColor const & c2); + friend bool operator!=(XFColor const & c1, XFColor const & c2); +private: + sal_uInt8 m_nRed; + sal_uInt8 m_nGreen; + sal_uInt8 m_nBlue; + bool m_bValid; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfcolstyle.hxx b/lotuswordpro/inc/xfilter/xfcolstyle.hxx new file mode 100644 index 000000000..774a2e636 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfcolstyle.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Column style object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCOLSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCOLSTYLE_HXX + +#include <xfilter/xfstyle.hxx> + +/** + * @brief + * Column style, it has only one property-the column width. + */ +class XFColStyle : public XFStyle +{ +public: + XFColStyle(); + + virtual ~XFColStyle() override; + +public: + /** + * @descr Set column width. + */ + void SetWidth(double width); + + /** + * @descr return column width. + */ + double GetWidth() const; + + virtual enumXFStyle GetStyleFamily() override; + + /** + * @descr output column style as an xml node. + */ + virtual void ToXml(IXFStream *pStrm) override; + +private: + double m_fWidth; +}; + +inline void XFColStyle::SetWidth(double width) +{ + m_fWidth = width; +} + +inline double XFColStyle::GetWidth() const +{ + return m_fWidth; +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfcolumns.hxx b/lotuswordpro/inc/xfilter/xfcolumns.hxx new file mode 100644 index 000000000..fe806c9fe --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfcolumns.hxx @@ -0,0 +1,156 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Columns styles for section, or paragraph. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCOLUMNS_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCOLUMNS_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfdefs.hxx> +#include <vector> + +#define XFCOLUMNS_FLAG_SEPARATOR 0X00000001 +#define XFCOLUMNS_FLAG_GAP 0X00000010 + +/** + * @descr Columns object for page or section. + */ +class XFColumn +{ +public: + XFColumn() + : m_nRelWidth(0) + , m_fMarginLeft(0) + , m_fMarginRight(0) + {} + +public: + /** + * @descr Set column relative width. + */ + void SetRelWidth(sal_Int32 width); + + /** + * @descr Set column margin left and margin right. + */ + void SetMargins(double left, double right); + + /** + * @descr output column style as an xml node. + */ + void ToXml(IXFStream *pStrm); + + friend class XFColumns; + +private: + sal_Int32 m_nRelWidth; + double m_fMarginLeft; + double m_fMarginRight; +}; + +class XFColumnSep +{ +public: + XFColumnSep() + : m_nRelHeight(100) + , m_fWidth(0) + , m_eVertAlign(enumXFAlignMiddle) + {} +public: + void SetRelHeight(sal_Int32 height); + void SetWidth(double width); + void SetColor(XFColor const & color); + void SetVerticalAlign(enumXFAlignType align); + + void ToXml(IXFStream *pStrm); + + friend class XFColumns; +private: + sal_Int32 m_nRelHeight; + double m_fWidth; + XFColor m_aColor; + enumXFAlignType m_eVertAlign; +}; + +class XFColumns +{ +public: + XFColumns() + : m_nFlag(0) + , m_nCount(0) + , m_fGap(0.0) + { } +public: + void SetSeparator(XFColumnSep const & aSeparator); + void SetGap(double fGap); + void SetCount(sal_uInt16 nCount); + void AddColumn(XFColumn const & column); + + void ToXml(IXFStream *pStrm); +private: + sal_Int32 m_nFlag; + sal_uInt16 m_nCount; + double m_fGap; + std::vector<XFColumn> m_aColumns; + XFColumnSep m_aSeparator; + +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfconfigmanager.hxx b/lotuswordpro/inc/xfilter/xfconfigmanager.hxx new file mode 100644 index 000000000..78b5b97ba --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfconfigmanager.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Manager for all config object,include line number config. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCONFIGMANAGER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCONFIGMANAGER_HXX + +#include <xfilter/xfstylecont.hxx> +#include <xfilter/xflinenumberconfig.hxx> +#include <xfilter/xffootnoteconfig.hxx> +#include <xfilter/xfendnoteconfig.hxx> +#include <memory> + +/** + * @brief + * Config information for OOo document, ie, line count config, endnote and footnote config. + * This object should only exist one instance. + * Don't make this object a singleton because it's managed by XFStyleManager. + */ +class XFConfigManager : public XFStyleContainer +{ +public: + XFConfigManager(); + virtual ~XFConfigManager() override; + +public: + /** + * @descr Set line number config. + */ + void SetLineNumberConfig(XFLineNumberConfig *pLNConfig); + + /** + * @descr Set footnote config. + */ + void SetFootnoteConfig(XFFootnoteConfig *pFNConfig); + + /** + * @descr Set endnote config. + */ + void SetEndnoteConfig(XFEndnoteConfig *pFNConfig); + + /** + * @descr Output config information. + */ + virtual void ToXml(IXFStream *pStrm) override; + +private: + std::unique_ptr<XFLineNumberConfig> m_pLineNumberConfig; + std::unique_ptr<XFFootnoteConfig> m_pFootnoteConfig; + std::unique_ptr<XFEndnoteConfig> m_pEndnoteConfig; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfcontent.hxx b/lotuswordpro/inc/xfilter/xfcontent.hxx new file mode 100644 index 000000000..2f04906a5 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfcontent.hxx @@ -0,0 +1,124 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Base class for the all content object,ie. text,paragraph,picture,and so on. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCONTENT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCONTENT_HXX + +#include <sal/config.h> + +#include <rtl/ustring.hxx> +#include <salhelper/simplereferenceobject.hxx> +#include <stdexcept> + +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfdefs.hxx> + +class IXFStream; + +/** + * @descr + * Base class for all content object. + * There is only two properties:style name and content type in this class. + */ +class XFContent : public salhelper::SimpleReferenceObject +{ +public: + /** + * @short: return the content type. + */ + virtual enumXFContent GetContentType() { return enumXFContentUnknown; } + + /** + * @short: All content except XFTextContent can have a style. + */ + virtual void SetStyleName(const OUString& style) { m_strStyleName = style; } + + /** + * @short: return the style name. + */ + const OUString& GetStyleName() const { return m_strStyleName; } + + void DoToXml(IXFStream* stream) + { + if (m_bDoingToXml) + throw std::runtime_error("recursion in content"); + m_bDoingToXml = true; + ToXml(stream); + m_bDoingToXml = false; + } + +protected: + XFContent() + : m_bDoingToXml(false) + { + } + + virtual void ToXml(IXFStream* stream) = 0; + + virtual ~XFContent() override {} + + OUString m_strStyleName; + +private: + bool m_bDoingToXml; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfcontentcontainer.hxx b/lotuswordpro/inc/xfilter/xfcontentcontainer.hxx new file mode 100644 index 000000000..f3a843f14 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfcontentcontainer.hxx @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Container for content.It will destroy all children when destroy. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCONTENTCONTAINER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCONTENTCONTAINER_HXX + +#include <sal/config.h> + +#include <vector> + +#include <rtl/ref.hxx> + +#include <xfilter/xfcontent.hxx> + +/** + * @brief + * A container for content. + * The contents will be deleted when delete container. + */ +class XFContentContainer : public XFContent +{ +public: + XFContentContainer(); + + /** + * @descr Destructure, all contents will be deleted too. + */ + virtual ~XFContentContainer() override; + +public: + /** + * @descr Add content. + */ + virtual void Add(XFContent *pContent); + + rtl::Reference<XFContent> GetLastContent(); + void RemoveLastContent(); + /** + * @descr convenience function for add text content. + */ + void Add(const OUString& text); + + /** + * @descr return the number of contents in the container. + */ + int GetCount() const; + + /** + * @descr get content by index. + */ + rtl::Reference<XFContent> GetContent(sal_uInt32 index) const; + + /** + * @descr clear all contents in the container. + */ + void Reset(); + + /** + * @descr helper function, find first content by type. + */ + rtl::Reference<XFContent> FindFirstContent(enumXFContent type); + + /** + * @descr return the content type. + */ + virtual enumXFContent GetContentType() override; + /** + * @descr Output to OOo model or local file. + */ + virtual void ToXml(IXFStream *pStrm) override; + +private: + std::vector< rtl::Reference<XFContent> > m_aContents; +}; + +inline rtl::Reference<XFContent> XFContentContainer::GetContent(sal_uInt32 index) const +{ + if (index > m_aContents.size()-1) + return nullptr; + return m_aContents[index]; +} +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfcrossref.hxx b/lotuswordpro/inc/xfilter/xfcrossref.hxx new file mode 100644 index 000000000..9126f712b --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfcrossref.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * cross reference object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCROSSREF_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFCROSSREF_HXX + +#include <xfilter/xfcontent.hxx> + +/** + * @brief + * Index entry object. + */ +class XFCrossRefStart : public XFContent +{ +public: + XFCrossRefStart(); + virtual ~XFCrossRefStart() override; + void SetRefType(sal_uInt8 nType); + void SetMarkName(const OUString& sName); + void ToXml(IXFStream *pStrm) override; +private: + enum{ + CROSSREF_INVALID = 0, + CROSSREF_TEXT = 1, + CROSSREF_PAGE = 2, + CROSSREF_PARANUMBER = 3 + }; + sal_uInt8 m_nType; + OUString m_strMarkName; +}; + +inline void XFCrossRefStart::SetRefType(sal_uInt8 nType) +{ + m_nType = nType; +} + +inline void XFCrossRefStart::SetMarkName(const OUString& sName) +{ + m_strMarkName = sName; +} + +class XFCrossRefEnd : public XFContent +{ +public: + XFCrossRefEnd(); + virtual ~XFCrossRefEnd() override; + void ToXml(IXFStream *pStrm) override; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdate.hxx b/lotuswordpro/inc/xfilter/xfdate.hxx new file mode 100644 index 000000000..9fe3ab94c --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdate.hxx @@ -0,0 +1,96 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Date field with date style. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDATE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDATE_HXX + +#include <xfilter/xfcontent.hxx> +#include <xfilter/ixfstream.hxx> + +/** + * @descr Date object. + */ +class XFDate : public XFContent +{ +public: + XFDate(); + + virtual ~XFDate() override; + + virtual void ToXml(IXFStream* pStrm) override; + +private: + OUString m_strText; +}; + +class XFDateStart : public XFDate +{ +public: + virtual void ToXml(IXFStream* pStrm) override; +}; + +class XFDateEnd : public XFContent +{ +public: + virtual void ToXml(IXFStream* pStrm) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdatestyle.hxx b/lotuswordpro/inc/xfilter/xfdatestyle.hxx new file mode 100644 index 000000000..a1df3a5c0 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdatestyle.hxx @@ -0,0 +1,204 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Date style. The date format for date field. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDATESTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDATESTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xftimestyle.hxx> +#include <xfilter/xfstylecont.hxx> + +class XFDatePart : public XFTimePart +{ +public: + XFDatePart(); +public: + void SetTexture(bool bTexture); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + bool m_bTexture; +}; + +class XFDateStyle : public XFStyle +{ +public: + XFDateStyle(); + + virtual ~XFDateStyle() override; + +public: + void AddYear( bool bLongFmt = true ); + + void AddMonth( bool bLongFmt = true, bool bTexture = false ); + + void AddMonthDay( bool bLongFmt = true ); + + void AddWeekDay( bool bLongFmt = true ); + + void AddEra(); + + void AddHour( bool bLongFmt = true ); + + void AddMinute( bool bLongFmt = true ); + + void AddSecond( bool bLongFmt = true ); + + void AddAmPm(); + + void AddText( const OUString& part ); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + XFStyleContainer m_aParts; +}; + +inline void XFDatePart::SetTexture(bool bTexture) +{ + m_bTexture = bTexture; +} + +inline void XFDateStyle::AddYear( bool bLongFmt ) +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateYear); + part->SetLongFmt(bLongFmt); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddMonth( bool bLongFmt, bool bTexture ) +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateMonth); + part->SetLongFmt(bLongFmt); + part->SetTexture(bTexture); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddMonthDay( bool bLongFmt ) +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateMonthDay); + part->SetLongFmt(bLongFmt); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddWeekDay( bool bLongFmt ) +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateWeekDay); + part->SetLongFmt(bLongFmt); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddEra() +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateEra); + part->SetLongFmt(false); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddText( const OUString& text ) +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateText); + part->SetText(text); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddHour( bool bLongFmt ) +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateHour); + part->SetLongFmt(bLongFmt); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddMinute( bool bLongFmt ) +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateMinute); + part->SetLongFmt(bLongFmt); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddSecond( bool bLongFmt ) +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateSecond); + part->SetLongFmt(bLongFmt); + part->SetDecimalPos(0); + m_aParts.AddStyle(std::move(part)); +} + +inline void XFDateStyle::AddAmPm() +{ + std::unique_ptr<XFDatePart> part(new XFDatePart()); + part->SetPartType(enumXFDateAmPm); + m_aParts.AddStyle(std::move(part)); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdefs.hxx b/lotuswordpro/inc/xfilter/xfdefs.hxx new file mode 100644 index 000000000..0b552236a --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdefs.hxx @@ -0,0 +1,498 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * enum const defines. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDEFS_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDEFS_HXX + +enum enumXFContent +{ + enumXFContentUnknown, + enumXFContentText, + enumXFContentSpan, + enumXFContentPara, + enumXFContentHeading, + enumXFContentTable, + enumXFContentTableCell, + enumXFContentTableRow, + enumXFContentTableCol, + enumXFContentGraphics, + enumXFContentFrame, + enumXFContentContainer, +}; + +enum enumXFStyle +{ + enumXFStyleUnknown, + enumXFStyleText, + enumXFStylePara, + enumXFStyleList, + enumXFStyleSection, + enumXFStyleGraphics, + enumXFStylePageMaster, + enumXFStyleMasterPage, + enumXFStyleDate, + enumXFStyleTime, + enumXFStylePercent, + enumXFStyleNumber, + enumXFStyleCurrency, + enumXFStyleTable, + enumXFStyleTableCell, + enumXFStyleTableRow, + enumXFStyleTableCol, + enumXFStyleOutline, + enumXFStyleStrokeDash, + enumXFStyleArea, + enumXFStyleArrow, + enumXFStyleRuby, + enumXFStyleDefaultPara, +}; + +enum enumXFFrameType +{ + enumXFFrameUnknown, + enumXFFrameDrawing, + enumXFFrameImage, + enumXFFrameTextbox, +}; + +enum enumXFUnderline +{ + enumXFUnderlineNone = 0, + enumXFUnderlineSingle, + enumXFUnderlineDouble, + enumXFUnderlineDotted, + enumXFUnderlineDash, + enumXFUnderlineLongDash, + enumXFUnderlineDotDash, + enumXFUnderlineDotDotDash, + enumXFUnderlineWave, + enumXFUnderlineBold, + enumXFUnderlineBoldDotted, + enumXFUnderlineBoldDash, + enumXFUnderlineBoldLongDash, + enumXFUnderlineBoldDotDash, + enumXFUnderlineBoldDotDotDash, + enumXFUnderlineBoldWave, + enumXFUnderlineDoubleWave, + enumXFUnderlineSmallWave +}; + +enum enumXFRelief +{ + enumXFReliefNone = 0, + enumXFReliefEngraved, + enumXFReliefEmbossed, +}; + +enum enumXFCrossout +{ + enumXFCrossoutNone = 0, + enumXFCrossoutSignel, + enumXFCrossoutDouble, + enumXFCrossoutThick, + enumXFCrossoutSlash, + enumXFCrossoutX +}; + +enum enumXFTransform +{ + enumXFTransformNone = 0, + enumXFTransformUpper, + enumXFTransformLower, + enumXFTransformCapitalize, + enumXFTransformSmallCaps +}; + +enum enumXFEmphasize +{ + enumXFEmphasizeNone = 0, + enumXFEmphasizeDot, + enumXFEmphasizeCircle, + enumXFEmphasizeDisc, + enumXFEmphasizeAccent +}; + +enum enumXFAlignType +{ + enumXFAlignNone = 0, + enumXFAlignStart, + enumXFAlignCenter, + enumXFAlignEnd, + enumXFAlignJustify, + enumXFAlignTop, + enumXFAlignMiddle, + enumXFAlignBottom, + enumXFALignMargins, +}; + +enum enumXFShadowPos +{ + enumXFShadowNone, + enumXFShadowRightBottom, + enumXFShadowRightTop, + enumXFShadowLeftBottom, + enumXFShadowLeftTop +}; + +enum enumXFBorder +{ + enumXFBorderNone, + enumXFBorderLeft, + enumXFBorderRight, + enumXFBorderTop, + enumXFBorderBottom, +}; + +/************************************************************************** + * @descr + * Line height type. + * enumLHHeight: height of the line, in "cm". + * enumLHLeast: the height may be adjusted, but has a min value. + * enumLHPercent: the height is a certain times of the normal height. + * enumLHSpace: space between lines. + *************************************************************************/ +enum enumLHType +{ + enumLHNone, + enumLHHeight, + enumLHLeast, + enumLHPercent, + enumLHSpace, +}; + +enum enumXFBreaks +{ + enumXFBreakAuto, + enumXFBreakBefPage, + enumXFBreakBefColumn, + enumXFBreakAftPage, + enumXFBreakAftColumn, + enumXFBreakKeepWithNext, +}; + +enum enumXFTab +{ + enumXFTabNone, + enumXFTabLeft, + enumXFTabCenter, + enumXFTabRight, + enumXFTabChar, +}; + +enum enumXFDatePart +{ + enumXFDateUnknown, + enumXFDateYear, + enumXFDateMonth, + enumXFDateMonthDay, + enumXFDateWeekDay, + enumXFDateYearWeek, + enumXFDateEra, + enumXFDateQuarter, + enumXFDateHour, + enumXFDateMinute, + enumXFDateSecond, + enumXFDateAmPm, + enumXFDateText +}; + +enum enumXFAnchor +{ + enumXFAnchorNone, + enumXFAnchorPara, + enumXFAnchorPage, + enumXFAnchorChar, + enumXFAnchorAsChar, + enumXFAnchorFrame +}; + +enum enumXFWrap +{ + enumXFWrapNone, + enumXFWrapLeft, + enumXFWrapRight, + enumXFWrapParallel, + enumXFWrapRunThrough, + enumXFWrapBest, + enumXFWrapBackground +}; + +enum enumXFTextDir +{ + enumXFTextDirNone, + enumXFTextDirLR, + enumXFTextDirLR_TB, + enumXFTextDirPage, + enumXFTextDirRL, + enumXFTextDirRL_TB, + enumXFTextDirTB, + enumXFTextDirTB_LR, + enumXFTextDirTB_RL +}; + +enum enumXFFrameXRel +{ + enumXFFrameXRelPage, + enumXFFrameXRelPageContent, + enumXFFrameXRelPageEndMargin, + enumXFFrameXRelPageStartMargin, + enumXFFrameXRelPara, + enumXFFrameXRelParaContent, + enumXFFrameXRelParaEndMargin, + enumXFFrameXRelParaStartMargin, + enumXFFrameXRelChar, + enumXFFrameXRelFrame, + enumXFFrameXRelFrameContent, + enumXFFrameXRelFrameEndMargin, + enumXFFrameXRelFrameStartMargin +}; + +enum enumXFFrameXPos +{ + enumXFFrameXPosLeft, + enumXFFrameXPosRight, + enumXFFrameXPosCenter, + enumXFFrameXPosFromLeft +}; + +enum enumXFFrameYRel +{ + enumXFFrameYRelBaseLine, + enumXFFrameYRelChar, + enumXFFrameYRelFrame, + enumXFFrameYRelFrameContent, + enumXFFrameYRelLine, + enumXFFrameYRelPage, + enumXFFrameYRelPageContent, + enumXFFrameYRelPara, + enumXFFrameYRelParaContent, + enumXFFrameYRelText +}; + +enum enumXFFrameYPos +{ + enumXFFrameYPosTop, + enumXFFrameYPosMiddle, + enumXFFrameYPosBottom, + enumXFFrameYPosFromTop, + enumXFFrameYPosBelow, +}; + +enum enumXFTableColVisible +{ + enumXFTableColVisibleYes, + enumXFTableColVisibleCollapse, + enumXFTableColVisibleFilter, +}; + +enum enumXFBookmarkRef +{ + enumXFBookmarkNone, + enumXFBookmarkPage, + enumXFBookmarkChapter, + enumXFBookmarkDir, + enumXFBookmarkDef +}; + +enum enumXFDrawKind +{ + enumXFDrawKindFull, + enumXFDrawKindSection, + enumXFDrawKindCut, + enumXFDrawKindArc +}; + +enum enumXFLineStyle +{ + enumXFLineNone, + enumXFLineSolid, + enumXFLineDot, + enumXFLineDash, + enumXFLineDotDash, + enumXFLineDashDot +}; + +enum enumXFAreaStyle +{ + enumXFAreaNone, + enumXFAreaSolid, + enumXFAreaGradient, + enumXFAreaBitmap, + enumXFAreaHatch +}; + +enum enumXFAreaLineStyle +{ + enumXFAreaLineSingle, + enumXFAreaLineCrossed, + enumXFAreaLineTriple +}; + +enum enumXFColorMode +{ + enumXFColorStandard, + enumXFColorGreyscale, + enumXFColorMono, + enumXFColorWatermark +}; + +enum enumXFPageUsage +{ + enumXFPageUsageNone, + enumXFPageUsageAll, + enumXFPageUsageLeft, + enumXFPageUsageRight, + enumXFPageUsageMirror +}; + +enum enumXFValueType +{ + enumXFValueTypeNone, + enumXFValueTypeBoolean, + enumXFValueTypeCurrency, + enumXFValueTypeDate, + enumXFValueTypeFloat, + enumXFValueTypePercentage, + enumXFValueTypeString, + enumXFValueTypeTime, +}; + +enum enumXFNumberType +{ + enumXFNumberNumber, + enumXFNumberPercent, + enuMXFNumberCurrency, + enumXFNumberScientific, + enumXFText, +}; + +enum enumXFLineNumberPos +{ + enumXFLineNumberLeft, + enumXFLineNumberRight, + enumXFLineNumberInner, + enumXFLineNumberOuter, +}; + +enum enumXFEntry +{ + enumXFEntryTOC, + enumXFEntryAlphabetical, + enumXFEntryUserIndex, +}; + +enum enumXFIndex +{ + enumXFIndexTOC, + enumXFIndexAlphabetical, + enumXFIndexUserIndex, + enumXFIndexObject, + enumXFIndexIllustration, + enumXFIndexTableIndex, +}; + +enum enumXFIndexTemplate +{ + enumXFIndexTemplateUnknown, + enumXFIndexTemplateChapter, + enumXFIndexTemplateText, + enumXFIndexTemplateTab, + enumXFIndexTemplatePage, + enumXFIndexTemplateLinkStart, + enumXFIndexTemplateLinkEnd, + enumXFIndexTemplateSpan, + enumXFIndexTemplateBibliography, +}; + +enum enumXFRubyPosition +{ + enumXFRubyLeft = 4, + enumXFRubyRight = 5, + enumXFRubyCenter = 2, + enumXFRubyTop = 1, + enumXFRubyBottom = 3, +}; +enum enumXFFWStyle +{ + enumXFFWOff, + enumXFFWRotate, + enumXFFWUpright, + enumXFFWSlantX, //slant-x + enumXFFWSlantY //slant-y +}; + +enum enumXFFWAdjust +{ + enumXFFWAdjustAutosize, //autosize + enumXFFWAdjustLeft, + enumXFFWAdjustCenter, //center + enumXFFWAdustRight //right +}; + +enum enumXFFWShadow +{ + enumXFFWShadowNone, + enumXFFWShadowNormal, + enumXFFWShadowVertical, + enumXFFWShadowSlant +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdocfield.hxx b/lotuswordpro/inc/xfilter/xfdocfield.hxx new file mode 100644 index 000000000..6582a33dd --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdocfield.hxx @@ -0,0 +1,197 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * doc field. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDOCFIELD_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDOCFIELD_HXX + +#include <xfilter/xfcontent.hxx> + +class XFFileName : public XFContent +{ +public: + void SetType(const OUString& sType); + virtual void ToXml(IXFStream *pStrm) override; +private: + OUString m_strType; +}; +class XFWordCount : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFWordCountStart : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFWordCountEnd : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFPageCountStart : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFPageCountEnd : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFCharCount : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFCharCountStart : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFCharCountEnd : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFDescription : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFDescriptionStart : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFDescriptionEnd : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFKeywords : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFTotalEditTime : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFTotalEditTimeEnd : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFTotalEditTimeStart : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFCreateTime : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFCreateTimeStart : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFCreateTimeEnd : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFLastEditTime : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFLastEditTimeStart : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFLastEditTimeEnd : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFInitialCreator : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawgroup.hxx b/lotuswordpro/inc/xfilter/xfdrawgroup.hxx new file mode 100644 index 000000000..746b8dca2 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawgroup.hxx @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Group of drawing objects. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWGROUP_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWGROUP_HXX + +#include <xfilter/xfdrawobj.hxx> +#include <xfilter/xfframe.hxx> +#include <xfilter/xfcontentcontainer.hxx> +#include <xfilter/ixfattrlist.hxx> + +/** + * @brief + * Group object for drawing. + */ +class XFDrawGroup : public XFDrawObject +{ +public: + XFDrawGroup(){} + +public: + using XFDrawObject::Add; + + /** + * @descr Add a drawing object to the group. + */ + void Add(XFFrame *pFrame); + + /** + * @descr Output group object and all its children. + */ + virtual void ToXml(IXFStream *pStrm) override; + +private: + rtl::Reference<XFContentContainer> m_aChildren; +}; + +inline void XFDrawGroup::Add(XFFrame *pFrame) +{ + if( pFrame ) + m_aChildren->Add(pFrame); +} + +inline void XFDrawGroup::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + + pAttrList->Clear(); + XFDrawObject::ToXml(pStrm); + + pStrm->StartElement( "draw:g" ); + + m_aChildren->ToXml(pStrm); + + pStrm->EndElement( "draw:g" ); + +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawline.hxx b/lotuswordpro/inc/xfilter/xfdrawline.hxx new file mode 100644 index 000000000..5d6309b25 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawline.hxx @@ -0,0 +1,110 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Line object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWLINE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWLINE_HXX + +#include <xfilter/xfdrawobj.hxx> +#include <xfilter/xfpoint.hxx> + +/** + * @brief + * Line object of drawing layer. + */ +class XFDrawLine : public XFDrawObject +{ +public: + XFDrawLine(); + +public: + /** + * @descr Set line start point. + */ + void SetStartPoint(double x, double y); + + /** + * @descr Set line end point. + */ + void SetEndPoint(double x, double y); + + /** + * @descr Output line object. + */ + virtual void ToXml(IXFStream* pStrm) override; + +private: + XFPoint m_aPoint1; + XFPoint m_aPoint2; +}; + +inline void XFDrawLine::SetStartPoint(double x, double y) +{ + m_aPoint1.SetX(x); + m_aPoint1.SetY(y); +} + +inline void XFDrawLine::SetEndPoint(double x, double y) +{ + m_aPoint2.SetX(x); + m_aPoint2.SetY(y); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawlinestyle.hxx b/lotuswordpro/inc/xfilter/xfdrawlinestyle.hxx new file mode 100644 index 000000000..5dae0ccd4 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawlinestyle.hxx @@ -0,0 +1,215 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Line style of Drawing object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWLINESTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWLINESTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfcolor.hxx> + +/** + * @brief + * Border line style for drawing object. + */ +class XFDrawLineStyle : public XFStyle +{ +public: + XFDrawLineStyle(); + +public: + /** + * @descr Set line width. + */ + void SetWidth(double width); + + /** + * @descr Set line color. + */ + void SetColor(const XFColor& color); + + /** + * @descr Set line transparency. + */ + void SetTransparency(sal_Int32 transparency); + + /** + * @descr Set line type, solid,dash,dot? + */ + void SetLineStyle(enumXFLineStyle style); + + /** + * @descr Set first dot number of dash line. + */ + void SetDot1Number(sal_Int32 number); + + /** + * @descr Set second dot number of dash line. + */ + void SetDot2Number(sal_Int32 number); + + /** + * @descr Set first dot length. + */ + void SetDot1Length(double length); + + /** + * @descr Set second dot length. + */ + void SetDot2Length(double length); + + /** + * @descr Set space between dash dot. + */ + void SetSpace(double space); + + /** + * @descr decide whether it's a solid line. + */ + bool IsSolid() const; + + double GetWidth() const; + + const XFColor& GetColor() const; + + sal_Int32 GetTransparency() const; + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + enumXFLineStyle m_eLineStyle; + XFColor m_aColor; + double m_fWidth; + sal_Int32 m_nTransparency; + sal_Int32 m_nNumber1; + sal_Int32 m_nNumber2; + double m_fSpace; + double m_fLength1; + double m_fLength2; +}; + +inline void XFDrawLineStyle::SetWidth(double width) +{ + m_fWidth = width; +} + +inline void XFDrawLineStyle::SetColor(const XFColor& color) +{ + m_aColor = color; +} + +inline void XFDrawLineStyle::SetTransparency(sal_Int32 transparency) +{ + m_nTransparency = transparency; +} + +inline void XFDrawLineStyle::SetLineStyle(enumXFLineStyle style) +{ + m_eLineStyle = style; +} + +inline void XFDrawLineStyle::SetDot1Number(sal_Int32 number) +{ + m_nNumber1 = number; +} + +inline void XFDrawLineStyle::SetDot2Number(sal_Int32 number) +{ + m_nNumber2 = number; +} + +inline void XFDrawLineStyle::SetDot1Length(double length) +{ + m_fLength1 = length; +} + +inline void XFDrawLineStyle::SetDot2Length(double length) +{ + m_fLength2 = length; +} + +inline void XFDrawLineStyle::SetSpace(double space) +{ + m_fSpace = space; +} + +inline bool XFDrawLineStyle::IsSolid() const +{ + return (m_eLineStyle==enumXFLineSolid); +} + +inline double XFDrawLineStyle::GetWidth() const +{ + return m_fWidth; +} + +inline const XFColor& XFDrawLineStyle::GetColor() const +{ + return m_aColor; +} + +inline sal_Int32 XFDrawLineStyle::GetTransparency() const +{ + return m_nTransparency; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawobj.hxx b/lotuswordpro/inc/xfilter/xfdrawobj.hxx new file mode 100644 index 000000000..c18058ade --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawobj.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Interface for all Drawing object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWOBJ_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWOBJ_HXX + +#include <xfilter/xfglobal.hxx> +#include <xfilter/xfframe.hxx> + +#define XFDRAWOBJECT_FLAG_ROTATE 0X00000001 +#define XFDRAWOBJECT_FLAG_TRANSLATE 0X00000002 +#define XFDRAWOBJECT_FLAG_SKEWX 0X00000004 +#define XFDRAWOBJECT_FLAG_SKEWY 0X00000008 +#define XFDRAWOBJECT_FLAG_SCALE 0X00000010 + +/** + * @brief + * Base class for all drawing object(ellipse,rect,circle,...). + * I can set Positions,anchor,rotate,text style name here. + * + * Drawing objects can be rotated, scaled and skewed, drawing objects must have positions set, + * you can use SetPosition(...). + */ +class XFDrawObject : public XFFrame +{ +public: + XFDrawObject(); + +public: + /** + * @descr Set drawing object rotate. + */ + void SetRotate(double degree) + { + m_nDrawFlag |= XFDRAWOBJECT_FLAG_ROTATE; + m_fRotate = degree*2*PI/360; + m_aRotatePoint = XFPoint(0,0); + } + + void ContentToXml(IXFStream *pStrm); + + virtual void ToXml(IXFStream *pStrm) override; + +protected: + double m_fRotate; + XFPoint m_aRotatePoint; + unsigned int m_nDrawFlag; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawpath.hxx b/lotuswordpro/inc/xfilter/xfdrawpath.hxx new file mode 100644 index 000000000..c18c07eb1 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawpath.hxx @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Draw path object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWPATH_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWPATH_HXX + +#include <xfilter/xfdrawobj.hxx> +#include <vector> + +/** + * @brief + * SVG path segment wrapper. + */ +class XFSvgPathEntry +{ +public: + XFSvgPathEntry(); + +public: + /** + * @descr Set svg path command,L for line,M for move,... + */ + void SetCommand(const OUString& cmd); + + /** + * @descr Set svg path point. + */ + void AddPoint(const XFPoint& pt) + { + m_aPoints.push_back(pt); + } + + OUString ToString(); + + friend class XFDrawPath; +private: + OUString m_strCommand; + std::vector<XFPoint> m_aPoints; +}; + +/** + * @brief + * For svg path wrapper. + */ +class XFDrawPath : public XFDrawObject +{ +public: + XFDrawPath(); + +public: + /** + * @descr Move command. + */ + void MoveTo(XFPoint pt); + + /** + * @descr Line command. + */ + void LineTo(XFPoint pt); + + /** + * @descr Curve command. + */ + void CurveTo(XFPoint dest, XFPoint ctrl1, XFPoint ctrl2); + + /** + * @descr Close path command. + */ + void ClosePath(); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + std::vector<XFSvgPathEntry> m_aPaths; +}; + +inline void XFSvgPathEntry::SetCommand(const OUString& cmd) +{ + m_strCommand = cmd; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawpolygon.hxx b/lotuswordpro/inc/xfilter/xfdrawpolygon.hxx new file mode 100644 index 000000000..8a04c1d61 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawpolygon.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Polygon object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWPOLYGON_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWPOLYGON_HXX + +#include <xfilter/xfdrawpolyline.hxx> + +/** + * @brief + * Polygon object. + */ +class XFDrawPolygon : public XFDrawPolyline +{ +public: + XFDrawPolygon(); + +public: + virtual void ToXml(IXFStream* pStrm) override; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawpolyline.hxx b/lotuswordpro/inc/xfilter/xfdrawpolyline.hxx new file mode 100644 index 000000000..4e7ff34c7 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawpolyline.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Polyline. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWPOLYLINE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWPOLYLINE_HXX + +#include <xfilter/xfdrawobj.hxx> +#include <vector> + +class XFDrawPolyline : public XFDrawObject +{ +public: + XFDrawPolyline(); + +public: + void AddPoint(double x, double y) + { + assert(x>=0&&y>=0); + m_aPoints.push_back( XFPoint(x,y) ); + } + + XFRect CalcViewBox(); + + virtual void ToXml(IXFStream *pStrm) override; + +protected: + std::vector<XFPoint> m_aPoints; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawrect.hxx b/lotuswordpro/inc/xfilter/xfdrawrect.hxx new file mode 100644 index 000000000..e6036a9fa --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawrect.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Rect object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWRECT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWRECT_HXX + +#include <xfilter/xfdrawobj.hxx> + +class XFDrawRect : public XFDrawObject +{ +public: + XFDrawRect(); + +public: + void SetStartPoint(const XFPoint& pt) + { + m_aRect.SetStartPoint(pt); + } + + void SetSize(double width, double height); + + virtual void ToXml(IXFStream *pStrm) override; +}; + +inline void XFDrawRect::SetSize(double width, double height) +{ + m_aRect.SetSize(width,height); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdrawstyle.hxx b/lotuswordpro/inc/xfilter/xfdrawstyle.hxx new file mode 100644 index 000000000..c6747729d --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdrawstyle.hxx @@ -0,0 +1,152 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Style for all draw object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDRAWSTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfcolor.hxx> +#include <cassert> +#include <memory> + +class XFDrawLineStyle; +class XFDrawAreaStyle; +class XFFontWorkStyle; + +/** + * @brief + * Style for all drawing object, which can includes line style, area style, wrap style. + * Line style includes line type, line width and line color. + * Area style can be divided into 5 kinds, color fill, hatch, bitmap, gradient.I only support + * color fill and hatch now. + */ +class XFDrawStyle : public XFStyle +{ +public: + XFDrawStyle(); + + virtual ~XFDrawStyle() override; + +public: + /** + * @descr Set drawing object border line. + */ + void SetLineStyle(double width, XFColor color); + + /** + * @descr Set drawing object dash border style. + */ + void SetLineDashStyle(enumXFLineStyle style, double len1, double len2, double space ); + + /** + * @descr Set drawing object area fill color. + */ + void SetAreaColor(XFColor const & color); + + /** + * @descr Set drawing object area grid style. + */ + void SetAreaLineStyle(enumXFAreaLineStyle style, sal_Int32 angle, double space, XFColor lineColor); + + /** + * @descr Set drawing object arrow start style,only lines can have arrows. + */ + void SetArrowStart(const OUString& start, double size); + + /** + * @descr Set drawing object arrow end style,only lines can have arrows. + */ + void SetArrowEnd(const OUString& end, double size); + + void SetFontWorkStyle(enumXFFWStyle eStyle, enumXFFWAdjust eAdjust); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + std::unique_ptr<XFFontWorkStyle> m_pFontWorkStyle; + XFDrawLineStyle *m_pLineStyle; + XFDrawAreaStyle *m_pAreaStyle; + OUString m_strArrowStart; + OUString m_strArrowEnd; + double m_fArrowStartSize; + double m_fArrowEndSize; + bool m_bArrowStartCenter; + bool m_bArrowEndCenter; +}; + +inline void XFDrawStyle::SetArrowStart(const OUString& start, double size) +{ + assert(size>0); + m_strArrowStart = start; + m_fArrowStartSize = size; + m_bArrowStartCenter = true; +} + +inline void XFDrawStyle::SetArrowEnd(const OUString& end, double size) +{ + assert(size>0); + m_strArrowEnd = end; + m_fArrowEndSize = size; + m_bArrowEndCenter = true; +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfdropcap.hxx b/lotuswordpro/inc/xfilter/xfdropcap.hxx new file mode 100644 index 000000000..eb5fb992e --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfdropcap.hxx @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Drop cap of a paragraph. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDROPCAP_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFDROPCAP_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/ixfstream.hxx> +class XFDropcap +{ +public: + XFDropcap() + { + Reset(); + } + +public: + void SetCharCount(sal_Int32 count); + + void SetLines(sal_Int32 lines); + + void SetDistance(double distance); + + void Reset(); + + void ToXml(IXFStream *pStrm); + + friend bool operator==(XFDropcap const & dc1, XFDropcap const & dc2); + friend bool operator!=(XFDropcap const & dc1, XFDropcap const & dc2); + friend class XFParaStyle; +private: + sal_Int32 m_nCharCount; + sal_Int32 m_nLines; + double m_fDistance; + OUString m_strStyleName; +}; + +inline void XFDropcap::SetCharCount(sal_Int32 count) +{ + m_nCharCount = count; +} + +inline void XFDropcap::SetLines(sal_Int32 lines) +{ + m_nLines = lines; +} + +inline void XFDropcap::SetDistance(double distance) +{ + m_fDistance = distance; +} + +inline void XFDropcap::Reset() +{ + m_nCharCount = 0; + m_nLines = 0; + m_fDistance = 0; + m_strStyleName.clear(); +} + +inline void XFDropcap::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + if( m_nCharCount < 1 || m_nLines < 2 ) + return; + pAttrList->AddAttribute("style:length", OUString::number(m_nCharCount) ); + pAttrList->AddAttribute("style:lines", OUString::number(m_nLines) ); + pAttrList->AddAttribute("style:distance", OUString::number(m_fDistance) + "cm" ); + if( !m_strStyleName.isEmpty() ) + pAttrList->AddAttribute("style:style-name", m_strStyleName ); + pStrm->StartElement( "style:drop-cap" ); + pStrm->EndElement( "style:drop-cap" ); +} + +inline bool operator==(XFDropcap const & dc1, XFDropcap const & dc2) +{ + return ( + (dc1.m_nCharCount == dc2.m_nCharCount)&& + (dc1.m_nLines == dc2.m_nLines)&& + (dc1.m_fDistance == dc2.m_fDistance)&& + (dc1.m_strStyleName == dc2.m_strStyleName) + ); +} + +inline bool operator!=(XFDropcap const & dc1, XFDropcap const & dc2) +{ + return !(dc1==dc2); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfendnote.hxx b/lotuswordpro/inc/xfilter/xfendnote.hxx new file mode 100644 index 000000000..98bb28090 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfendnote.hxx @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * End note object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFENDNOTE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFENDNOTE_HXX + +#include <xfilter/xfglobal.hxx> +#include <xfilter/xfcontentcontainer.hxx> +#include <xfilter/ixfattrlist.hxx> + +/** + * @brief + * End note object. + */ +class XFEndNote : public XFContentContainer +{ +public: + XFEndNote(); + +public: + virtual void ToXml(IXFStream *pStrm) override; + +private: + OUString m_strID; + OUString m_strLabel; +}; + +inline XFEndNote::XFEndNote() +{ + m_strID = XFGlobal::GenNoteName(); +} + + +inline void XFEndNote::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + pAttrList->AddAttribute( "text:id", m_strID ); + pStrm->StartElement( "text:endnote" ); + + pAttrList->Clear(); + if( !m_strLabel.isEmpty() ) + pAttrList->AddAttribute( "text:label", m_strLabel ); + pStrm->StartElement( "text:endnote-citation" ); + if( !m_strLabel.isEmpty()) + pStrm->Characters(m_strLabel); + pStrm->EndElement( "text:endnote-citation" ); + + pAttrList->Clear(); + pStrm->StartElement( "text:endnote-body" ); + XFContentContainer::ToXml(pStrm); + pStrm->EndElement( "text:endnote-body" ); + + pStrm->EndElement( "text:endnote" ); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfendnoteconfig.hxx b/lotuswordpro/inc/xfilter/xfendnoteconfig.hxx new file mode 100644 index 000000000..886a44e9f --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfendnoteconfig.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Endnote config. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFENDNOTECONFIG_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFENDNOTECONFIG_HXX + +#include <xfilter/xffootnoteconfig.hxx> + +class XFEndnoteConfig : public XFFootnoteConfig +{ +public: + XFEndnoteConfig() + : XFFootnoteConfig() + { + m_bIsFootnote = false; + m_bInsertInPage = false; + m_strDefaultStyle = "Endnote"; + m_strMasterPage = "Endnote"; + m_strCitationStyle = "Endnote Symbol"; + m_strBodyStyle = "Endnote anchor"; + } +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfentry.hxx b/lotuswordpro/inc/xfilter/xfentry.hxx new file mode 100644 index 000000000..6f7f97430 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfentry.hxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * index entry object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFENTRY_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFENTRY_HXX + +#include <xfilter/xfcontent.hxx> + +/** + * @brief + * Index entry object. + */ +class XFEntry : public XFContent +{ +public: + XFEntry(); + +public: + /** + * @descr Set entry type. + */ + void SetEntryType(enumXFEntry type); + + /** + * @descr Set entry string value. + */ + void SetStringValue(const OUString& value); + + /** + * @descr Set entry key. The keys is available only for enumXFEntryAlphabetical. + */ + void SetKey(const OUString& key1, const OUString& key2); + + /** + * @descr Set outline level. This is available for enumXFEntryTOC and enumXFEntryUserIndex. + */ + void SetOutlineLevel(sal_Int32 level); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + enumXFEntry m_eType; + OUString m_strValue; + OUString m_strKey1; + OUString m_strKey2; + OUString m_strName; + sal_Int32 m_nOutlineLevel; +}; + +inline void XFEntry::SetEntryType(enumXFEntry type) +{ + m_eType = type; +} + +inline void XFEntry::SetStringValue(const OUString& value) +{ + m_strValue = value; +} + +inline void XFEntry::SetKey(const OUString& key1, const OUString& key2) +{ + m_strKey1 = key1; + m_strKey2 = key2; +} + +inline void XFEntry::SetOutlineLevel(sal_Int32 level) +{ + m_nOutlineLevel = level; +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xffloatframe.hxx b/lotuswordpro/inc/xfilter/xffloatframe.hxx new file mode 100644 index 000000000..e6b973d01 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xffloatframe.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Float frame whose anchor is page. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFLOATFRAME_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFLOATFRAME_HXX + +#include <xfilter/xfframe.hxx> + +/** + * @brief + * Floating frame on any page. + * You can specify it to be on all pages, on odd pages, or on even pages. + */ +class XFFloatFrame : public XFFrame +{ +public: + + /** + * @descr output range: [start,end], not [start,end). + */ + XFFloatFrame(sal_Int32 start, sal_Int32 end, bool all); + +public: + void ToXml(IXFStream *pStrm) override; + +private: + sal_Int32 m_nStart; + sal_Int32 m_nEnd; + bool m_bAll; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xffont.hxx b/lotuswordpro/inc/xfilter/xffont.hxx new file mode 100644 index 000000000..f6b394e07 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xffont.hxx @@ -0,0 +1,418 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Font object to serial to xml filter. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFONT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFONT_HXX + +#include <sal/config.h> + +#include <salhelper/simplereferenceobject.hxx> + +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfdefs.hxx> + +#define XFFONT_FLAG_NAME 0X00000001 +#define XFFONT_FLAG_NAME_ASIA 0X00000002 +#define XFFONT_FLAG_NAME_COMPLEX 0X00000004 + +#define XFFONT_FLAG_SIZE 0X00000008 +#define XFFONT_FLAG_SIZE_ASIA 0X00000010 +#define XFFONT_FLAG_SIZE_COMPLEX 0X00000020 + +#define XFFONT_FLAG_ITALIC 0X00000040 +#define XFFONT_FLAG_ITALIC_ASIA 0X00000080 +#define XFFONT_FLAG_ITALIC_COMPLEX 0X00000100 + +#define XFFONT_FLAG_BOLD 0X00000200 +#define XFFONT_FLAG_BOLD_ASIA 0X00000400 +#define XFFONT_FLAG_BOLD_COMPLEX 0X00000800 + +#define XFFONT_FLAG_UNDERLINE 0X00001000 +#define XFFONT_FLAG_UNDERLINECOLOR 0X00002000 + +#define XFFONT_FLAG_POSITION 0X00004000 +#define XFFONT_FLAG_SCALE 0X00008000 +#define XFFONT_FLAG_CHARSPACE 0x00010000 + +#define XFFONT_FLAG_COLOR 0x00020000 +#define XFFONT_FLAG_BGCOLOR 0x00040000 + +#define XFFONT_FLAG_CROSSOUT 0x00080000 +#define XFFONT_FLAG_RELIEF 0x00100000 +#define XFFONT_FLAG_TRANSFORM 0x00200000 +#define XFFONT_FLAG_EMPHASIZE 0x00400000 +#define XFFONT_FLAG_OUTLINE 0x00800000 +#define XFFONT_FLAG_SHADOW 0x01000000 +#define XFFONT_FLAG_BLINK 0x02000000 +#define XFFONT_FLAG_WIDTHSCALE 0x04000000 + +/** + * @descr + * The font struct of openoffice xml filter. + * There should be some basic members,ie: + + * font name + * font family + * font size + * font italic + * font bold + * font underline + * font underline color + */ +class XFFont: public salhelper::SimpleReferenceObject +{ +public: + XFFont(); + +public: + /** + * @descr Set font name. + */ + void SetFontName(const OUString& name); + + /** + * @descr Set font name for asia locale. + */ + void SetFontNameAsia(const OUString& name); + + /** + * @descr Set font name for BIDI locale. + */ + void SetFontNameComplex(const OUString& name); + + /** + * @descr Set font size. + */ + void SetFontSize(sal_Int16 size); + + /** + * @descr Set font size for asia locale. + */ + void SetFontSizeAsia(sal_Int16 size); + + /** + * @descr Set font size for BIDI locale. + */ + void SetFontSizeComplex(sal_Int16 size); + + /** + * @descr Set whether font is italic. + */ + void SetItalic(bool italic); + + /** + * @descr Set whether font is italic for asia locale. + */ + void SetItalicAsia(bool italic); + + /** + * @descr Set whether font is italic for BIDI locale. + */ + void SetItalicComplex(bool italic); + + /** + * @descr Set font bold. + */ + void SetBold(bool bold); + + /** + * @descr Set font bold for asia locale. + */ + void SetBoldAsia(bool bold); + + /** + * @descr Set font bold for complex locale. + */ + void SetBoldComplex(bool bold); + + /** + * @descr Set underline style. + */ + void SetUnderline(enumXFUnderline underline,bool wordByWord=false); + + /** + * @descr Set crossout. + */ + void SetCrossout(enumXFCrossout cross); + + /** + * @descr Set font transform type,pls refer to enumXFTransform. + */ + void SetTransform(enumXFTransform transform); + + /** + * @descr Set upper script or lower script. + */ + void SetPosition(bool bUpperScript = true, sal_Int16 pos = 33, sal_Int16 scale = 58); + + /** + * @descr Set font color. + */ + void SetColor(XFColor const & color); + + /** + * @descr Set font background color. + */ + void SetBackColor(XFColor const & color); + void SetBackColorTransparent(); + + //getter: + enumXFTransform GetTransform() const; + + sal_Int16 GetFontSize() const; + const XFColor& GetColor() const; + + void ToXml(IXFStream *pStrm); + + friend bool operator==(XFFont const & f1, XFFont const & f2); + friend bool operator!=(XFFont const & f1, XFFont const & f2); + friend class XFFontFactory; +private: + virtual ~XFFont() override {} + + OUString m_strFontName; + OUString m_strFontNameAsia; + OUString m_strFontNameComplex; + sal_Int16 m_nFontSize; + sal_Int16 m_nFontSizeAsia; + sal_Int16 m_nFontSizeComplex; + bool m_bItalic; + bool m_bItalicAsia; + bool m_bItalicComplex; + bool m_bBold; + bool m_bBoldAsia; + bool m_bBoldComplex; + XFColor m_aUnderlineColor; + + enumXFUnderline m_eUnderline; + enumXFCrossout m_eCrossout; + enumXFTransform m_eTransform; + bool m_bWordByWord; + sal_Int16 m_nPosition; + sal_Int16 m_nScale; + XFColor m_aColor; + XFColor m_aBackColor; + //The flag defines which variable will be functional + sal_uInt32 m_nFlag; + bool m_bTransparent; +}; + +inline void XFFont::SetFontName(const OUString& name) +{ + m_strFontName = name; + m_nFlag |= XFFONT_FLAG_NAME; + + SetFontNameAsia(name); + SetFontNameComplex(name); +} + +inline void XFFont::SetFontNameAsia(const OUString& name) +{ + m_strFontNameAsia = name; + m_nFlag |= XFFONT_FLAG_NAME_ASIA; +} + +inline void XFFont::SetFontNameComplex(const OUString& name) +{ + m_strFontNameComplex = name; + m_nFlag |= XFFONT_FLAG_NAME_COMPLEX; +} + +inline void XFFont::SetFontSize(sal_Int16 size) +{ + m_nFontSize = size; + m_nFlag |= XFFONT_FLAG_SIZE; + + SetFontSizeAsia(size); + SetFontSizeComplex(size); +} + +inline void XFFont::SetFontSizeAsia(sal_Int16 size) +{ + m_nFontSizeAsia = size; + m_nFlag |= XFFONT_FLAG_SIZE_ASIA; +} + +inline void XFFont::SetFontSizeComplex(sal_Int16 size) +{ + m_nFontSizeComplex = size; + m_nFlag |= XFFONT_FLAG_SIZE_COMPLEX; +} + +//---------Italic: +inline void XFFont::SetItalic(bool italic) +{ + m_bItalic = italic; + m_nFlag |= XFFONT_FLAG_ITALIC; + + SetItalicAsia(italic); + SetItalicComplex(italic); +} + +inline void XFFont::SetItalicAsia(bool italic) +{ + m_bItalicAsia = italic; + m_nFlag |= XFFONT_FLAG_ITALIC_ASIA; +} + +inline void XFFont::SetItalicComplex(bool italic) +{ + m_bItalicComplex = italic; + m_nFlag |= XFFONT_FLAG_ITALIC_COMPLEX; +} + +//--------Bold +inline void XFFont::SetBold(bool bold) +{ + m_bBold = bold; + m_nFlag |= XFFONT_FLAG_BOLD; + SetBoldAsia(bold); + SetBoldComplex(bold); +} + +inline void XFFont::SetBoldAsia(bool bold) +{ + m_bBoldAsia = bold; + m_nFlag |= XFFONT_FLAG_BOLD_ASIA; +} + +inline void XFFont::SetBoldComplex(bool bold) +{ + m_bBoldComplex = bold; + m_nFlag |= XFFONT_FLAG_BOLD_COMPLEX; +} + +//--------Underline: +inline void XFFont::SetUnderline(enumXFUnderline underline, bool wordByWord) +{ + m_eUnderline = underline; + m_bWordByWord = wordByWord; + m_nFlag |= XFFONT_FLAG_UNDERLINE; +} + +inline void XFFont::SetCrossout(enumXFCrossout cross) +{ + m_eCrossout = cross; + m_bWordByWord = false; + m_nFlag |= XFFONT_FLAG_CROSSOUT; +} + +inline void XFFont::SetTransform(enumXFTransform transform) +{ + m_eTransform = transform; + m_nFlag |= XFFONT_FLAG_TRANSFORM; +} + +inline void XFFont::SetPosition(bool bUpperScript, sal_Int16 pos, sal_Int16 scale) +{ + assert(pos>=0&&pos<=100); + assert(scale>0&&scale<=100); + m_nFlag |= XFFONT_FLAG_POSITION; + m_nPosition = pos; + m_nScale = scale; + if( bUpperScript ) + { + if( m_nPosition <0 ) + m_nPosition = -m_nPosition; + } + else + { + if( m_nPosition >0 ) + m_nPosition = -m_nPosition; + } +} + +inline void XFFont::SetColor(XFColor const & color) +{ + m_nFlag |= XFFONT_FLAG_COLOR; + m_aColor = color; +} + +inline void XFFont::SetBackColor(XFColor const & color) +{ + m_bTransparent = false; + m_nFlag |= XFFONT_FLAG_BGCOLOR; + m_aBackColor = color; +} + +inline void XFFont::SetBackColorTransparent() +{ + m_bTransparent = true; + m_nFlag |= XFFONT_FLAG_BGCOLOR; +} + +inline enumXFTransform XFFont::GetTransform() const +{ + return m_eTransform; +} + +inline sal_Int16 XFFont::GetFontSize() const +{ + return m_nFontSize; +} + +inline const XFColor& XFFont::GetColor() const +{ + return m_aColor; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xffontdecl.hxx b/lotuswordpro/inc/xfilter/xffontdecl.hxx new file mode 100644 index 000000000..18845f50a --- /dev/null +++ b/lotuswordpro/inc/xfilter/xffontdecl.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Font declaration for OOo xml file.This is needed for every font that was + * used. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFONTDECL_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFONTDECL_HXX + +#include <rtl/ustring.hxx> + +/** + * @brief + * Font declaration in OOo xml file. + * Each font used should be declared. + */ +class XFFontDecl +{ +public: + XFFontDecl(const OUString& name, const OUString& family); + +public: + /** + * @descr Get font name. + */ + const OUString& GetFontName() const { return m_strFontName;} + + /** + * @descr Get font family. + */ + const OUString& GetFontFamily() const { return m_strFontFamily;} + +private: + OUString m_strFontName; + OUString m_strFontFamily; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xffontfactory.hxx b/lotuswordpro/inc/xfilter/xffontfactory.hxx new file mode 100644 index 000000000..04ecffa0d --- /dev/null +++ b/lotuswordpro/inc/xfilter/xffontfactory.hxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Factory object for XFFont.It also manages all font life cycle. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFONTFACTORY_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFONTFACTORY_HXX + +#include <sal/config.h> + +#include <rtl/ref.hxx> + +#include <xfilter/xffont.hxx> +#include <vector> + +/** + * @brief + * Font factory. + * Because font object are so used so often, so make a factory to manager them. + * The fonts with same properties will only exist one instance. + */ +class XFFontFactory +{ +public: + XFFontFactory(); + ~XFFontFactory(); + XFFontFactory(const XFFontFactory&) = delete; + XFFontFactory& operator=(XFFontFactory const&) = delete; + +private: + /** + * @descr Add a font. if there exist a font with same properties with pFont, them the font object + * will not be added. + */ + void AddFont(rtl::Reference<XFFont> const& pFont); + + /** + * @descr Find whether same font object exists. + */ + rtl::Reference<XFFont> FindSameFont(rtl::Reference<XFFont> const& pFont); + + friend class XFStyleContainer; + +private: + std::vector<rtl::Reference<XFFont>> s_aFonts; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xffooter.hxx b/lotuswordpro/inc/xfilter/xffooter.hxx new file mode 100644 index 000000000..30deea07a --- /dev/null +++ b/lotuswordpro/inc/xfilter/xffooter.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Footer object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTER_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfcontentcontainer.hxx> + +/** + * @descr Foot object. It's just a container. + */ +class XFFooter : public XFContentContainer +{ +public: + XFFooter() + { + } + virtual void ToXml(IXFStream *pStrm) override + { + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + pStrm->StartElement( "style:footer" ); + XFContentContainer::ToXml(pStrm); + pStrm->EndElement( "style:footer" ); + } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xffooterstyle.hxx b/lotuswordpro/inc/xfilter/xffooterstyle.hxx new file mode 100644 index 000000000..ecddefcaa --- /dev/null +++ b/lotuswordpro/inc/xfilter/xffooterstyle.hxx @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Footer style,exist in page-master object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTERSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTERSTYLE_HXX + +#include <xfilter/xfheaderstyle.hxx> +#include <xfilter/xfmargins.hxx> + +class XFFooterStyle : public XFHeaderStyle +{ +public: + XFFooterStyle() : XFHeaderStyle(true) + { + } + + void SetMargins(double left, double right, double top) + { + if( left != -1 ) + m_aMargin.SetLeft(left); + if( right != -1 ) + m_aMargin.SetRight(right); + if( top != -1 ) + m_aMargin.SetTop(top); + } +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xffootnote.hxx b/lotuswordpro/inc/xfilter/xffootnote.hxx new file mode 100644 index 000000000..76f26c83e --- /dev/null +++ b/lotuswordpro/inc/xfilter/xffootnote.hxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Foot note object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTNOTE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTNOTE_HXX + +#include <xfilter/xfglobal.hxx> +#include <xfilter/xfcontentcontainer.hxx> +#include <xfilter/ixfattrlist.hxx> + +/** + * @brief + * Foot note object. + * Foot note has a label, which is used in page content, and footnote contents in the footnote section. + */ +class XFFootNote : public XFContentContainer +{ +public: + XFFootNote(); + +public: + virtual void ToXml(IXFStream *pStrm) override; + +private: + OUString m_strID; + OUString m_strLabel; +}; + +inline XFFootNote::XFFootNote() +{ + m_strID = XFGlobal::GenNoteName(); +} + + +inline void XFFootNote::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + pAttrList->AddAttribute( "text:id", m_strID ); + pStrm->StartElement( "text:footnote" ); + + pAttrList->Clear(); + if( !m_strLabel.isEmpty() ) + pAttrList->AddAttribute( "text:label", m_strLabel ); + pStrm->StartElement( "text:footnote-citation" ); + if( !m_strLabel.isEmpty() ) + pStrm->Characters(m_strLabel); + pStrm->EndElement( "text:footnote-citation" ); + + pAttrList->Clear(); + pStrm->StartElement( "text:footnote-body" ); + XFContentContainer::ToXml(pStrm); + pStrm->EndElement( "text:footnote-body" ); + + pStrm->EndElement( "text:footnote" ); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xffootnoteconfig.hxx b/lotuswordpro/inc/xfilter/xffootnoteconfig.hxx new file mode 100644 index 000000000..b24b3c2ac --- /dev/null +++ b/lotuswordpro/inc/xfilter/xffootnoteconfig.hxx @@ -0,0 +1,225 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Footnote config. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTNOTECONFIG_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFOOTNOTECONFIG_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfstyle.hxx> + +class XFFootnoteConfig : public XFStyle +{ +public: + XFFootnoteConfig(); + +public: + void SetMasterPage(const OUString& masterPage); + + void SetStartValue(sal_Int32 value); + + void SetRestartOnPage(); + + void SetNumPrefix(const OUString& numprefix); + + void SetNumSuffix(const OUString& numsuffix); + + void SetMessageOn(const OUString& message); + + void SetMessageFrom(const OUString& message); + + virtual void ToXml(IXFStream *pStrm) override; + +protected: + OUString m_strBodyStyle; + OUString m_strCitationStyle; + OUString m_strDefaultStyle; + OUString m_strMasterPage; + OUString m_strNumFmt; + OUString m_strNumPrefix; + OUString m_strNumSuffix; + OUString m_strMessageFrom; + OUString m_strMessageOn; + sal_Int32 m_nStartValue; + sal_Int32 m_nRestartType; + bool m_bInsertInPage; + bool m_bIsFootnote; +}; + +inline XFFootnoteConfig::XFFootnoteConfig() +{ + m_nStartValue = 0; + m_nRestartType = -1; + m_strNumFmt = "1"; + m_bInsertInPage = true; + m_strDefaultStyle = "Footnote"; + m_strMasterPage = "Footnote"; + m_strCitationStyle = "Footnote Symbol"; + m_strBodyStyle = "Footnote anchor"; + m_bIsFootnote = true; +} + +inline void XFFootnoteConfig::SetMasterPage(const OUString& masterPage) +{ + m_strMasterPage = masterPage; +} + +inline void XFFootnoteConfig::SetStartValue(sal_Int32 value) +{ + if( value<0 ) + return; + m_nStartValue = value; +} + +inline void XFFootnoteConfig::SetRestartOnPage() +{ + m_nRestartType = 0; +} + +inline void XFFootnoteConfig::SetNumPrefix(const OUString& numprefix) +{ + m_strNumPrefix = numprefix; +} + +inline void XFFootnoteConfig::SetNumSuffix(const OUString& numsuffix) +{ + m_strNumSuffix = numsuffix; +} + +inline void XFFootnoteConfig::SetMessageOn(const OUString& message) +{ + m_strMessageOn = message; +} + +inline void XFFootnoteConfig::SetMessageFrom(const OUString& message) +{ + m_strMessageFrom = message; +} + +inline void XFFootnoteConfig::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + if( !m_strCitationStyle.isEmpty() ) + pAttrList->AddAttribute( "text:citation-style-name", m_strCitationStyle); + + if( !m_strBodyStyle.isEmpty() ) + pAttrList->AddAttribute( "text:citation-body-style-name", m_strBodyStyle); + + if( !m_strNumPrefix.isEmpty() ) + pAttrList->AddAttribute( "style:num-prefix", m_strNumPrefix); + + if( !m_strNumSuffix.isEmpty() ) + pAttrList->AddAttribute( "style:num-suffix", m_strNumSuffix); + + if( !m_strNumFmt.isEmpty() ) + pAttrList->AddAttribute( "style:num-format", m_strNumFmt); + + if( !m_strDefaultStyle.isEmpty() ) + pAttrList->AddAttribute( "text:default-style-name", m_strDefaultStyle); + + if( !m_strMasterPage.isEmpty() ) + pAttrList->AddAttribute( "text:master-page-name", m_strMasterPage); + + pAttrList->AddAttribute( "text:start-value", OUString::number(m_nStartValue) ); + + if( m_bIsFootnote ) + { + if( m_nRestartType == -1 ) + pAttrList->AddAttribute( "text:start-numbering-at", "document" ); + else if( m_nRestartType == 0 ) + pAttrList->AddAttribute( "text:start-numbering-at", "page" ); + else if( m_nRestartType == 1 ) + pAttrList->AddAttribute( "text:start-numbering-at", "chapter" ); + + if( m_bInsertInPage ) + pAttrList->AddAttribute( "text:footnotes-position", "page" ); + else + pAttrList->AddAttribute( "text:footnotes-position", "document" ); + } + + if(m_bIsFootnote) + { + pStrm->StartElement( "text:footnotes-configuration" ); + if( !m_strMessageOn.isEmpty() ) + { + pStrm->StartElement( "text:footnote-continuation-notice-forward" ); + pStrm->Characters(m_strMessageOn); + pStrm->EndElement( "text:footnote-continuation-notice-forward" ); + } + + if( !m_strMessageFrom.isEmpty() ) + { + pStrm->StartElement( "text:footnote-continuation-notice-backward" ); + pStrm->Characters(m_strMessageFrom); + pStrm->EndElement( "text:footnote-continuation-notice-backward" ); + } + + pStrm->EndElement( "text:footnotes-configuration" ); + } + else + { + pStrm->StartElement( "text:endnotes-configuration" ); + pStrm->EndElement( "text:endnotes-configuration" ); + } + +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfframe.hxx b/lotuswordpro/inc/xfilter/xfframe.hxx new file mode 100644 index 000000000..8b7ec196b --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfframe.hxx @@ -0,0 +1,251 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Frame object for OOo.This is the basic object for all Shape Layer. + * You can reference to the XFFrame object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFRAME_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFRAME_HXX + +#include <xfilter/xfcontent.hxx> +#include <xfilter/xfrect.hxx> +#include <xfilter/xfcontentcontainer.hxx> + +#define XFFRAME_FLAG_HEIGHT 0x00000001 +#define XFFRAME_FLAG_MINHEIGHT 0x00000002 +#define XFFRAME_FLAG_MAXHEIGHT 0x00000004 +/** + * @brief + * Base class for all frame object,include drawing,image,text-box. + * + * Use SetX(),SetY(),SetWidth(),SetHeight() to set position for the frame. + * Only if you set anchor type to enumXFAnchorPage, the SetAnchorPage functions. + */ +class XFFrame : public XFContentContainer +{ +public: + XFFrame(); + explicit XFFrame(bool isTextBox); + + virtual ~XFFrame() override; + +public: + using XFContentContainer::Add; + + /** + * @descr override the add function to adjust z-index. + */ + virtual void Add(XFContent *pContent) override; + + /** + * @descr: Set the anchor type for the frame object. + */ + void SetAnchorType(enumXFAnchor type); + + /** + * @descr: if it's page anchor,set the page number. + */ + void SetAnchorPage(sal_Int32 page); + + /** + * @descr Set frame name. + */ + void SetName(const OUString& name); + + /** + * @descr Set z-index of the frame. + */ + void SetZIndex(sal_uInt32 zIndex); + /** + * @descr Set frame position X. + */ + void SetX(double x); + + /** + * @descr Set frame position Y. + */ + void SetY(double y); + + /** + * @descr Set frame width. + */ + void SetWidth(double width); + + /** + * @descr Set frame height. Be careful SetHeight and SetMinHeight will override each other. + */ + void SetHeight(double height); + + /** + * @descr Set frame min-height. Be careful SetHeight and SetMinHeight will override each other. + */ + void SetMinHeight(double minHeight); + + /** + * @descr Set frame position. + */ + void SetPosition(double x, double y, double width, double height); + + /** + * @descr Set frame position. + */ + void SetPosition(const XFRect& rect); + + /** + * @descr: Link the text content of the two frame. + */ + void SetNextLink(const OUString& next); + + /** + * @descr Get the frame type. image, drawing or text-box. + */ + enumXFFrameType GetFrameType() const; + + /** + * @descr Get content type, enumXFContentFrame. + */ + virtual enumXFContent GetContentType() override; + + /** + * @descr serialize. + */ + virtual void ToXml(IXFStream *pStrm) override; + +private: + void StartFrame(IXFStream *pStrm); + + static void EndFrame(IXFStream *pStrm); + + void AdjustZIndex(); + +protected: + enumXFAnchor m_eAnchor; + sal_Int32 m_nAnchorPage; + OUString m_strName; + sal_uInt32 m_nZIndex; + XFRect m_aRect; + double m_fMinHeight; + OUString m_strNextLink; + enumXFFrameType m_eType; + sal_uInt32 m_nFrameFlag; + bool m_isTextBox; +}; + +inline void XFFrame::SetAnchorType(enumXFAnchor anchor) +{ + m_eAnchor = anchor; +} + +inline void XFFrame::SetName(const OUString& name) +{ + m_strName = name; +} + +inline void XFFrame::SetX(double x) +{ + m_aRect.SetX(x); +} + +inline void XFFrame::SetY(double y) +{ + m_aRect.SetY(y); +} + +inline void XFFrame::SetWidth(double width) +{ + m_aRect.SetWidth(width); +} + +inline void XFFrame::SetHeight(double height) +{ + m_aRect.SetHeight(height); + m_nFrameFlag |= XFFRAME_FLAG_HEIGHT; + m_nFrameFlag &= XFFRAME_FLAG_HEIGHT; +} + +inline void XFFrame::SetMinHeight(double minHeight) +{ + m_fMinHeight = minHeight; + m_nFrameFlag |= XFFRAME_FLAG_MINHEIGHT; + m_nFrameFlag &= XFFRAME_FLAG_MINHEIGHT; +} + +inline void XFFrame::SetPosition(double x, double y, double width, double height) +{ + m_aRect.SetStartPoint(XFPoint(x,y)); + m_aRect.SetSize(width,height); + m_nFrameFlag |= XFFRAME_FLAG_HEIGHT; +} + +inline void XFFrame::SetPosition(const XFRect& rect) +{ + m_aRect = rect; +} + +inline void XFFrame::SetNextLink(const OUString& next) +{ + m_strNextLink = next; +} + +inline void XFFrame::SetAnchorPage(sal_Int32 page) +{ + m_nAnchorPage = page; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfframestyle.hxx b/lotuswordpro/inc/xfilter/xfframestyle.hxx new file mode 100644 index 000000000..1ef423318 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfframestyle.hxx @@ -0,0 +1,236 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Frame object style for OOo. + * You can reference to the XFFrame object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFRAMESTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFFRAMESTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfmargins.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfpadding.hxx> +#include <memory> + +class XFBorders; +class XFColumns; +class XFShadow; +class XFBGImage; + +/** + * @brief + * Style for all frame objects. + */ +class XFFrameStyle : public XFStyle +{ +public: + XFFrameStyle(); + + virtual ~XFFrameStyle() override; + +public: + void SetWrapType(enumXFWrap wrap); + + /** + * @descr: space between frame and paragraph text. + */ + void SetMargins(double left, double right, double top, double bottom); + + /** + * @descr: space between frame and text inside frame. + */ + void SetPadding(double left, double right, double top, double bottom); + + /** + * @descr: set the border property of the frame. + */ + void SetBorders(std::unique_ptr<XFBorders> pBorders); + + /** + * @descr: set the column property of the frame. + */ + void SetColumns(XFColumns *pColumns); + + /** + * @descr: set the shadow object the frame. + */ + void SetShadow(XFShadow *pShadow); + + /** + * @descr: set the background image of the frame. + */ + void SetBackImage(std::unique_ptr<XFBGImage>& rImage); + + /** + * @descr: set the background color of the frame. + */ + void SetBackColor(XFColor const & color); + + /** + * @descr Set whether frame is protected. There are three properties that can be protected, content,size and position. + */ + void SetProtect(bool content, bool size, bool pos); + + /** + * @descr Set text dir. + */ + void SetTextDir(enumXFTextDir dir); + + /** + * @descr Set horizontal position type. + */ + void SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel); + + /** + * @descr Set vertical position type. + */ + void SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel); + + void SetTransparency(sal_Int16 nTransparency); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + +protected: + enumXFWrap m_eWrap; + XFPadding m_aPad; + XFMargins m_aMargins; + std::unique_ptr<XFBorders> m_pBorders; + std::unique_ptr<XFColumns> m_pColumns; + std::unique_ptr<XFShadow> m_pShadow; + std::unique_ptr<XFBGImage> m_pBGImage; + XFColor m_aBackColor; + bool m_bProtectContent; + bool m_bProtectSize; + bool m_bProtectPos; + sal_Int16 m_nTransparency; + + enumXFTextDir m_eTextDir; + enumXFFrameXPos m_eXPos; + enumXFFrameXRel m_eXRel; + enumXFFrameYPos m_eYPos; + enumXFFrameYRel m_eYRel; +}; + +inline void XFFrameStyle::SetWrapType(enumXFWrap wrap) +{ + m_eWrap = wrap; +} + +inline void XFFrameStyle::SetMargins(double left, double right,double top, double bottom) +{ + if( left != -1 ) + m_aMargins.SetLeft(left); + if( right != -1 ) + m_aMargins.SetRight(right); + if( top != -1 ) + m_aMargins.SetTop(top); + if( bottom != -1 ) + m_aMargins.SetBottom( bottom ); +} + +inline void XFFrameStyle::SetPadding(double left, double right,double top, double bottom) +{ + if( left != -1 ) + m_aPad.SetLeft(left); + if( right != -1 ) + m_aPad.SetRight(right); + if( top != -1 ) + m_aPad.SetTop(top); + if( bottom != -1 ) + m_aPad.SetBottom( bottom ); +} + +inline void XFFrameStyle::SetBackColor(XFColor const & color) +{ + m_aBackColor = color; +} + +inline void XFFrameStyle::SetTextDir(enumXFTextDir dir) +{ + m_eTextDir = dir; +} + +inline void XFFrameStyle::SetProtect(bool content, bool size, bool pos) +{ + m_bProtectContent = content; + m_bProtectSize = size; + m_bProtectPos = pos; +} + +inline void XFFrameStyle::SetXPosType(enumXFFrameXPos pos, enumXFFrameXRel rel) +{ + m_eXPos = pos; + m_eXRel = rel; +} + +inline void XFFrameStyle::SetYPosType(enumXFFrameYPos pos, enumXFFrameYRel rel) +{ + m_eYPos = pos; + m_eYRel = rel; +} + +inline void XFFrameStyle::SetTransparency(sal_Int16 nTransparency) +{ + m_nTransparency = nTransparency; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfglobal.hxx b/lotuswordpro/inc/xfilter/xfglobal.hxx new file mode 100644 index 000000000..d3bd4d3f1 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfglobal.hxx @@ -0,0 +1,135 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Global functions or include files that are needed. + * It's all for the full filter. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFGLOBAL_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFGLOBAL_HXX + +#include <rtl/ustring.hxx> + +#define PI 3.1415926 +#define FLOAT_MIN 0.001 +#define MAX2(a,b) (((a) > (b)) ? (a) : (b)) +#define MAX3(a,b,c) MAX2(a,MAX2(b,c)) +#define MIN2(a,b) (((a) < (b)) ? (a) : (b)) +#define MIN3(a,b,c) MIN2(a,MIN2(b,c)) +#define FABS(f) (f>0?f:-f) + +void XFGlobalReset(); + +/** + * @brief + * Global object, it manages all global variables for the full filter. + * Before loading a file, we'll need to reset all global variables. + * XFGlobal::Reset can do this for you. + */ +class XFGlobal +{ +public: + /** + * @descr Generate a name for the section. + */ + static OUString GenSectionName(); + + /** + * @descr Gen a name for the frame. + */ + static OUString GenFrameName(); + + /** + * @descr Generate a name for a table. + */ + static OUString GenTableName(); + + /** + * @descr Generate a name for a note. + */ + static OUString GenNoteName(); + + /** + * @descr Generate a name for the stroke style. + */ + static OUString GenStrokeDashName(); + + /** + * @descr Generate a name for the area fill style. + */ + static OUString GenAreaName(); + + /** + * @descr Generate a name for an image object + */ + static OUString GenImageName(); + + /** + * @descr Reset all global variables. + */ + static void Reset(); + +public: + static int s_nSectionID; + static int s_nFrameID; + static int s_nNoteID; + static int s_nStrokeDashID; + static int s_nAreaID; + static int s_nImageID; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfheader.hxx b/lotuswordpro/inc/xfilter/xfheader.hxx new file mode 100644 index 000000000..5b101518f --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfheader.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Header object. Sub object of master page. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFHEADER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFHEADER_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontentcontainer.hxx> + +class XFHeader : public XFContentContainer +{ +public: + XFHeader() + { + } +public: + virtual void ToXml(IXFStream *pStrm) override + { + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + pStrm->StartElement( "style:header" ); + XFContentContainer::ToXml(pStrm); + pStrm->EndElement( "style:header" ); + } +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfheaderstyle.hxx b/lotuswordpro/inc/xfilter/xfheaderstyle.hxx new file mode 100644 index 000000000..7e5a3bda9 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfheaderstyle.hxx @@ -0,0 +1,137 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Header style,exist in page-master object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFHEADERSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFHEADERSTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfmargins.hxx> +#include <xfilter/xfborders.hxx> +#include <xfilter/xfpadding.hxx> +#include <xfilter/xfshadow.hxx> +#include <memory> + +/** + * @brief + * Header style object. + */ +class XFBGImage; +class XFHeaderStyle : public XFStyle +{ +public: + explicit XFHeaderStyle(bool isFooter=false); + + virtual ~XFHeaderStyle() override; + +public: + /** + * @descr Set margins for header style. + */ + void SetMargins(double left, double right, double bottom); + + void SetDynamicSpace(bool dynamic); + + /** + * @descr Set header fixed height. + */ + void SetHeight(double height); + + /** + * @descr Set header min height. + */ + void SetMinHeight(double minHeight); + + /** + * @descr Set header shadow. + */ + void SetShadow(XFShadow *pShadow); + + /** + * @descr Set header borders. + */ + void SetBorders(std::unique_ptr<XFBorders> pBorders); + + void SetBackImage(std::unique_ptr<XFBGImage>& rImage); + + /** + * @descr Set header background color. + */ + void SetBackColor(XFColor color); + + /** + * @descr Output header style object. + */ + virtual void ToXml(IXFStream *pStrm) override; + +protected: + bool m_bIsFooter; + bool m_bDynamicSpace; + double m_fHeight; + double m_fMinHeight; + XFMargins m_aMargin; + std::unique_ptr<XFShadow> m_pShadow; + XFPadding m_aPadding; + std::unique_ptr<XFBorders> m_pBorders; + std::unique_ptr<XFBGImage> m_pBGImage; + XFColor m_aBackColor; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfhyperlink.hxx b/lotuswordpro/inc/xfilter/xfhyperlink.hxx new file mode 100644 index 000000000..f44edab39 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfhyperlink.hxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Hyperlink object for OOo xml filter. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFHYPERLINK_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFHYPERLINK_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontent.hxx> + +class XFHyperlink : public XFContent +{ +public: + XFHyperlink(); + +public: + void SetHRef(const OUString& href); + + void SetText(const OUString& text); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + OUString m_strHRef; + OUString m_strName; + OUString m_strFrame; + OUString m_strText; +}; + +inline XFHyperlink::XFHyperlink() +{ + m_strFrame = "_self"; +} + +inline void XFHyperlink::SetHRef(const OUString& href) +{ + m_strHRef = href; +} + +inline void XFHyperlink::SetText(const OUString& text) +{ + m_strText = text; +} + +inline void XFHyperlink::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + pAttrList->AddAttribute( "xlink:type", "simple" ); + pAttrList->AddAttribute( "xlink:href", m_strHRef ); + if( !m_strName.isEmpty() ) + pAttrList->AddAttribute( "office:name", m_strName ); + pAttrList->AddAttribute( "office:target-frame-name", m_strFrame ); + pAttrList->AddAttribute( "xlink:show", "replace" ); + pStrm->StartElement( "text:a" ); + + pAttrList->Clear(); + if( !GetStyleName().isEmpty() ) + pAttrList->AddAttribute( "text:style-name", GetStyleName() ); + pStrm->StartElement( "text:span" ); + if( !m_strText.isEmpty() ) + pStrm->Characters(m_strText); + else + pStrm->Characters(m_strHRef); + pStrm->EndElement( "text:span" ); + + pStrm->EndElement( "text:a" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfimage.hxx b/lotuswordpro/inc/xfilter/xfimage.hxx new file mode 100644 index 000000000..775d301cc --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfimage.hxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Image object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFIMAGE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFIMAGE_HXX + +#include <xfilter/xfframe.hxx> + +/** + * @brief + * Image object. + * There are two way to import an image, file link or base64 stream. + */ +class XFImage : public XFFrame +{ +public: + XFImage(); + +public: + /** + * @descr Use file link source.a + */ + void SetFileURL(const OUString& url); + + /** + * @descr Use base64 stream. + */ + void SetImageData(sal_uInt8 const* buf, int len); + + /** + * @descr Output image. + */ + virtual void ToXml(IXFStream* pStrm) override; + +private: + OUString m_strImageFile; + OUString m_strData; + bool m_bUseLink; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfimagestyle.hxx b/lotuswordpro/inc/xfilter/xfimagestyle.hxx new file mode 100644 index 000000000..1601984fb --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfimagestyle.hxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Image style object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFIMAGESTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFIMAGESTYLE_HXX + +#include <xfilter/xfframestyle.hxx> + +class XFImageStyle : public XFFrameStyle +{ +public: + XFImageStyle(); + +public: + void SetBrightness(sal_Int32 brightness); + + void SetContrast(sal_Int32 contrast); + + void SetClip(double left, double right, double top, double bottom); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + sal_Int32 m_nBrightness; + sal_Int32 m_nContrast; + double m_fClipLeft; + double m_fClipRight; + double m_fClipTop; + double m_fClipBottom; +}; + +inline void XFImageStyle::SetBrightness(sal_Int32 brightness) +{ + m_nBrightness = brightness; +} + +inline void XFImageStyle::SetContrast(sal_Int32 contrast) +{ + m_nContrast = contrast; +} + +inline void XFImageStyle::SetClip(double left, double right, double top, double bottom) +{ + m_fClipLeft = left; + m_fClipRight = right; + m_fClipTop = top; + m_fClipBottom = bottom; +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfindex.hxx b/lotuswordpro/inc/xfilter/xfindex.hxx new file mode 100644 index 000000000..f5bbd7172 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfindex.hxx @@ -0,0 +1,229 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Represents index source, index body and index entry. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFINDEX_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFINDEX_HXX +#include <map> +#include <vector> + +#include <xfilter/xfcontent.hxx> +#include <xfilter/xfcontentcontainer.hxx> +#include <rtl/ref.hxx> + +class XFIndex; +class XFIndexTemplate; +class XFParagraph; + +/** + * @brief + * Index template. + * When index update, the template is used to decide the index body. + */ +class XFIndexTemplate : public XFContent +{ +public: + XFIndexTemplate(); + +public: + /** + * @descr Set template level. + */ + void SetLevel(const OUString& level); + /** + * @descr Set style. + */ + void SetStyleName(const OUString& style) override; + /** + * @descr Add an entry in the template. + */ + void AddEntry(enumXFIndexTemplate entry, const OUString& styleName); + + /** + * @descr Add a tab entry in the template. + */ + void AddTabEntry(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter, const OUString& styleName); + + /** + * @descr Add an entry in the template. + */ + void AddTextEntry(const OUString& sSpan, const OUString& styleName); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + /** + * @descr Helper function. + */ + void SetTagName(const OUString& tag); + + friend class XFIndex; +private: + OUString m_nLevel; + OUString m_strStyle; + enumXFTab m_eTabType; + double m_fTabLength; + OUString m_strTabDelimiter; + OUString m_strTabLeader; + OUString m_strTagName; + typedef std::pair<enumXFIndexTemplate, OUString> TOCTEMPLATE_ENTRY_TYPE; + std::vector<TOCTEMPLATE_ENTRY_TYPE> m_aEntries; // template entry + text style + std::map<sal_uInt16, OUString> m_aTextEntries; +}; + +/** + * @brief + * Index, include index template, index body. + */ +class XFIndex : public XFContentContainer +{ +public: + XFIndex(); + + virtual ~XFIndex() override; + +public: + /** + * @descr Set index type. + */ + void SetIndexType(enumXFIndex type); + + /** + * @descr Add index template entry. + */ + void AddTemplate(const OUString& level, const OUString& style, XFIndexTemplate* templ); + + /** + * @descr Set if protected index to prevent handy-revise. + */ + void SetProtected(bool protect); + + /** + * @descr Set separator. + */ + void SetSeparator(bool sep); + + virtual void ToXml(IXFStream *pStrm) override; + + void AddTocSource(sal_uInt16 nLevel, const OUString& sStyleName); + +private: + enumXFIndex m_eType; + OUString m_strTitle; + bool m_bProtect; + bool m_bSeparator; + + std::vector<rtl::Reference<XFIndexTemplate>> m_aTemplates; // template entry + style + + #define MAX_TOC_LEVEL 10 + std::vector<OUString> m_aTOCSource[MAX_TOC_LEVEL+1]; +}; + +inline XFIndexTemplate::XFIndexTemplate() + : m_eTabType(enumXFTabNone) + , m_fTabLength(0.0) +{ + m_nLevel = OUString::number(0); +} + +inline void XFIndexTemplate::SetLevel(const OUString& level) +{ + m_nLevel = level; +} +inline void XFIndexTemplate::SetStyleName(const OUString& style) +{ + m_strStyle = style; +} + +inline void XFIndexTemplate::SetTagName(const OUString& tag) +{ + m_strTagName = tag; +} + +inline void XFIndexTemplate::AddEntry(enumXFIndexTemplate entry, const OUString& styleName) +{ + std::pair<enumXFIndexTemplate, OUString> pair(entry, styleName); + m_aEntries.push_back(pair); +} + +inline void XFIndexTemplate::AddTabEntry(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter, const OUString& styleName) +{ + m_eTabType = type; + m_strTabLeader = OUString( leader ); + m_strTabDelimiter = OUString( delimiter ); + m_fTabLength = len; + + AddEntry(enumXFIndexTemplateTab, styleName); +} + +inline void XFIndexTemplate::AddTextEntry(const OUString& sText, const OUString& styleName) +{ + sal_uInt16 nLen = m_aEntries.size(); + AddEntry(enumXFIndexTemplateSpan, styleName); + + m_aTextEntries[nLen] = sText; +} + +inline void XFIndex::SetIndexType(enumXFIndex type) +{ + m_eType = type; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfinputlist.hxx b/lotuswordpro/inc/xfilter/xfinputlist.hxx new file mode 100644 index 000000000..8a5a70e1c --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfinputlist.hxx @@ -0,0 +1,113 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * input list field. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFINPUTLIST_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFINPUTLIST_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontent.hxx> +#include <vector> + +/** + * @brief + * input list field. + */ +class XFInputList : public XFContent +{ +public: + void SetName(const OUString& sName) + { + m_strName = sName; + } + + void SetLabels(const std::vector<OUString>& list) + { + m_list=list; + } + + virtual void ToXml(IXFStream *pStrm) override; +private: + OUString m_strName; + std::vector<OUString> m_list; +}; + +inline void XFInputList::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + pAttrList->AddAttribute( "text:name", m_strName ); + pStrm->StartElement( "text:drop-down" ); + + pAttrList->Clear(); + pAttrList->AddAttribute( "text:value", " " ); + pStrm->StartElement( "text:label" ); + pStrm->EndElement( "text:label" ); + for(size_t i=0; i< m_list.size();i++) + { + pAttrList->Clear(); + pAttrList->AddAttribute( "text:value", m_list[i] ); + pStrm->StartElement( "text:label" ); + pStrm->EndElement( "text:label" ); + } + pStrm->EndElement( "text:drop-down" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xflinebreak.hxx b/lotuswordpro/inc/xfilter/xflinebreak.hxx new file mode 100644 index 000000000..a5fc5054b --- /dev/null +++ b/lotuswordpro/inc/xfilter/xflinebreak.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************** + * @file + * Line break object,<text:line-break/> + *************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLINEBREAK_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLINEBREAK_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontent.hxx> + +class XFLineBreak : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +inline void XFLineBreak::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + + pAttrList->Clear(); + pStrm->StartElement( "text:line-break" ); + pStrm->EndElement( "text:line-break" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xflineheight.hxx b/lotuswordpro/inc/xfilter/xflineheight.hxx new file mode 100644 index 000000000..cffff2457 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xflineheight.hxx @@ -0,0 +1,171 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Line height for paragraph. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLINEHEIGHT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLINEHEIGHT_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfdefs.hxx> + +class XFLineHeight +{ +public: + XFLineHeight() + { + Reset(); + } +public: + void SetHeight(double value); + + void SetLeastHeight(double value); + + void SetPercent(sal_Int32 value); + + void SetSpace(double value); + + void Reset(); + + void ToXml(IXFStream *pStrm); + + friend bool operator==(XFLineHeight const & indent1, XFLineHeight const & indent2); + friend bool operator!=(XFLineHeight const & indent1, XFLineHeight const & indent2); +private: + union{ + sal_Int32 m_nValue; + double m_fValue; + }m_Value; + enumLHType m_eType; +}; + +inline void XFLineHeight::SetHeight(double value) +{ + m_Value.m_fValue = value; + m_eType = enumLHHeight; +} + +inline void XFLineHeight::SetLeastHeight(double value) +{ + m_Value.m_fValue = value; + m_eType = enumLHLeast; +} + +inline void XFLineHeight::SetPercent(sal_Int32 value) +{ + m_Value.m_nValue = value; + m_eType = enumLHPercent; +} +inline void XFLineHeight::SetSpace(double value) +{ + m_Value.m_fValue = value; + m_eType = enumLHSpace; +} +inline void XFLineHeight::Reset() +{ + m_eType = enumLHNone; + m_Value.m_fValue = 0; +} + +inline void XFLineHeight::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + + switch(m_eType) + { + case enumLHNone: + return; + case enumLHHeight: + pAttrList->AddAttribute( "fo:line-height",OUString::number(m_Value.m_fValue) + "cm" ); + break; + case enumLHLeast: + pAttrList->AddAttribute( "style:line-height-at-least",OUString::number(m_Value.m_fValue) + "cm" ); + break; + case enumLHPercent: + pAttrList->AddAttribute( "fo:line-height", OUString::number(m_Value.m_nValue) + "%" ); + break; + case enumLHSpace: + pAttrList->AddAttribute( "style:line-spacing", OUString::number(m_Value.m_fValue) + "cm" ); + break; + } +} + +inline bool operator==(XFLineHeight const & lh1, XFLineHeight const & lh2) +{ + if( lh1.m_eType != lh2.m_eType ) + return false; + if( lh1.m_eType == enumLHPercent ) + { + if( lh1.m_Value.m_nValue != lh2.m_Value.m_nValue ) + return false; + } + else + { + if( lh1.m_Value.m_fValue != lh2.m_Value.m_fValue ) + return false; + } + return true; +} + +inline bool operator!=(XFLineHeight const & lh1, XFLineHeight const & lh2) +{ + return !(lh1==lh2); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xflinenumberconfig.hxx b/lotuswordpro/inc/xfilter/xflinenumberconfig.hxx new file mode 100644 index 000000000..5c0516bce --- /dev/null +++ b/lotuswordpro/inc/xfilter/xflinenumberconfig.hxx @@ -0,0 +1,173 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Line numbering config for the full document. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLINENUMBERCONFIG_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLINENUMBERCONFIG_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfstyle.hxx> + +class XFLineNumberConfig : public XFStyle +{ +public: + XFLineNumberConfig(); + +public: + void SetNumberOffset(double offset); + + void SetNumberPosition(enumXFLineNumberPos pos); + + void SetNumberIncrement(sal_Int32 increment); + + void SetRestartOnPage(bool restart = true); + + void SetCountEmptyLines(bool empty = true); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + enumXFLineNumberPos m_ePosition; + double m_fOffset; + sal_Int32 m_nIncrement; + static const sal_Int32 m_nSepIncrement = 3; + OUString m_strSeparator; + OUString m_strNumFmt; + OUString m_strTextStyle; + bool m_bRestartOnPage; + bool m_bCountEmptyLines; +}; + +inline XFLineNumberConfig::XFLineNumberConfig() + : m_ePosition(enumXFLineNumberLeft) + , m_fOffset(0) + , m_nIncrement(5) + , m_bRestartOnPage(false) + , m_bCountEmptyLines(true) +{} + +inline void XFLineNumberConfig::SetNumberOffset(double offset) +{ + m_fOffset = offset; +} + +inline void XFLineNumberConfig::SetNumberPosition(enumXFLineNumberPos position) +{ + m_ePosition = position; +} + +inline void XFLineNumberConfig::SetNumberIncrement(sal_Int32 increment) +{ + m_nIncrement = increment; +} + +inline void XFLineNumberConfig::SetRestartOnPage(bool restart) +{ + m_bRestartOnPage = restart; +} + +inline void XFLineNumberConfig::SetCountEmptyLines(bool empty) +{ + m_bCountEmptyLines = empty; +} + +inline void XFLineNumberConfig::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + + if( !m_strTextStyle.isEmpty() ) + pAttrList->AddAttribute( "text:style-name", m_strTextStyle ); + pAttrList->AddAttribute( "text:offset", OUString::number(m_fOffset) + "cm" ); + pAttrList->AddAttribute( "style:num-format", m_strNumFmt ); + //position: + if( m_ePosition == enumXFLineNumberLeft ) + pAttrList->AddAttribute( "text:number-position", "left" ); + else if( m_ePosition == enumXFLineNumberRight ) + pAttrList->AddAttribute( "text:number-position", "right" ); + else if( m_ePosition == enumXFLineNumberInner ) + pAttrList->AddAttribute( "text:number-position", "inner" ); + else if( m_ePosition == enumXFLineNumberOuter ) + pAttrList->AddAttribute( "text:number-position", "outer" ); + + pAttrList->AddAttribute( "text:increment", OUString::number(m_nIncrement) ); + + if( m_bRestartOnPage ) + pAttrList->AddAttribute( "text:restart-on-page", "true" ); + else + pAttrList->AddAttribute( "text:restart-on-page", "false" ); + + if( m_bCountEmptyLines ) + pAttrList->AddAttribute( "text:count-empty-lines", "true" ); + else + pAttrList->AddAttribute( "text:count-empty-lines", "false" ); + + pAttrList->AddAttribute( "text:count-in-floating-frames", "false" ); + + pStrm->StartElement( "text:linenumbering-configuration" ); + + pAttrList->Clear(); + pAttrList->AddAttribute( "text:increment", OUString::number(m_nSepIncrement) ); + pStrm->StartElement( "text:linenumbering-separator" ); + pStrm->Characters(m_strSeparator); + pStrm->EndElement( "text:linenumbering-separator" ); + + pStrm->EndElement( "text:linenumbering-configuration" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xflist.hxx b/lotuswordpro/inc/xfilter/xflist.hxx new file mode 100644 index 000000000..bd95e84ef --- /dev/null +++ b/lotuswordpro/inc/xfilter/xflist.hxx @@ -0,0 +1,111 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Base list object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLIST_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLIST_HXX + +#include <xfilter/xfcontentcontainer.hxx> + +class XFListItem; + +/** + * @brief + * list object for order-list and unordered-list. + */ +class XFList : public XFContentContainer +{ +public: + XFList(); + + virtual ~XFList() override; + +public: + /** + * @descr Set whether it's an ordered list or an unordered list. + */ + void SetOrdered(bool ordered); + + /** + * @descr Set whether to continue to number list. + */ + void SetContinueNumber(bool bContinueNumber); + + /** + * @descr Output list object. + */ + virtual void ToXml(IXFStream *pStrm) override; + +private: + bool m_bOrdered; + bool m_bContinueNumber; +}; + +inline void XFList::SetOrdered(bool ordered) +{ + m_bOrdered = ordered; +} + +inline void XFList::SetContinueNumber(bool bContinueNumber) +{ + m_bContinueNumber = bContinueNumber; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xflistitem.hxx b/lotuswordpro/inc/xfilter/xflistitem.hxx new file mode 100644 index 000000000..228176217 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xflistitem.hxx @@ -0,0 +1,113 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * List item. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLISTITEM_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLISTITEM_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontentcontainer.hxx> + +class XFListItem : public XFContentContainer +{ +public: + XFListItem(); + +public: + void SetIsHeader(); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + bool m_bIsHeader; +}; + +inline XFListItem::XFListItem() +{ + m_bIsHeader = false; +} + +inline void XFListItem::SetIsHeader() +{ + m_bIsHeader = true; +} + +inline void XFListItem::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + if( !GetStyleName().isEmpty() ) + pAttrList->AddAttribute( "text:style-name", GetStyleName() ); + + if( !m_bIsHeader ) + { + pStrm->StartElement( "text:list-item" ); + XFContentContainer::ToXml(pStrm); + pStrm->EndElement( "text:list-item" ); + } + else + { + pStrm->StartElement( "text:list-header" ); + XFContentContainer::ToXml(pStrm); + pStrm->EndElement( "text:list-header" ); + } +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfliststyle.hxx b/lotuswordpro/inc/xfilter/xfliststyle.hxx new file mode 100644 index 000000000..9937ea85a --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfliststyle.hxx @@ -0,0 +1,260 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* +* @file +* Styles for ordered list and unordered list. +************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLISTSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFLISTSTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfnumfmt.hxx> +#include <memory> + +class IXFStream; + +enum enumXFListLevel +{ + enumXFListLevelBullet, + enumXFListLevelNumber, + enumXFListLevelImage +}; + +/************************************************************************** + * @descr + * Bullet style wrapper,the underline bullet type can be: + * number,image,or bullet. + *************************************************************************/ +class XFListLevel +{ +public: + XFListLevel(); + + virtual ~XFListLevel(){} + + XFListLevel(XFListLevel const &) = default; + XFListLevel(XFListLevel &&) = default; + XFListLevel & operator =(XFListLevel const &) = default; + XFListLevel & operator =(XFListLevel &&) = default; + + void SetListlevelType(enumXFListLevel type); + + void SetLevel(sal_Int16 level); + + void SetDisplayLevel(sal_Int16 nDisplayLevel); + + void SetIndent(double indent); + + void SetMinLabelWidth(double labelWidth); + + void SetMinLabelDistance(double distance); + + void SetAlignType(enumXFAlignType align); + + virtual void ToXml(IXFStream *pStrm); + + friend class XFListStyle; +protected: + sal_Int16 m_nLevel; + sal_Int16 m_nDisplayLevel; + double m_fIndent; + double m_fMinLabelWidth; + double m_fMinLabelDistance; + enumXFAlignType m_eAlign; + enumXFListLevel m_eListType; +}; + +class XFListlevelNumber : public XFListLevel +{ +public: + XFListlevelNumber() + { + m_eListType = enumXFListLevelNumber; + } +public: + void SetNumFmt(XFNumFmt const & fmt) + { + m_aNumFmt = fmt; + } + + void SetStartValue(sal_Int16 start) + { + m_aNumFmt.SetStartValue(start); + } + + virtual void ToXml(IXFStream *pStrm) override; +private: + XFNumFmt m_aNumFmt; +}; + +class XFListLevelBullet : public XFListLevel +{ +public: + XFListLevelBullet() + { + m_eListType = enumXFListLevelBullet; + } + + void SetBulletChar(OUString const & ch) + { + m_chBullet = ch; + } + void SetPrefix(const OUString& prefix) + { + m_aNumFmt.SetPrefix(prefix); + } + void SetSuffix(const OUString& suffix) + { + m_aNumFmt.SetSuffix(suffix); + } + void SetFontName(const OUString& name) + { + m_strFontName = name; + } + + virtual void ToXml(IXFStream *pStrm) override; +private: + XFNumFmt m_aNumFmt; + OUString m_chBullet; + OUString m_strFontName; +}; + +//not complete. +class XFListLevelImage : public XFListLevel +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +private: +}; + +class XFListStyle : public XFStyle +{ +public: + XFListStyle(); + + XFListStyle(const XFListStyle& other); + + XFListStyle& operator=(const XFListStyle& other) = delete; + + virtual ~XFListStyle() override; + +public: + void SetDisplayLevel(sal_Int32 level, sal_Int16 nShowLevel); + + void SetListPosition(sal_Int32 level, + double indent, + double minLabelWidth, + double minLabelDistance, + enumXFAlignType align=enumXFAlignStart + ); + + void SetListBullet(sal_Int32 level, + OUString const & bullet_char, + const OUString& fontname, + const OUString& prefix, + const OUString& suffix + ); + + void SetListNumber( sal_Int32 level, XFNumFmt const & numFmt, sal_Int16 nStartValue ); + + virtual enumXFStyle GetStyleFamily() override + { + return enumXFStyleList; + } + virtual void ToXml(IXFStream *pStrm) override; + +private: + std::unique_ptr<XFListLevel> m_pListLevels[10]; +}; + +inline void XFListLevel::SetListlevelType(enumXFListLevel type) +{ + m_eListType = type; +} + +inline void XFListLevel::SetAlignType(enumXFAlignType align) +{ + m_eAlign = align; +} + +inline void XFListLevel::SetLevel(sal_Int16 level) +{ + m_nLevel = level; +} + +inline void XFListLevel::SetDisplayLevel(sal_Int16 nDisplayLevel) +{ + m_nDisplayLevel = nDisplayLevel; +} + +inline void XFListLevel::SetIndent(double indent) +{ + m_fIndent = indent; +} + +inline void XFListLevel::SetMinLabelWidth(double labelWidth) +{ + m_fMinLabelWidth = labelWidth; +} + +inline void XFListLevel::SetMinLabelDistance(double distance) +{ + m_fMinLabelDistance = distance; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfmargins.hxx b/lotuswordpro/inc/xfilter/xfmargins.hxx new file mode 100644 index 000000000..0eafc0a46 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfmargins.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Margins object, include left margin,right margin,top margin and bottom margin. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFMARGINS_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFMARGINS_HXX + +#include <xfilter/ixfstream.hxx> + +#define XFMARGINS_FLAG_LEFT 0x00000001 +#define XFMARGINS_FLAG_RIGHT 0x00000002 +#define XFMARGINS_FLAG_TOP 0x00000004 +#define XFMARGINS_FLAG_BOTTOM 0x00000008 + +class XFMargins +{ +public: + XFMargins(); +public: + void Reset(); + void SetLeft(double left); + void SetRight(double right); + void SetTop(double top); + void SetBottom(double bottom); + + double GetLeft() const; + double GetTop() const; + + void ToXml(IXFStream *pStrm); + + friend bool operator==(XFMargins const & indent1, XFMargins const & indent2); + friend bool operator!=(XFMargins const & indent1, XFMargins const & indent2); +private: + double m_fLeft; + double m_fRight; + double m_fTop; + double m_fBottom; + int m_nFlag; +}; + +inline void XFMargins::SetLeft(double left) +{ + m_fLeft = left; + m_nFlag |= XFMARGINS_FLAG_LEFT; +} + +inline void XFMargins::SetRight(double right) +{ + m_fRight = right; + m_nFlag |= XFMARGINS_FLAG_RIGHT; +} + +inline void XFMargins::SetTop(double top) +{ + m_fTop = top; + m_nFlag |= XFMARGINS_FLAG_TOP; +} + +inline void XFMargins::SetBottom(double bottom) +{ + m_fBottom = bottom; + m_nFlag |= XFMARGINS_FLAG_BOTTOM; +} + +inline double XFMargins::GetLeft() const +{ + return m_fLeft; +} + +inline double XFMargins::GetTop() const +{ + return m_fTop; +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfmasterpage.hxx b/lotuswordpro/inc/xfilter/xfmasterpage.hxx new file mode 100644 index 000000000..dfb10dea0 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfmasterpage.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Master page object which was used to apply a layout to the pages. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFMASTERPAGE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFMASTERPAGE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfheader.hxx> +#include <xfilter/xffooter.hxx> + +class XFFooter; +class XFHeader; +class XFMasterPage : public XFStyle +{ +public: + void SetPageMaster(const OUString& pm); + + void SetHeader(rtl::Reference<XFHeader> const & rHeader); + + void SetFooter(rtl::Reference<XFFooter> const & rFooter); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + OUString m_strPageMaster; + rtl::Reference<XFHeader> m_xHeader; + rtl::Reference<XFFooter> m_xFooter; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfnumberstyle.hxx b/lotuswordpro/inc/xfilter/xfnumberstyle.hxx new file mode 100644 index 000000000..6b1fd9f0d --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfnumberstyle.hxx @@ -0,0 +1,153 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Number style for table cell. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFNUMBERSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFNUMBERSTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfcolor.hxx> +#include <rtl/ustring.hxx> + +class XFNumberStyle final : public XFStyle +{ +public: + XFNumberStyle(); + + void SetDecimalDigits(sal_Int32 decimal); + + void SetGroup(); + + void SetColor(const XFColor& color); + const XFColor& GetColor() const {return m_aColor;} + + void SetPrefix(const OUString& prefix); + + void SetSurfix(const OUString& surfix); + + void SetNegativeStyle(const OUString& prefix, const OUString& suffix, const XFColor& color); + + void SetNumberType(enumXFNumberType type); + + virtual enumXFStyle GetStyleFamily() override; + + virtual bool Equal(IXFStyle *pStyle) override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + void ToXml_StartElement(IXFStream *pStrm); + void ToXml_EndElement(IXFStream *pStrm); + void ToXml_Normal(IXFStream *pStrm); + void ToXml_Negative(IXFStream *pStrm); + void ToXml_Content(IXFStream *pStrm, bool nagetive); + + enumXFNumberType m_eType; + sal_Int32 m_nDecimalDigits; + bool m_bGroup; + XFColor m_aColor; + OUString m_strCurrencySymbol; + OUString m_strPrefix; + OUString m_strSuffix; + bool m_bRedIfNegative; + XFColor m_aNegativeColor; + OUString m_strNegativePrefix; + OUString m_strNegativeSuffix; +}; + +inline void XFNumberStyle::SetDecimalDigits(sal_Int32 decimal) +{ + m_nDecimalDigits = decimal; +} + +inline void XFNumberStyle::SetNegativeStyle(const OUString& prefix, const OUString& suffix, const XFColor& color) +{ + m_bRedIfNegative = true; + m_aNegativeColor = color; + m_strNegativePrefix = prefix; + m_strNegativeSuffix = suffix; +} + +inline void XFNumberStyle::SetGroup() +{ + m_bGroup = true; +} + +inline void XFNumberStyle::SetColor(const XFColor& color) +{ + m_aColor = color; +} + +inline void XFNumberStyle::SetNumberType(enumXFNumberType type) +{ + m_eType = type; +} + +inline void XFNumberStyle::SetPrefix(const OUString& prefix) +{ + m_strPrefix = prefix; +} + +inline void XFNumberStyle::SetSurfix(const OUString& surfix) +{ + m_strSuffix = surfix; +} + + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfnumfmt.hxx b/lotuswordpro/inc/xfilter/xfnumfmt.hxx new file mode 100644 index 000000000..da4a866ec --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfnumfmt.hxx @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Number format. a),A),i),1),(1) + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFNUMFMT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFNUMFMT_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/ixfattrlist.hxx> + +/** + * @brief + * Bullet number format. + */ +class XFNumFmt +{ +public: + XFNumFmt() + { + m_nStartValue = 0; + } + +public: + /********************************************************************** + * @descr: set the prefix of the number format,that the '(' of output + (1 item1 + (2 item2 + * @param: prefix + *********************************************************************/ + void SetPrefix(const OUString& prefix) + { + m_strPrefix = prefix; + } + + /********************************************************************** + * @descr: set the suffix of the number format,that the ')' of output + 1) item1 + 2) item2 + * @param: prefix + *********************************************************************/ + void SetSuffix(const OUString& suffix) + { + m_strSuffix = suffix; + } + + /********************************************************************** + * @descr: set the display value. ie. if you set format to '1',then + the output would be: + 1 item1 + 2 item2 + or if you set the format to 'a', then the output would be: + a item1 + b item2 + some special, if you set the format to a sequence,ie. "一,二,三,..." + the output would be: + 一 item1 + 二 item2 + 三 item3 + + Of course, for unordered-list, you can also set the format to + be a bullet char,ie: + '','','','','', + * @param: prefix + *********************************************************************/ + void SetFormat(const OUString& format) + { + m_strFormat = format; + } + + void SetStartValue(sal_Int16 start) + { + m_nStartValue = start; + } + + void ToXml(IXFStream *pStrm) + { + IXFAttrList *pAttrList = pStrm->GetAttrList(); + + if( !m_strPrefix.isEmpty() ) + pAttrList->AddAttribute( "style:num-prefix", m_strPrefix ); + if( !m_strSuffix.isEmpty() ) + pAttrList->AddAttribute( "style:num-suffix", m_strSuffix ); + pAttrList->AddAttribute( "style:num-format", m_strFormat ); + if( m_nStartValue != 0 ) + pAttrList->AddAttribute( "text:start-value", OUString::number(static_cast<sal_Int32>(m_nStartValue)) ); + } +private: + OUString m_strPrefix; + OUString m_strSuffix; + OUString m_strFormat; + sal_Int16 m_nStartValue; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfofficemeta.hxx b/lotuswordpro/inc/xfilter/xfofficemeta.hxx new file mode 100644 index 000000000..a183ab793 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfofficemeta.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Meta info for the full document. + * You can see this by click: File->Properties. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFOFFICEMETA_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFOFFICEMETA_HXX + +#include <xfilter/ixfstream.hxx> + +class XFOfficeMeta final +{ +public: + XFOfficeMeta(){} + + void SetCreator(const OUString& creator); + void SetDescription(const OUString& dsr); + void SetKeywords(const OUString& keywords); + void SetCreationTime(const OUString& crtime); + void SetLastTime(const OUString& lstime); + void SetEditTime(const OUString& edtime); + + void ToXml(IXFStream *pStream); +private: + OUString m_strGenerator; + OUString m_strTitle; + OUString m_strCreator; + OUString m_strDsr; + OUString m_strKeywords; + OUString m_strCrtime; + OUString m_strLstime; + OUString m_strEdtime; + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfpadding.hxx b/lotuswordpro/inc/xfilter/xfpadding.hxx new file mode 100644 index 000000000..69e30723b --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfpadding.hxx @@ -0,0 +1,207 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Padding for paragraph. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPADDING_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPADDING_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/ixfattrlist.hxx> + +#define XFPADDING_FLAG_LEFT 0X00000001 +#define XFPADDING_FLAG_RIGHT 0X00000002 +#define XFPADDING_FLAG_TOP 0X00000004 +#define XFPADDING_FLAG_BOTTOM 0X00000008 + +/** + * @brief + * Padings for paragraph,frame,... + */ +class XFPadding +{ +public: + XFPadding(); + +public: + /** + * @descr Reset all values. + */ + void Reset(); + + /** + * @descr Set padding left. + */ + void SetLeft(double left); + + /** + * @descr Set padding right. + */ + void SetRight(double right); + + /** + * @descr Set padding top. + */ + void SetTop(double top); + + /** + * @descr Set padding bottom. + */ + void SetBottom(double bottom); + + /** + * @descr Output padding properties. + */ + void ToXml(IXFStream *pStrm); + + friend bool operator==(XFPadding const & p1, XFPadding const & p2); + friend bool operator!=(XFPadding const & p1, XFPadding const & p2); +private: + int m_nFlag; + double m_fLeft; + double m_fRight; + double m_fTop; + double m_fBottom; +}; + +inline XFPadding::XFPadding() +{ + Reset(); +} + +inline void XFPadding::Reset() +{ + m_nFlag = 0; + m_fLeft = 0; + m_fRight = 0; + m_fTop = 0; + m_fBottom = 0; +} + +inline void XFPadding::SetLeft(double left) +{ + m_fLeft = left; + m_nFlag |= XFPADDING_FLAG_LEFT; +} + +inline void XFPadding::SetRight(double right) +{ + m_fRight = right; + m_nFlag |= XFPADDING_FLAG_RIGHT; +} + +inline void XFPadding::SetTop(double top) +{ + m_fTop = top; + m_nFlag |= XFPADDING_FLAG_TOP; +} + +inline void XFPadding::SetBottom(double bottom) +{ + m_fBottom = bottom; + m_nFlag |= XFPADDING_FLAG_BOTTOM; +} + +inline void XFPadding::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + + if( (m_fLeft == m_fRight) && (m_fLeft == m_fTop) && (m_fLeft== m_fBottom ) && m_nFlag == 0x00000015 ) + { + pAttrList->AddAttribute( "fo:padding", OUString::number(m_fLeft) + "cm" ); + return; + } + //margin left: + if( m_nFlag&XFPADDING_FLAG_LEFT ) + { + pAttrList->AddAttribute( "fo:padding-left", OUString::number(m_fLeft) + "cm" ); + } + //margin right: + if( m_nFlag&XFPADDING_FLAG_RIGHT ) + { + pAttrList->AddAttribute("fo:padding-right", OUString::number(m_fRight) + "cm" ); + } + //margin top: + if( m_nFlag&XFPADDING_FLAG_TOP ) + { + pAttrList->AddAttribute("fo:padding-top", OUString::number(m_fTop) + "cm" ); + } + //margin bottom: + if( m_nFlag&XFPADDING_FLAG_BOTTOM ) + { + pAttrList->AddAttribute("fo:padding-bottom", OUString::number(m_fBottom) + "cm" ); + } +} + +inline bool operator==(XFPadding const & p1, XFPadding const & p2) +{ + return ( + (p1.m_nFlag == p2.m_nFlag) && + (p1.m_fLeft == p2.m_fLeft) && + (p1.m_fRight == p2.m_fRight) && + (p1.m_fTop == p2.m_fTop) && + (p1.m_fBottom == p2.m_fBottom) + ); +} + +inline bool operator!=(XFPadding const & p1, XFPadding const & p2) +{ + return !(p1==p2); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfpagecount.hxx b/lotuswordpro/inc/xfilter/xfpagecount.hxx new file mode 100644 index 000000000..00f9ed708 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfpagecount.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Page number field. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPAGECOUNT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPAGECOUNT_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontent.hxx> + +/** + * @brief + * Page count field. + */ +class XFPageCount : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +inline void XFPageCount::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + pStrm->StartElement( "text:page-count" ); + pStrm->EndElement( "text:page-count" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfpagemaster.hxx b/lotuswordpro/inc/xfilter/xfpagemaster.hxx new file mode 100644 index 000000000..3864cfdda --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfpagemaster.hxx @@ -0,0 +1,159 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Page master used bye XFMasterPage. + * It is the real object to define header and footer of pages. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPAGEMASTER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPAGEMASTER_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfmargins.hxx> +#include <memory> + +class XFBorders; +class XFShadow; +class XFColumns; +class XFHeaderStyle; +class XFFooterStyle; +class XFBGImage; + +class XFPageMaster : public XFStyle +{ +public: + XFPageMaster(); + + virtual ~XFPageMaster() override; + +public: + void SetPageWidth(double width); + + void SetPageHeight(double height); + + void SetMargins(double left, double right, double top, double bottom); + + void SetPageUsage(enumXFPageUsage usage); + + void SetBorders(std::unique_ptr<XFBorders> pBorders); + + void SetShadow(XFShadow *pShadow); + + void SetBackColor(XFColor color); + + void SetBackImage(std::unique_ptr<XFBGImage>& rImage); + + void SetColumns(XFColumns *pColumns); + + void SetHeaderStyle(XFHeaderStyle *pHeaderStyle); + + void SetFooterStyle(XFFooterStyle *pFooterStyle); + + void SetTextDir(enumXFTextDir dir); + + void SetFootNoteSeparator(enumXFAlignType align, + double width, + sal_Int32 lengthPercent, + double spaceAbove, + double spaceBelow, + XFColor color + ); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStream) override; + +private: + double m_fPageWidth; + double m_fPageHeight; + + XFMargins m_aMargin; + + enumXFPageUsage m_eUsage; + enumXFTextDir m_eTextDir; + + std::unique_ptr<XFBorders> m_pBorders; + std::unique_ptr<XFShadow> m_pShadow; + XFColor m_aBackColor; + std::unique_ptr<XFColumns> m_pColumns; + std::unique_ptr<XFBGImage> m_pBGImage; + + std::unique_ptr<XFHeaderStyle> m_pHeaderStyle; + std::unique_ptr<XFFooterStyle> m_pFooterStyle; + //separator: + enumXFAlignType m_eSepAlign; + double m_fSepWidth; + XFColor m_aSepColor; + double m_fSepSpaceAbove; + double m_fSepSpaceBelow; + sal_Int32 m_nSepLengthPercent; + +}; + +inline void XFPageMaster::SetPageUsage(enumXFPageUsage usage) +{ + m_eUsage = usage; +} + +inline void XFPageMaster::SetTextDir(enumXFTextDir dir) +{ + m_eTextDir = dir; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfpagenumber.hxx b/lotuswordpro/inc/xfilter/xfpagenumber.hxx new file mode 100644 index 000000000..aa63530a1 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfpagenumber.hxx @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Page number field. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPAGENUMBER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPAGENUMBER_HXX + +#include <xfilter/xfcontent.hxx> +#include <xfilter/xfnumfmt.hxx> + +/** + * @brief + * Page number field. + */ +class XFPageNumber : public XFContent +{ +public: + void SetNumFmt(const OUString& fmt); + + virtual void ToXml(IXFStream *pStrm) override; + +private: + XFNumFmt m_aNumFmt; +}; + +inline void XFPageNumber::SetNumFmt(const OUString& fmt) +{ + m_aNumFmt.SetFormat(fmt); +} + +inline void XFPageNumber::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + + m_aNumFmt.ToXml(pStrm); + pAttrList->AddAttribute( "text:select-page", "current" ); + pStrm->StartElement( "text:page-number" ); + pStrm->EndElement( "text:page-number" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfparagraph.hxx b/lotuswordpro/inc/xfilter/xfparagraph.hxx new file mode 100644 index 000000000..e53399272 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfparagraph.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Paragraph object of OOo, it will output <text:p >...</text:p> element. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPARAGRAPH_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPARAGRAPH_HXX + +#include <xfilter/xfcontentcontainer.hxx> + +class IXFStream; + +/** + * @brief + * Paragraph object for SODC. + * You can call Add() to add text span or drawing objects to XFParagraph. + */ +class XFParagraph : public XFContentContainer +{ +public: + XFParagraph(); + + virtual ~XFParagraph() override; + +public: + bool HasContents() const; + + virtual enumXFContent GetContentType() override; + + virtual void ToXml(IXFStream* pStrm) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfparastyle.hxx b/lotuswordpro/inc/xfilter/xfparastyle.hxx new file mode 100644 index 000000000..339f6a3c7 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfparastyle.hxx @@ -0,0 +1,301 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Styles for paragraph. + * Styles for paragraph may include many style,include font,indent,margin, + * shadow,line height,and so on. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPARASTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPARASTYLE_HXX + +#include <sal/config.h> + +#include <rtl/ref.hxx> + +#include <xfilter/xffont.hxx> +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfmargins.hxx> +#include <xfilter/xfbreaks.hxx> +#include <xfilter/xfpadding.hxx> +#include <xfilter/xfshadow.hxx> +#include <xfilter/xfdropcap.hxx> +#include <xfilter/xfstylecont.hxx> +#include <xfilter/xflineheight.hxx> +#include <memory> + +#define XFPARA_FLAG_FONT 0X00000001 +#define XFPARA_FLAG_DROPCAP 0X00000002 +#define XFPARA_FLAG_BACKCOLOR 0X00000004 + +class XFBorders; +class XFBGImage; + +/** + * @brief + * Style object for aragraph. + */ +class XFParaStyle : public XFStyle +{ +public: + XFParaStyle(); + + XFParaStyle(const XFParaStyle& other); + + XFParaStyle& operator=(const XFParaStyle& other); + + virtual ~XFParaStyle() override; + +public: + /** + * @descr Set layout for the paragraph. When such property was set, this paragraph will + * start at a new page. + */ + void SetMasterPage(const OUString& master); + + const OUString& GetMasterPage() const; + + /** + * @descr set the paragraph default font. + * @param font object to be set. Font object is deleted by font-factory, so + * don't delete it in the destructure function of para style. + */ + void SetFont(rtl::Reference<XFFont> const & font); + + /** + * @descr get the font object. + */ + const rtl::Reference<XFFont>& GetFont() const { return m_pFont; } + + /** + * @descr Set the indent of the paragraph. This is the indent for + the first line. + * @param indent value of the first-line indent. + */ + void SetIndent(double indent ); + + /** + * @descr Set the padding of the paragraph. This is the distance + between the border and the top of the text. + * @param indent value of the padding. + */ + void SetPadding(double left, double right, double top, double bottom); + + /** + * @descr Set the Margins of the paragraph. + * @param -1: don't change. + other: set value. + */ + void SetMargins(double left, double right,double top=-1, double bottom=-1); + + /** + * @descr Set alignment property of the paragraph. + * @param eAlign alignment type,left,right,center or justify. + */ + void SetAlignType(enumXFAlignType eAlign); + + /** + * @descr Set the shadow of the paragraph. There are 4 positions, you + can find it in the definition of enumShadowPos. + * @param pos + * @param offset the distance between the paragraph border and the shadow. + * @param color color to fill the shadow. + */ + void SetShadow(enumXFShadowPos pos, double offset, XFColor const & color); + + /** + * @descr The borders is complex, so you have to create one before use. + Very few paragraphs will already have borders property, this way + we can save much memory. + * @param pBorders borders of the paragraph, please reference the XFBorders. + */ + void SetBorders(XFBorders *pBorders); + + /** + * @descr Set drop caption of the paragraph. + * @param nLength number of chars to be dropped. + * @param nLines line of which the dropped chars will occupy. + */ + void SetDropCap(sal_Int16 nLength, sal_Int16 nLines, double fDistance = 0); + + /** + * @descr Set line height of the paragraph. + * @param type type of line height,fixed,space,percent or cm. + * @param value value of the line height + */ + void SetLineHeight(enumLHType type, double value); + + /** + * @descr Set background color of the paragraph. + * @param color value of the back color. + */ + void SetBackColor(XFColor const & color); + + /** + * @descr Set background image of the paragraph. + * @param image the background image to set. + */ + void SetBackImage(std::unique_ptr<XFBGImage>& rImage); + + /** + * descr You can only set one break property for every para style object. + */ + void SetBreaks(enumXFBreaks breaks); + + /** + * @descr Add a tab style. + */ + void AddTabStyle(enumXFTab type, double len, sal_Unicode leader, sal_Unicode delimiter); + + /** + * @descr for para style copy operator, sometimes you may need to override tab styles. + */ + void ClearTabStyles(); + + XFMargins& GetMargins(){return m_aMargin;} + + virtual enumXFStyle GetStyleFamily() override; + + virtual bool Equal(IXFStyle *pStyle) override; + + virtual void ToXml(IXFStream *strm) override; + + void SetNumberRight(bool bFlag){m_bNumberRight = bFlag;} + bool GetNumberRight() const {return m_bNumberRight;} + +protected: + OUString m_strMasterPage; + enumXFAlignType m_eAlignType; + + double m_fTextIndent; + XFColor m_aBackColor; + XFMargins m_aMargin; + XFPadding m_aPadding; + XFStyleContainer m_aTabs; + rtl::Reference<XFFont> m_pFont; + XFShadow m_aShadow; + std::unique_ptr<XFBorders> m_pBorders; + std::unique_ptr<XFBGImage> m_pBGImage; + XFDropcap m_aDropcap; + XFLineHeight m_aLineHeight; + XFBreaks m_aBreaks; + + sal_uInt32 m_nFlag; + bool m_bNumberRight; +}; + +inline void XFParaStyle::SetMasterPage(const OUString& master) +{ + m_strMasterPage = master; +} + +inline void XFParaStyle::SetBreaks(enumXFBreaks breaks) +{ + m_aBreaks.SetBreakType(breaks); +} + +inline void XFParaStyle::SetPadding(double left, double right, double top, double bottom) +{ + m_aPadding.SetLeft(left); + if( right == -1 ) + m_aPadding.SetRight(left); + else + m_aPadding.SetRight(right); + if( top == -1 ) + m_aPadding.SetTop(left); + else + m_aPadding.SetTop(top); + if( bottom == -1 ) + m_aPadding.SetBottom(left); + else + m_aPadding.SetBottom(bottom); +} + +inline void XFParaStyle::SetAlignType(enumXFAlignType eAlign) +{ + m_eAlignType = eAlign; +} + +inline void XFParaStyle::ClearTabStyles() +{ + m_aTabs.Reset(); +} + +inline const OUString& XFParaStyle::GetMasterPage() const +{ + return m_strMasterPage; +} + + +class XFDefaultParaStyle : public XFStyle +{ +public: + XFDefaultParaStyle(); + void SetTabDistance(double len); + enumXFStyle GetStyleFamily() override; + virtual void ToXml(IXFStream *pStrm) override; +private: + double m_fTabDistance; +}; + +inline void XFDefaultParaStyle::SetTabDistance(double len) +{ + m_fTabDistance = len; +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfplaceholder.hxx b/lotuswordpro/inc/xfilter/xfplaceholder.hxx new file mode 100644 index 000000000..1e730a8fe --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfplaceholder.hxx @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * place holder object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPLACEHOLDER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPLACEHOLDER_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontent.hxx> + +/** + * @brief + * Index entry object. + */ +class XFHolderStart : public XFContent +{ +public: + XFHolderStart(); + virtual ~XFHolderStart() override; + void SetType(const OUString& sType); + void SetDesc(const OUString& sDesc); + void SetPrompt(const OUString& sText); + void ToXml(IXFStream *pStrm) override; +private: + OUString m_strType; + OUString m_strDesc; + OUString m_strText; +}; + +XFHolderStart::XFHolderStart() +{ +} + +XFHolderStart::~XFHolderStart() +{ +} + +inline void XFHolderStart::SetType(const OUString& sType) +{ + m_strType = sType; +} + +inline void XFHolderStart::SetDesc(const OUString& sDesc) +{ + m_strDesc = sDesc; +} + +inline void XFHolderStart::SetPrompt(const OUString& sText) +{ + m_strText = sText; +} + +inline void XFHolderStart::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + pAttrList->AddAttribute( "text:placeholder-type",m_strType); + if (!m_strDesc.isEmpty()) + pAttrList->AddAttribute( "text:description", m_strDesc); + pStrm->StartElement( "text:placeholder" ); + if( !m_strText.isEmpty()) + pStrm->Characters(m_strText); +} + +class XFHolderEnd : public XFContent +{ +public: + XFHolderEnd(); + virtual ~XFHolderEnd() override; + void ToXml(IXFStream *pStrm) override; +}; + +XFHolderEnd::XFHolderEnd() +{ +} + +XFHolderEnd::~XFHolderEnd() +{ +} + +inline void XFHolderEnd::ToXml(IXFStream *pStrm) +{ + pStrm->EndElement( "text:placeholder" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfpoint.hxx b/lotuswordpro/inc/xfilter/xfpoint.hxx new file mode 100644 index 000000000..42ac4474f --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfpoint.hxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Represent a point. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPOINT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFPOINT_HXX + +class XFPoint +{ +public: + XFPoint() + { + m_fX = m_fY = 0; + } + + XFPoint(double x, double y) + { + m_fX = x; + m_fY = y; + } + +public: + void SetX(double x) + { + m_fX = x; + } + + void SetY(double y) + { + m_fY = y; + } + + double GetX() const + { + return m_fX; + } + + double GetY() const + { + return m_fY; + } + +private: + double m_fX; + double m_fY; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfrect.hxx b/lotuswordpro/inc/xfilter/xfrect.hxx new file mode 100644 index 000000000..ed450cfe4 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfrect.hxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Rect object + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFRECT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFRECT_HXX + +#include <xfilter/xfpoint.hxx> + +class XFRect +{ +public: + XFRect() + { + m_fWidth = m_fHeight = 0; + } + + XFRect(double x, double y, double width, double height):m_aPoint(x,y) + { + m_fWidth = width; + m_fHeight = height; + } + +public: + void SetX(double x) + { + m_aPoint.SetX(x); + } + + double GetX() const + { + return m_aPoint.GetX(); + } + + void SetY(double y) + { + m_aPoint.SetY(y); + } + + double GetY() const + { + return m_aPoint.GetY(); + } + + void SetWidth(double width) + { + m_fWidth = width; + } + + double GetWidth() const + { + return m_fWidth; + } + + void SetHeight(double height) + { + m_fHeight = height; + } + + double GetHeight() const + { + return m_fHeight; + } + + void SetStartPoint(const XFPoint& pt) + { + m_aPoint = pt; + } + + void SetSize(double width, double height) + { + m_fWidth = width; + m_fHeight = height; + } + +private: + XFPoint m_aPoint; + double m_fWidth; + double m_fHeight; +}; + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfrow.hxx b/lotuswordpro/inc/xfilter/xfrow.hxx new file mode 100644 index 000000000..009bdad95 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfrow.hxx @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Table row object. A table is consist by rows. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFROW_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFROW_HXX + +#include <xfilter/xfcell.hxx> +#include <xfilter/xfcontent.hxx> +#include <rtl/ref.hxx> +#include <map> + +class XFCell; +class XFTable; +class XFRow : public XFContent +{ +public: + XFRow(); + + virtual ~XFRow() override; + +public: + void AddCell(rtl::Reference<XFCell> const & rCell); + + void SetRepeated(sal_Int32 repeat); + + void SetRow(sal_Int32 row); + + void SetOwnerTable(XFTable *pTable); + + sal_Int32 GetRow() const; + + sal_Int32 GetCellCount() const; + + XFCell* GetCell(sal_Int32 col) const; + + XFTable* GetOwnerTable(); + + virtual void ToXml(IXFStream *pStrm) override; + + void RemoveCell(sal_Int32 cell); + +private: + XFTable *m_pOwnerTable; + std::map<sal_Int32, rtl::Reference<XFCell>> m_aCells; + sal_Int32 m_nRepeat; + sal_Int32 m_nRow; +}; + +inline void XFRow::SetRepeated(sal_Int32 repeat) +{ + m_nRepeat = repeat; +} + +inline void XFRow::SetRow(sal_Int32 row) +{ + m_nRow = row; +} + +inline void XFRow::SetOwnerTable(XFTable *pTable) +{ + m_pOwnerTable = pTable; +} + +inline sal_Int32 XFRow::GetRow() const +{ + return m_nRow; +} + +inline XFTable* XFRow::GetOwnerTable() +{ + return m_pOwnerTable; +} + +inline void XFRow::RemoveCell(sal_Int32 cell) +{ + m_aCells.erase(cell); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfrowstyle.hxx b/lotuswordpro/inc/xfilter/xfrowstyle.hxx new file mode 100644 index 000000000..8ca8d1223 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfrowstyle.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Table row style, ie. table row height. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFROWSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFROWSTYLE_HXX + +#include <xfilter/xfglobal.hxx> +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfcolor.hxx> + +class XFBGImage; +class XFRowStyle : public XFStyle +{ +public: + XFRowStyle(); + +public: + void SetRowHeight(double height); + + double GetRowHeight() const; + + void SetMinRowHeight(double height); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + double m_fHeight; + double m_fMinHeight; + XFColor m_aBackColor; +}; + +inline void XFRowStyle::SetRowHeight(double height) +{ + m_fHeight = height; +} + +inline void XFRowStyle::SetMinRowHeight(double height) +{ + m_fMinHeight = height; +} + +inline double XFRowStyle::GetRowHeight() const +{ + if (m_fMinHeight > FLOAT_MIN) + { + return m_fMinHeight; + } + + else if (m_fHeight > FLOAT_MIN) + { + return m_fHeight; + } + return 0; +} +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfruby.hxx b/lotuswordpro/inc/xfilter/xfruby.hxx new file mode 100644 index 000000000..d481d4758 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfruby.hxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * ruby text. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFRUBY_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFRUBY_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontent.hxx> + +class XFRubyStart : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +class XFRubyEnd : public XFContent +{ +public: + void SetText(const OUString& sText); + virtual void ToXml(IXFStream *pStrm) override; +private: + OUString m_strText; +}; + +void XFRubyStart::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + if( !GetStyleName().isEmpty()) + pAttrList->AddAttribute( "text:style-name", GetStyleName()); + pStrm->StartElement( "text:ruby" ); + pAttrList->Clear(); + pStrm->StartElement( "text:ruby-base" ); +} + +void XFRubyEnd::SetText(const OUString& sText) +{ + m_strText = sText; +} + +void XFRubyEnd::ToXml(IXFStream *pStrm) +{ + pStrm->EndElement( "text:ruby-base" ); + IXFAttrList *pAttrList = pStrm->GetAttrList(); + pAttrList->Clear(); + if( !GetStyleName().isEmpty()) + pAttrList->AddAttribute( "text:style-name", GetStyleName()); + pStrm->StartElement( "text:ruby-text" ); + if( !m_strText.isEmpty() ) + pStrm->Characters(m_strText); + pStrm->EndElement( "text:ruby-text" ); + pStrm->EndElement( "text:ruby" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfrubystyle.hxx b/lotuswordpro/inc/xfilter/xfrubystyle.hxx new file mode 100644 index 000000000..184e7126a --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfrubystyle.hxx @@ -0,0 +1,144 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * ruby style. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFRUBYSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFRUBYSTYLE_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfdefs.hxx> + +class XFRubyStyle : public XFStyle +{ +public: + XFRubyStyle() + : m_ePos(enumXFRubyLeft) + , m_eAlign(enumXFRubyLeft) + { + } + virtual void ToXml(IXFStream *strm) override; + void SetPosition(enumXFRubyPosition ePosition); + void SetAlignment(enumXFRubyPosition eAlignment); + enumXFStyle GetStyleFamily() override; + +private: + enumXFRubyPosition m_ePos; + enumXFRubyPosition m_eAlign; +}; + +void XFRubyStyle::SetPosition(enumXFRubyPosition ePosition) +{ + m_ePos = ePosition; +} +void XFRubyStyle::SetAlignment(enumXFRubyPosition eAlignment) +{ + m_eAlign = eAlignment; +} +enumXFStyle XFRubyStyle::GetStyleFamily() +{ + return enumXFStyleRuby; +} +void XFRubyStyle::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + OUString style = GetStyleName(); + + pAttrList->Clear(); + if( !style.isEmpty() ) + pAttrList->AddAttribute("style:name", GetStyleName()); + pAttrList->AddAttribute("style:family", "ruby"); + pStrm->StartElement("style:style"); + + pAttrList->Clear(); + + OUString sPos; + if (m_eAlign == enumXFRubyLeft) + { + sPos ="left"; + } + else if(m_eAlign == enumXFRubyRight) + { + sPos = "right"; + } + else if(m_eAlign == enumXFRubyCenter) + { + sPos = "center"; + } + if (!sPos.isEmpty()) + pAttrList->AddAttribute("style:ruby-align", sPos); + + OUString sAlign; + if (m_ePos == enumXFRubyTop) + { + sAlign = "above"; + } + else if(m_ePos == enumXFRubyBottom) + { + sAlign = "below"; + } + if (!sAlign.isEmpty()) + pAttrList->AddAttribute("style:ruby-position", sAlign); + + pStrm->StartElement("style:properties"); + pStrm->EndElement("style:properties"); + pStrm->EndElement("style:style"); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfsaxstream.hxx b/lotuswordpro/inc/xfilter/xfsaxstream.hxx new file mode 100644 index 000000000..e86f817ab --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfsaxstream.hxx @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Tool for sax writer. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSAXSTREAM_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSAXSTREAM_HXX + +#include <xfilter/ixfstream.hxx> +#include <memory> + +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> + +class XFSaxAttrList; +class IXFAttrList; + +/** + * @brief + * Sax stream object, XDocumentHandler wrapper. + */ +class XFSaxStream : public IXFStream +{ +public: + explicit XFSaxStream(css::uno::Reference<css::xml::sax::XDocumentHandler> const & xHandler); + + virtual ~XFSaxStream() override; + +public: + /** + * @descr Start document callback. + */ + virtual void StartDocument() override; + + /** + * @descr End document callback. + */ + virtual void EndDocument() override; + + /** + * @descr Start output element. + */ + virtual void StartElement(const OUString& oustr) override; + + /** + * @descr End output element. + */ + virtual void EndElement(const OUString& oustr) override; + + /** + * @descr Output Character section. + */ + virtual void Characters(const OUString& oustr) override; + + /** + * @descr Get the attribute list interface. + */ + virtual IXFAttrList* GetAttrList() override; + +private: + css::uno::Reference<css::xml::sax::XDocumentHandler> m_aHandler; + std::unique_ptr<XFSaxAttrList> m_pAttrList; +}; + +#endif //XFSAXSTREAM_INC + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfsection.hxx b/lotuswordpro/inc/xfilter/xfsection.hxx new file mode 100644 index 000000000..a855c6e89 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfsection.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Section object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSECTION_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSECTION_HXX + +#include <xfilter/xfcontentcontainer.hxx> + +/** + * @brief + * Section object. + */ +class XFSection : public XFContentContainer +{ +public: + XFSection(); + + virtual ~XFSection() override; + + /** + * @descr Output section object. + */ + virtual void ToXml(IXFStream* pStrm) override; + +private: + OUString m_strSectionName; + OUString m_strSourceLink; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfsectionstyle.hxx b/lotuswordpro/inc/xfilter/xfsectionstyle.hxx new file mode 100644 index 000000000..f112ab33f --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfsectionstyle.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Section style,whose family is "section" + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSECTIONSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSECTIONSTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfcolor.hxx> +#include <memory> + +class XFColumns; +/* + * @descr + * Section style, include background color,background image, columns and margins. + */ +class XFSectionStyle : public XFStyle +{ +public: + XFSectionStyle(); + + virtual ~XFSectionStyle() override; + +public: + void SetMarginLeft(double left); + + void SetMarginRight(double right); + + void SetColumns(XFColumns *pColumns); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + +private: + double m_fMarginLeft; + double m_fMarginRight; + XFColor m_aBackColor; + std::unique_ptr<XFColumns> m_pColumns; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfshadow.hxx b/lotuswordpro/inc/xfilter/xfshadow.hxx new file mode 100644 index 000000000..19b74c7fb --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfshadow.hxx @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Shadow object,now only used by paragraph object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSHADOW_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSHADOW_HXX + +#include <xfilter/ixfstream.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfdefs.hxx> + +/** + * @brief + * Shadow object. + */ +class XFShadow +{ +public: + XFShadow(); + +public: + /** + * @descr set shadow position. You can refer to enumXFShadowPos to get all possible positions. + */ + void SetPosition(enumXFShadowPos pos); + + /** + * @descr return shadow position. + */ + enumXFShadowPos GetPosition() const; + + /** + * @descr Set shadow offset from owner object. + */ + void SetOffset(double offset); + + /** + * @descr return shadow offset. + */ + double GetOffset() const; + + /** + * @descr Set shadow color. + */ + void SetColor(const XFColor& color); + + /** + * @descr return shadow color. + */ + const XFColor& GetColor() const; + + OUString ToString(); + + void ToXml(IXFStream *pStrm); + + friend bool operator==(XFShadow const & s1, XFShadow const & s2); + friend bool operator!=(XFShadow const & s1, XFShadow const & s2); +private: + enumXFShadowPos m_ePosition; + double m_fOffset; + XFColor m_aColor; +}; + +inline void XFShadow::SetPosition(enumXFShadowPos pos) +{ + m_ePosition = pos; +} + +inline enumXFShadowPos XFShadow::GetPosition() const +{ + return m_ePosition; +} + +inline void XFShadow::SetOffset(double offset) +{ + m_fOffset = offset; +} + +inline double XFShadow::GetOffset() const +{ + return m_fOffset; +} + +inline void XFShadow::SetColor(const XFColor& color) +{ + m_aColor = color; +} + +inline const XFColor& XFShadow::GetColor() const +{ + return m_aColor; +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfstyle.hxx b/lotuswordpro/inc/xfilter/xfstyle.hxx new file mode 100644 index 000000000..493f000c6 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfstyle.hxx @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Base style object . + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSTYLE_HXX + +#include <xfilter/ixfstyle.hxx> + +/** + * @brief + * implements ixfstyle interface. This is the base class for all concentrate style. + */ +class XFStyle : public IXFStyle +{ +public: + XFStyle(); + + virtual ~XFStyle() override; + + XFStyle(XFStyle const &) = default; + XFStyle(XFStyle &&) = default; + XFStyle & operator =(XFStyle const &) = default; + XFStyle & operator =(XFStyle &&) = default; + +public: + /** + * @descr get style name. + */ + virtual OUString GetStyleName() override; + + /** + * @descr set style name. + */ + virtual void SetStyleName(const OUString& styleName) override; + + /** + * @descr set parent style name. + */ + virtual OUString GetParentStyleName() override; + + /** + * @descr return parent style name. + */ + virtual void SetParentStyleName(const OUString& styleName) override; + + /** + * @descr get style family. + */ + virtual enumXFStyle GetStyleFamily() override; + + /** + * @descr decide whether two style are equal. + */ + virtual bool Equal(IXFStyle *pStyle) override; + +protected: + OUString m_strStyleName; + OUString m_strParentStyleName; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfstylecont.hxx b/lotuswordpro/inc/xfilter/xfstylecont.hxx new file mode 100644 index 000000000..5418f9a88 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfstylecont.hxx @@ -0,0 +1,150 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Style container,which response for special style,ie. text style. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSTYLECONT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSTYLECONT_HXX + +#include <xfilter/ixfstyle.hxx> +#include <vector> +#include <memory> + +class IXFStyle; + +struct IXFStyleRet +{ + IXFStyle* m_pStyle; + bool m_bOrigDeleted; + IXFStyleRet() + : m_pStyle(nullptr) + , m_bOrigDeleted(false) + { + } +}; + +/** + * @descr container object for styles. + * All styles can be placed into a style container. + */ +class XFStyleContainer +{ +public: + XFStyleContainer(){} + + explicit XFStyleContainer(const OUString& strStyleNamePrefix); + + XFStyleContainer(const XFStyleContainer& other) = delete; + + XFStyleContainer& operator=(const XFStyleContainer& other) = delete; + + virtual ~XFStyleContainer(); + +public: + /** + * @descr Add style to container. + * If the same style has exist, then pStyle will be deleted, and the same style will be return. + */ + IXFStyleRet AddStyle(std::unique_ptr<IXFStyle> pStyle); + + /** + * @descr Find the same style. + */ + IXFStyle* FindSameStyle(IXFStyle *pStyle); + + /** + * @descr get style by name. + */ + IXFStyle* FindStyle(const OUString& name); + + /** + * @descr clear container. + */ + void Reset(); + + /** + * @descr get count of styles in the container. + */ + size_t GetCount() const; + + /** + * @descr get style by index. + */ + const IXFStyle* Item(size_t index) const; + + /** + * @descr Output all style. + */ + virtual void ToXml(IXFStream *pStrm); + + friend bool operator==(XFStyleContainer& b1, XFStyleContainer& b2); + friend bool operator!=(XFStyleContainer& b1, XFStyleContainer& b2); +private: + static void ManageStyleFont(IXFStyle *pStyle); +private: + std::vector<std::unique_ptr<IXFStyle>> m_aStyles; + OUString m_strStyleNamePrefix; +}; + +inline size_t XFStyleContainer::GetCount() const +{ + return m_aStyles.size(); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfstylemanager.hxx b/lotuswordpro/inc/xfilter/xfstylemanager.hxx new file mode 100644 index 000000000..d2de7b575 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfstylemanager.hxx @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Style manager for the filter. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSTYLEMANAGER_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFSTYLEMANAGER_HXX + +#include <xfilter/xffontdecl.hxx> +#include <xfilter/xfstylecont.hxx> +#include <xfilter/xfconfigmanager.hxx> +#include <vector> + +class IXFStream; +class IXFStyle; +class XFParaStyle; +class XFTextStyle; +class XFLineNumberConfig; +class XFFootnoteConfig; +class XFEndnoteConfig; + +/** + * @brief + * Style manager for the filter. + * This is a global object, all styles will be placed here before output. + */ +class XFStyleManager +{ +public: + XFStyleManager(); + ~XFStyleManager(); + XFStyleManager(XFStyleManager&); + +public: + /** + * @descr clear all styles, called before load file. + */ + void Reset(); + + void AddFontDecl(XFFontDecl const & aFontDecl); + + IXFStyleRet AddStyle(std::unique_ptr<IXFStyle> pStyle); + + IXFStyle* FindStyle(const OUString& name); + + XFParaStyle* FindParaStyle(const OUString& name); + + XFTextStyle* FindTextStyle(const OUString& name); + + void SetLineNumberConfig(XFLineNumberConfig *pLNConfig); + + void SetFootnoteConfig(XFFootnoteConfig *pFNConfig); + + void SetEndnoteConfig(XFEndnoteConfig *pFNConfig); + + void ToXml(IXFStream *strm); + +private: + std::vector<XFFontDecl> s_aFontDecls; + //standard styles that can be inherited,<office:styles> + XFStyleContainer s_aStdTextStyles; + XFStyleContainer s_aStdParaStyles; + XFStyleContainer s_aStdStrokeDashStyles; + XFStyleContainer s_aStdAreaStyles; + XFStyleContainer s_aStdArrowStyles; + XFConfigManager s_aConfigManager; + //automatic styles,<office:automatic-styles> + XFStyleContainer s_aTextStyles; + XFStyleContainer s_aParaStyles; + XFStyleContainer s_aListStyles; + XFStyleContainer s_aSectionStyles; + XFStyleContainer s_aPageMasters; + XFStyleContainer s_aMasterpages; + XFStyleContainer s_aDateStyles; + XFStyleContainer s_aGraphicsStyles; + XFStyleContainer s_aTableStyles; + XFStyleContainer s_aTableCellStyles; + XFStyleContainer s_aTableRowStyles; + XFStyleContainer s_aTableColStyles; + std::unique_ptr<IXFStyle> s_pOutlineStyle; + XFStyleContainer s_aRubyStyles; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xftable.hxx b/lotuswordpro/inc/xfilter/xftable.hxx new file mode 100644 index 000000000..f36a1f295 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xftable.hxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Table object. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTABLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTABLE_HXX + +#include <xfilter/xfcontent.hxx> +#include <xfilter/xfrow.hxx> +#include <xfilter/xfcell.hxx> +#include <xfilter/xfcontentcontainer.hxx> +#include <map> +#include <vector> + +class XFTable : public XFContent +{ +public: + XFTable(); + + virtual ~XFTable() override; + +public: + void SetTableName(const OUString& name); + + void SetColumnStyle(sal_Int32 col, const OUString& style); + + void AddRow(rtl::Reference<XFRow> const & rRow); + + void AddHeaderRow(XFRow *pRow); + +public: + void SetOwnerCell(XFCell *pCell); + + OUString GetTableName(); + + sal_uInt16 GetRowCount(); + + XFRow* GetRow(sal_Int32 row); + + sal_Int32 GetColumnCount(); + + bool IsSubTable() const; + + enumXFContent GetContentType() override; + + virtual void ToXml(IXFStream *pStrm) override; + + void RemoveRow(sal_uInt16 row) + { + m_aRows.erase(row); + } + +private: + OUString m_strName; + bool m_bSubTable; + XFCell *m_pOwnerCell; + rtl::Reference<XFContentContainer> m_aHeaderRows; + std::map<sal_uInt16, rtl::Reference<XFRow>> m_aRows; + std::map<sal_Int32,OUString> m_aColumns; + OUString m_strDefCellStyle; + OUString m_strDefRowStyle; + OUString m_strDefColStyle; +}; + +inline void XFTable::SetTableName(const OUString& name) +{ + m_strName = name; +} + +inline void XFTable::SetOwnerCell(XFCell *pCell) +{ + m_pOwnerCell = pCell; + m_bSubTable = (pCell!=nullptr); +} + +inline bool XFTable::IsSubTable() const +{ + return m_bSubTable; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xftablestyle.hxx b/lotuswordpro/inc/xfilter/xftablestyle.hxx new file mode 100644 index 000000000..7fff8c45e --- /dev/null +++ b/lotuswordpro/inc/xfilter/xftablestyle.hxx @@ -0,0 +1,134 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Table style. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTABLESTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTABLESTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <xfilter/xfmargins.hxx> +#include <xfilter/xfshadow.hxx> +#include <xfilter/xfcolor.hxx> +#include <xfilter/xfbreaks.hxx> +#include <memory> + +class XFBGImage; +class XFTableStyle : public XFStyle +{ +public: + XFTableStyle(); + + virtual ~XFTableStyle() override; + +public: + void SetWidth(double width); + + void SetAlign(enumXFAlignType eAlign, double offset = 0); + + void SetShadow(enumXFShadowPos pos, double offset, XFColor color ); + + void SetBackColor(XFColor const & color); + + void SetBackImage(std::unique_ptr<XFBGImage>& rImage); + + virtual void ToXml(IXFStream *pStrm) override; + + virtual enumXFStyle GetStyleFamily() override; + +private: + double m_fWidth; + XFColor m_aBackColor; + std::unique_ptr<XFBGImage> m_pBGImage; + XFShadow m_aShadow; + XFMargins m_aMargins; + XFBreaks m_aBreaks; + enumXFAlignType m_eAlign; +}; + +inline void XFTableStyle::SetWidth(double width) +{ + m_fWidth = width; +} + +inline void XFTableStyle::SetAlign(enumXFAlignType eAlign, double offset) +{ + m_eAlign = eAlign; + if( m_eAlign == enumXFAlignStart ) + { + m_aMargins.SetLeft(offset); + m_aMargins.SetRight(0); + m_aMargins.SetTop(0); + m_aMargins.SetBottom(0); + } +} + +inline void XFTableStyle::SetShadow(enumXFShadowPos pos, double offset, XFColor color) +{ + m_aShadow.SetColor(color); + m_aShadow.SetOffset(offset); + m_aShadow.SetPosition(pos); +} + +inline void XFTableStyle::SetBackColor(XFColor const & color) +{ + m_aBackColor = color; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xftabstop.hxx b/lotuswordpro/inc/xfilter/xftabstop.hxx new file mode 100644 index 000000000..2f5ad8930 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xftabstop.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************** + * @file + * Tab stop object,<text:tab-stop/> + *************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTABSTOP_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTABSTOP_HXX + +#include <xfilter/ixfattrlist.hxx> +#include <xfilter/xfcontent.hxx> + +class XFTabStop : public XFContent +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +inline void XFTabStop::ToXml(IXFStream *pStrm) +{ + IXFAttrList *pAttrList = pStrm->GetAttrList(); + + pAttrList->Clear(); + pStrm->StartElement( "text:tab-stop" ); + pStrm->EndElement( "text:tab-stop" ); +} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xftextboxstyle.hxx b/lotuswordpro/inc/xfilter/xftextboxstyle.hxx new file mode 100644 index 000000000..e1b5bbaf1 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xftextboxstyle.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTEXTBOXSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTEXTBOXSTYLE_HXX + +#include <xfilter/xfstyle.hxx> + +/** +* @brief +* Style for all frame objects. +*/ +class XFTextBoxStyle : public XFStyle +{ +public: + XFTextBoxStyle(); + + virtual ~XFTextBoxStyle() override; + +public: + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream* pStrm) override; + +protected: +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xftextcontent.hxx b/lotuswordpro/inc/xfilter/xftextcontent.hxx new file mode 100644 index 000000000..dca2c69c2 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xftextcontent.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTEXTCONTENT_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTEXTCONTENT_HXX + +#include <xfilter/xfcontent.hxx> + +class IXFStream; + +/** + * @brief + * Adapter for text to content. + */ +class XFTextContent : public XFContent +{ +public: + XFTextContent() {} + + explicit XFTextContent(const OUString& text); + + virtual ~XFTextContent() override; + +public: + /** + * @descr Set the text. + */ + void SetText(const OUString& text); + + virtual enumXFContent GetContentType() override; + + virtual void ToXml(IXFStream* pStrm) override; + +private: + OUString m_strText; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xftextspan.hxx b/lotuswordpro/inc/xfilter/xftextspan.hxx new file mode 100644 index 000000000..2e210f357 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xftextspan.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * An span of text with style. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTEXTSPAN_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTEXTSPAN_HXX + +#include <sal/config.h> + +#include <vector> + +#include <rtl/ref.hxx> + +#include <xfilter/xfcontent.hxx> + +class IXFStream; + +class XFTextSpan : public XFContent +{ +public: + XFTextSpan(); + XFTextSpan(const OUString& text, const OUString& style ); + + virtual ~XFTextSpan() override; + + void Add(XFContent *pContent); + void Add(const OUString& text); + + virtual enumXFContent GetContentType() override; + virtual void ToXml(IXFStream *pStrm) override; +protected: + std::vector< rtl::Reference<XFContent> > m_aContents; +}; + +class XFTextSpanStart : public XFTextSpan //for adding style of power field +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; +class XFTextSpanEnd : public XFTextSpan //for adding style of power field +{ +public: + virtual void ToXml(IXFStream *pStrm) override; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xftextstyle.hxx b/lotuswordpro/inc/xfilter/xftextstyle.hxx new file mode 100644 index 000000000..2774426d7 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xftextstyle.hxx @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Style for <text:p> or <text:h> or <text:span> + * Now we have only font attributes. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTEXTSTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTEXTSTYLE_HXX + +#include <sal/config.h> + +#include <rtl/ref.hxx> + +#include <xfilter/xfstyle.hxx> + +class IXFStream; +class XFFont; + +class XFTextStyle : public XFStyle +{ +public: + XFTextStyle(); + + virtual ~XFTextStyle() override; + + XFTextStyle(XFTextStyle const &) = default; + XFTextStyle(XFTextStyle &&) = default; + XFTextStyle & operator =(XFTextStyle const &) = default; + XFTextStyle & operator =(XFTextStyle &&) = default; + +public: + /** + * @descr: set the font for the text span. + */ + void SetFont(rtl::Reference<XFFont> const & font); + + const rtl::Reference<XFFont>& GetFont() const { return m_pFont; } + + virtual enumXFStyle GetStyleFamily() override; + + virtual bool Equal(IXFStyle *pStyle) override; + + virtual void ToXml(IXFStream *strm) override; + +private: + rtl::Reference<XFFont> m_pFont; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xftimestyle.hxx b/lotuswordpro/inc/xfilter/xftimestyle.hxx new file mode 100644 index 000000000..f27637cb6 --- /dev/null +++ b/lotuswordpro/inc/xfilter/xftimestyle.hxx @@ -0,0 +1,195 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Time style. The Time format for time field. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTIMESTYLE_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFTIMESTYLE_HXX + +#include <xfilter/xfstyle.hxx> +#include <vector> + +class XFDateTimePart : public XFStyle +{ +public: + XFDateTimePart() + : m_ePart(enumXFDateUnknown) + , m_bLongFmt(false) + {} + + void SetPartType(enumXFDatePart ePart); + + void SetLongFmt(bool bLongFmt); + + void SetText(const OUString& text); + +protected: + enumXFDatePart m_ePart; + bool m_bLongFmt; + OUString m_strText; +}; + +class XFTimePart : public XFDateTimePart +{ +public: + XFTimePart(); + + void SetDecimalPos(sal_Int32 pos); + + virtual void ToXml(IXFStream *pStrm) override; + +protected: + sal_Int32 m_nDecimalPos; +}; + +class XFTimeStyle : public XFStyle +{ +public: + XFTimeStyle(); + + virtual ~XFTimeStyle() override; + +public: + + void AddHour( bool bLongFmt = true ); + + void AddMinute( bool bLongFmt = true ); + + void AddSecond( bool bLongFmt = true ); + + void SetAmPm(bool bAmPm); + + void AddText( const OUString& part ); + + virtual enumXFStyle GetStyleFamily() override; + + virtual void ToXml(IXFStream *pStrm) override; + + void SetTruncate(bool bTrunc); + +private: + bool m_bAmPm; + std::vector<XFTimePart> m_aParts; + bool m_bTruncate; +}; + +inline void XFDateTimePart::SetPartType(enumXFDatePart ePart) +{ + m_ePart = ePart; +} + +inline void XFDateTimePart::SetLongFmt(bool bLongFmt) +{ + m_bLongFmt = bLongFmt; +} + +inline void XFDateTimePart::SetText(const OUString& text) +{ + m_strText = text; +} + +inline void XFTimePart::SetDecimalPos(sal_Int32 pos) +{ + m_nDecimalPos = pos; +} + +inline void XFTimeStyle::AddHour( bool bLongFmt ) +{ + XFTimePart part; + part.SetPartType(enumXFDateHour); + part.SetLongFmt(bLongFmt); + m_aParts.push_back(part); +} + +inline void XFTimeStyle::AddMinute( bool bLongFmt ) +{ + XFTimePart part; + part.SetPartType(enumXFDateMinute); + part.SetLongFmt(bLongFmt); + m_aParts.push_back(part); +} + +inline void XFTimeStyle::AddSecond( bool bLongFmt ) +{ + XFTimePart part; + part.SetPartType(enumXFDateSecond); + part.SetLongFmt(bLongFmt); + part.SetDecimalPos(0); + m_aParts.push_back(part); +} + +inline void XFTimeStyle::SetAmPm(bool bAmPm) +{ + m_bAmPm = bAmPm; +} + +inline void XFTimeStyle::AddText( const OUString& text ) +{ + XFTimePart part; + part.SetPartType(enumXFDateText); + part.SetText(text); + m_aParts.push_back(part); +} + +inline void XFTimeStyle::SetTruncate(bool bTrunc) +{ + m_bTruncate = bTrunc; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lotuswordpro/inc/xfilter/xfutil.hxx b/lotuswordpro/inc/xfilter/xfutil.hxx new file mode 100644 index 000000000..8d2f9225c --- /dev/null +++ b/lotuswordpro/inc/xfilter/xfutil.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: IBM Corporation + * + * Copyright: 2008 by IBM Corporation + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* + * @file + * Tool functions for xml filter. + * Don't use any template for the ***TOOUString function list for easy. + ************************************************************************/ +#ifndef INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFUTIL_HXX +#define INCLUDED_LOTUSWORDPRO_INC_XFILTER_XFUTIL_HXX + +#include <xfilter/xfdefs.hxx> +#include <rtl/ustring.hxx> + +OUString GetTableColName(sal_Int32 col); + +OUString GetUnderlineName(enumXFUnderline type); + +OUString GetCrossoutName(enumXFCrossout type); + +OUString GetTransformName(enumXFTransform type); + +OUString GetTextDirName(enumXFTextDir dir); + +OUString GetFrameXPos(enumXFFrameXPos pos); + +OUString GetFrameXRel(enumXFFrameXRel rel); + +OUString GetFrameYPos(enumXFFrameYPos pos); + +OUString GetFrameYRel(enumXFFrameYRel rel); + +OUString GetAlignName(enumXFAlignType align); + +OUString GetPageUsageName(enumXFPageUsage usage); + +OUString GetValueType(enumXFValueType type); + +OUString GetColorMode(enumXFColorMode mode); + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |