1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*1d2dbeb0SAndrew Rist * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist *
11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist *
13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the
17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist * under the License.
19*1d2dbeb0SAndrew Rist *
20*1d2dbeb0SAndrew Rist *************************************************************/
21*1d2dbeb0SAndrew Rist
22*1d2dbeb0SAndrew Rist
23cdf0e10cSrcweir #ifndef _TXTATR_HXX
24cdf0e10cSrcweir #define _TXTATR_HXX
25cdf0e10cSrcweir
26cdf0e10cSrcweir #include <txatbase.hxx> // SwTxtAttr/SwTxtAttrEnd
27cdf0e10cSrcweir #include <calbck.hxx>
28cdf0e10cSrcweir
29cdf0e10cSrcweir
30cdf0e10cSrcweir class SwTxtNode; // fuer SwTxtFld
31cdf0e10cSrcweir class SwCharFmt;
32cdf0e10cSrcweir
33cdf0e10cSrcweir namespace sw {
34cdf0e10cSrcweir class MetaFieldManager;
35cdf0e10cSrcweir }
36cdf0e10cSrcweir
37cdf0e10cSrcweir
38cdf0e10cSrcweir // ATT_CHARFMT *********************************************
39cdf0e10cSrcweir
40cdf0e10cSrcweir class SwTxtCharFmt : public SwTxtAttrEnd
41cdf0e10cSrcweir {
42cdf0e10cSrcweir SwTxtNode * m_pTxtNode;
43cdf0e10cSrcweir sal_uInt16 m_nSortNumber;
44cdf0e10cSrcweir
45cdf0e10cSrcweir public:
46cdf0e10cSrcweir SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
47cdf0e10cSrcweir virtual ~SwTxtCharFmt( );
48cdf0e10cSrcweir
49cdf0e10cSrcweir // werden vom SwFmtCharFmt hierher weitergeleitet (no derivation from SwClient!)
50cdf0e10cSrcweir void ModifyNotification( const SfxPoolItem*, const SfxPoolItem* );
51cdf0e10cSrcweir bool GetInfo( SfxPoolItem& rInfo ) const;
52cdf0e10cSrcweir
53cdf0e10cSrcweir // get and set TxtNode pointer
ChgTxtNode(SwTxtNode * pNew)54cdf0e10cSrcweir void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
55cdf0e10cSrcweir
SetSortNumber(sal_uInt16 nSortNumber)56cdf0e10cSrcweir void SetSortNumber( sal_uInt16 nSortNumber ) { m_nSortNumber = nSortNumber; }
GetSortNumber() const57cdf0e10cSrcweir sal_uInt16 GetSortNumber() const { return m_nSortNumber; }
58cdf0e10cSrcweir };
59cdf0e10cSrcweir
60cdf0e10cSrcweir
61cdf0e10cSrcweir // ******************************
62cdf0e10cSrcweir
63cdf0e10cSrcweir class SwTxtAttrNesting : public SwTxtAttrEnd
64cdf0e10cSrcweir {
65cdf0e10cSrcweir protected:
66cdf0e10cSrcweir SwTxtAttrNesting( SfxPoolItem & i_rAttr,
67cdf0e10cSrcweir const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
68cdf0e10cSrcweir virtual ~SwTxtAttrNesting();
69cdf0e10cSrcweir };
70cdf0e10cSrcweir
71cdf0e10cSrcweir class SwTxtMeta : public SwTxtAttrNesting
72cdf0e10cSrcweir {
73cdf0e10cSrcweir private:
74cdf0e10cSrcweir SwTxtMeta( SwFmtMeta & i_rAttr,
75cdf0e10cSrcweir const xub_StrLen i_nStart, const xub_StrLen i_nEnd );
76cdf0e10cSrcweir
77cdf0e10cSrcweir public:
78cdf0e10cSrcweir static SwTxtMeta * CreateTxtMeta(
79cdf0e10cSrcweir ::sw::MetaFieldManager & i_rTargetDocManager,
80cdf0e10cSrcweir SwTxtNode *const i_pTargetTxtNode,
81cdf0e10cSrcweir SwFmtMeta & i_rAttr,
82cdf0e10cSrcweir xub_StrLen const i_nStart, xub_StrLen const i_nEnd,
83cdf0e10cSrcweir bool const i_bIsCopy);
84cdf0e10cSrcweir
85cdf0e10cSrcweir virtual ~SwTxtMeta();
86cdf0e10cSrcweir
87cdf0e10cSrcweir void ChgTxtNode(SwTxtNode * const pNode);
88cdf0e10cSrcweir };
89cdf0e10cSrcweir
90cdf0e10cSrcweir
91cdf0e10cSrcweir // ******************************
92cdf0e10cSrcweir
93cdf0e10cSrcweir class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient
94cdf0e10cSrcweir {
95cdf0e10cSrcweir SwTxtNode* m_pTxtNode;
96cdf0e10cSrcweir protected:
97cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
98cdf0e10cSrcweir public:
99cdf0e10cSrcweir SwTxtRuby( SwFmtRuby& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
100cdf0e10cSrcweir virtual ~SwTxtRuby();
101cdf0e10cSrcweir TYPEINFO();
102cdf0e10cSrcweir
103cdf0e10cSrcweir virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
104cdf0e10cSrcweir
105cdf0e10cSrcweir SW_DLLPRIVATE void InitRuby(SwTxtNode & rNode);
106cdf0e10cSrcweir
107cdf0e10cSrcweir /// get and set TxtNode pointer
GetpTxtNode() const108cdf0e10cSrcweir const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
109cdf0e10cSrcweir inline const SwTxtNode& GetTxtNode() const;
ChgTxtNode(SwTxtNode * pNew)110cdf0e10cSrcweir void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
111cdf0e10cSrcweir
112cdf0e10cSrcweir SwCharFmt* GetCharFmt();
GetCharFmt() const113cdf0e10cSrcweir const SwCharFmt* GetCharFmt() const
114cdf0e10cSrcweir { return (const_cast<SwTxtRuby*>(this))->GetCharFmt(); }
115cdf0e10cSrcweir };
116cdf0e10cSrcweir
117cdf0e10cSrcweir // --------------- Inline Implementierungen ------------------------
118cdf0e10cSrcweir
GetTxtNode() const119cdf0e10cSrcweir inline const SwTxtNode& SwTxtRuby::GetTxtNode() const
120cdf0e10cSrcweir {
121cdf0e10cSrcweir ASSERT( m_pTxtNode, "SwTxtRuby: where is my TxtNode?" );
122cdf0e10cSrcweir return *m_pTxtNode;
123cdf0e10cSrcweir }
124cdf0e10cSrcweir
125cdf0e10cSrcweir #endif
126