Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_SW_INC_TXTATR_HXX
20 : #define INCLUDED_SW_INC_TXTATR_HXX
21 :
22 : #include <txatbase.hxx>
23 : #include <calbck.hxx>
24 :
25 : class SwTxtNode;
26 : class SwCharFmt;
27 :
28 : namespace sw {
29 : class MetaFieldManager;
30 : }
31 :
32 : class SwTxtCharFmt : public SwTxtAttrEnd
33 : {
34 : SwTxtNode * m_pTxtNode;
35 : sal_uInt16 m_nSortNumber;
36 :
37 : public:
38 : SwTxtCharFmt( SwFmtCharFmt& rAttr, sal_Int32 nStart, sal_Int32 nEnd );
39 : virtual ~SwTxtCharFmt( );
40 :
41 : // Passed from SwFmtCharFmt (no derivation from SwClient!).
42 : void ModifyNotification( const SfxPoolItem*, const SfxPoolItem* );
43 : bool GetInfo( SfxPoolItem& rInfo ) const;
44 :
45 : // get and set TxtNode pointer
46 12214 : void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
47 :
48 152 : void SetSortNumber( sal_uInt16 nSortNumber ) { m_nSortNumber = nSortNumber; }
49 26856 : sal_uInt16 GetSortNumber() const { return m_nSortNumber; }
50 : };
51 :
52 :
53 : class SwTxtMeta : public SwTxtAttrNesting
54 : {
55 : private:
56 : SwTxtMeta( SwFmtMeta & i_rAttr,
57 : const sal_Int32 i_nStart, const sal_Int32 i_nEnd );
58 :
59 : public:
60 : static SwTxtMeta * CreateTxtMeta(
61 : ::sw::MetaFieldManager & i_rTargetDocManager,
62 : SwTxtNode *const i_pTargetTxtNode,
63 : SwFmtMeta & i_rAttr,
64 : sal_Int32 const i_nStart, sal_Int32 const i_nEnd,
65 : bool const i_bIsCopy);
66 :
67 : virtual ~SwTxtMeta();
68 :
69 : void ChgTxtNode(SwTxtNode * const pNode);
70 : };
71 :
72 :
73 : class SW_DLLPUBLIC SwTxtRuby : public SwTxtAttrNesting, public SwClient
74 : {
75 : SwTxtNode* m_pTxtNode;
76 : protected:
77 : virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
78 : public:
79 : SwTxtRuby( SwFmtRuby& rAttr, sal_Int32 nStart, sal_Int32 nEnd );
80 : virtual ~SwTxtRuby();
81 : TYPEINFO_OVERRIDE();
82 :
83 : virtual bool GetInfo( SfxPoolItem& rInfo ) const SAL_OVERRIDE;
84 :
85 : SAL_DLLPRIVATE void InitRuby(SwTxtNode & rNode);
86 :
87 : /// Get and set TxtNode pointer.
88 : const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
89 : inline const SwTxtNode& GetTxtNode() const;
90 362 : void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
91 :
92 : SwCharFmt* GetCharFmt();
93 336 : const SwCharFmt* GetCharFmt() const
94 336 : { return (const_cast<SwTxtRuby*>(this))->GetCharFmt(); }
95 : };
96 :
97 336 : inline const SwTxtNode& SwTxtRuby::GetTxtNode() const
98 : {
99 : assert( m_pTxtNode );
100 336 : return *m_pTxtNode;
101 : }
102 :
103 : #endif
104 :
105 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|