LibreOffice Module lotuswordpro (master) 1
lwpstory.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
6 *
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
9 *
10 * Sun Microsystems Inc., October, 2000
11 *
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 *
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 *
31 *
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
38 *
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
45 *
46 * The Initial Developer of the Original Code is: IBM Corporation
47 *
48 * Copyright: 2008 by IBM Corporation
49 *
50 * All Rights Reserved.
51 *
52 * Contributor(s): _______________________________________
53 *
54 *
55 ************************************************************************/
56/*************************************************************************
57 * @file
58 * LwpStory:
59 1. Word Pro object for paragraph list;
60 2. the content of layout object
61 ************************************************************************/
62
63#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSTORY_HXX
64#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPSTORY_HXX
65
66#include <memory>
67#include "lwpcontent.hxx"
68#include "lwphyperlinkmgr.hxx"
69
70class LwpPageLayout;
71class LwpStory final : public LwpContent
72{
73public:
74 LwpStory(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
75 virtual ~LwpStory() override;
76
77private:
78 //File format members:
81
82 // for bullet , 05/23/2005
83 typedef std::pair<OUString, sal_uInt8> NamePosPair;
84 std::vector<NamePosPair> m_vBulletStyleNameList;
85
86 // , 02/16/2005
88 LwpPageLayout* m_pCurrentLayout; //for register page layout style
89 std::vector<LwpPageLayout*> m_LayoutList;
90 LwpLayout* m_pTabLayout; //for register tab style
91
93 std::unique_ptr<LwpHyperlinkMgr> m_pHyperlinkMgr;
95
97
98 void Read() override;
102
103public:
104 void RegisterStyle() override;
105 void Parse(IXFStream* pOutputStream) override;
106 virtual void XFConvert(XFContentContainer* pCont) override;
108 inline LwpObjectID& GetFirstPara();
109 inline LwpObjectID& GetLastPara();
111 void AddXFContent(XFContent* pContent);
112
113 bool GetDropcapFlag() const { return m_bDropcap; }
115 inline LwpMiddleLayout* GetTabLayout(); //for register tab style
116 const OUString& GetSectionName() const { return m_CurrSectionName; }
118
119 bool IsPMModified() const { return m_bPMModified; }
120 inline void SetPMModified(bool bPMModified);
121 inline void SetDropcapFlag(bool bFlag);
122 inline void SetTabLayout(LwpLayout* pLayout);
123 inline void SetSectionName(const OUString& StyleName);
124
125 void SetCurrentLayout(LwpPageLayout* pPageLayout);
127 bool IsNeedSection();
128 void SortPageLayout();
129
131
132 OUString GetContentText(bool bAllText = false);
133 inline void AddBullStyleName2List(const OUString& rStyleName, sal_uInt8 nPos);
134 bool IsBullStyleUsedBefore(const OUString& rStyleName, sal_uInt8 nPos);
135
136 OUString RegisterFirstFribStyle();
137};
138
142{
143 if (m_pTabLayout)
144 return m_pTabLayout;
145 return dynamic_cast<LwpMiddleLayout*>(GetLayout(nullptr).get());
146}
147void LwpStory::SetPMModified(bool bPMModified) { m_bPMModified = bPMModified; }
148void LwpStory::SetDropcapFlag(bool bFlag) { m_bDropcap = bFlag; }
149void LwpStory::SetTabLayout(LwpLayout* pLayout) { m_pTabLayout = pLayout; }
150void LwpStory::SetSectionName(const OUString& StyleName) { m_CurrSectionName = StyleName; }
151inline void LwpStory::AddBullStyleName2List(const OUString& rStyleName, sal_uInt8 nPos)
152{
153 m_vBulletStyleNameList.push_back(std::make_pair(rStyleName, nPos));
154}
155
156#endif
157
158/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
Base class of all Lwp content objects.
Definition: lwpcontent.hxx:74
rtl::Reference< LwpVirtualLayout > GetLayout(LwpVirtualLayout const *pStartLayout)
Definition: lwpcontent.cxx:124
Double Linked Virtual List Head Tail.
Definition: lwpdlvlist.hxx:138
LwpObjectID & GetTail()
Definition: lwpdlvlist.hxx:149
LwpObjectID & GetHead()
Definition: lwpdlvlist.hxx:148
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
object id class
Definition: lwpobjid.hxx:79
void SetTabLayout(LwpLayout *pLayout)
Definition: lwpstory.hxx:149
rtl::Reference< XFContentContainer > m_xXFContainer
Definition: lwpstory.hxx:96
bool m_bPMModified
Definition: lwpstory.hxx:87
bool IsPMModified() const
Definition: lwpstory.hxx:119
void XFConvertFrameInHeaderFooter(XFContentContainer *pCont)
Definition: lwpstory.cxx:372
bool IsBullStyleUsedBefore(const OUString &rStyleName, sal_uInt8 nPos)
Definition: lwpstory.cxx:470
std::unique_ptr< LwpHyperlinkMgr > m_pHyperlinkMgr
Definition: lwpstory.hxx:93
virtual void XFConvert(XFContentContainer *pCont) override
@descr default XFConvert function pCont is the XFContentContainer for the object conversion
Definition: lwpstory.cxx:101
bool GetDropcapFlag() const
Definition: lwpstory.hxx:113
bool m_bDropcap
Definition: lwpstory.hxx:92
void XFConvertFrameInCell(XFContentContainer *pCont)
Definition: lwpstory.cxx:295
LwpStory(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwpstory.cxx:76
bool IsNeedSection()
Definition: lwpstory.cxx:246
void SortPageLayout()
Definition: lwpstory.cxx:197
LwpDLVListHeadTail m_ParaList
Definition: lwpstory.hxx:79
LwpPageLayout * m_pCurrentLayout
Definition: lwpstory.hxx:88
void SetSectionName(const OUString &StyleName)
Definition: lwpstory.hxx:150
LwpObjectID & GetLastPara()
Definition: lwpstory.hxx:140
LwpLayout * m_pTabLayout
Definition: lwpstory.hxx:90
const OUString & GetSectionName() const
Definition: lwpstory.hxx:116
OUString m_CurrSectionName
Definition: lwpstory.hxx:94
XFContentContainer * GetXFContent()
Definition: lwpstory.cxx:401
void Read() override
@descr default read function
Definition: lwpstory.cxx:90
void SetCurrentLayout(LwpPageLayout *pPageLayout)
Definition: lwpstory.cxx:168
void RegisterStyle() override
@descr default register style function
Definition: lwpstory.cxx:141
LwpObjectID m_FirstParaStyle
Definition: lwpstory.hxx:80
void SetDropcapFlag(bool bFlag)
Definition: lwpstory.hxx:148
void SetPMModified(bool bPMModified)
Definition: lwpstory.hxx:147
void AddXFContent(XFContent *pContent)
Definition: lwpstory.cxx:395
void AddBullStyleName2List(const OUString &rStyleName, sal_uInt8 nPos)
Definition: lwpstory.hxx:151
LwpMiddleLayout * GetTabLayout()
Definition: lwpstory.hxx:141
OUString RegisterFirstFribStyle()
Definition: lwpstory.cxx:449
void Parse(IXFStream *pOutputStream) override
@descr default parse function
Definition: lwpstory.cxx:156
LwpObjectID & GetFirstPara()
Definition: lwpstory.hxx:139
LwpHyperlinkMgr * GetHyperlinkMgr()
Definition: lwpstory.hxx:117
OUString GetContentText(bool bAllText=false)
Definition: lwpstory.cxx:419
LwpPageLayout * GetCurrentLayout()
Definition: lwpstory.hxx:114
void XFConvertFrameInFrame(XFContentContainer *pCont)
Definition: lwpstory.cxx:348
std::vector< LwpPageLayout * > m_LayoutList
Definition: lwpstory.hxx:89
virtual ~LwpStory() override
Definition: lwpstory.cxx:86
std::pair< OUString, sal_uInt8 > NamePosPair
Definition: lwpstory.hxx:83
LwpPara * GetLastParaOfPreviousStory()
Definition: lwpstory.cxx:406
LwpPageLayout * GetNextPageLayout()
Definition: lwpstory.cxx:187
std::vector< NamePosPair > m_vBulletStyleNameList
Definition: lwpstory.hxx:84
void XFConvertFrameInPage(XFContentContainer *pCont)
Definition: lwpstory.cxx:321
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
A container for content.
@descr Base class for all content object.
Definition: xfcontent.hxx:80
sal_uInt16 nPos
unsigned char sal_uInt8