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_FMTRUBY_HXX
20 : #define INCLUDED_SW_INC_FMTRUBY_HXX
21 :
22 : #include <svl/poolitem.hxx>
23 :
24 : class SwTxtRuby;
25 :
26 : class SW_DLLPUBLIC SwFmtRuby : public SfxPoolItem
27 : {
28 : friend class SwTxtRuby;
29 :
30 : OUString sRubyTxt; ///< The ruby txt.
31 : OUString sCharFmtName; ///< Name of the charformat.
32 : SwTxtRuby* pTxtAttr; ///< The TextAttribute.
33 : sal_uInt16 nCharFmtId; ///< PoolId of the charformat.
34 : sal_uInt16 nPosition; ///< Position of the Ruby-character.
35 : sal_uInt16 nAdjustment; ///< Specific adjustment of the Ruby-ch.
36 :
37 : public:
38 : SwFmtRuby( const OUString& rRubyTxt );
39 : SwFmtRuby( const SwFmtRuby& rAttr );
40 : virtual ~SwFmtRuby();
41 :
42 : SwFmtRuby& operator=( const SwFmtRuby& rAttr );
43 :
44 : // "Pure virtual methods" of SfxPoolItem.
45 : virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
46 : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const SAL_OVERRIDE;
47 :
48 : virtual bool GetPresentation( SfxItemPresentation ePres,
49 : SfxMapUnit eCoreMetric,
50 : SfxMapUnit ePresMetric,
51 : OUString &rText,
52 : const IntlWrapper* pIntl = 0 ) const SAL_OVERRIDE;
53 :
54 : virtual bool QueryValue( com::sun::star::uno::Any& rVal,
55 : sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE;
56 : virtual bool PutValue( const com::sun::star::uno::Any& rVal,
57 : sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
58 :
59 12 : const SwTxtRuby* GetTxtRuby() const { return pTxtAttr; }
60 : SwTxtRuby* GetTxtRuby() { return pTxtAttr; }
61 :
62 672 : OUString GetText() const { return sRubyTxt; }
63 0 : void SetText( const OUString& rTxt ) { sRubyTxt = rTxt; }
64 :
65 336 : OUString GetCharFmtName() const { return sCharFmtName; }
66 8 : void SetCharFmtName( const OUString& rNm ) { sCharFmtName = rNm; }
67 :
68 60 : sal_uInt16 GetCharFmtId() const { return nCharFmtId; }
69 16 : void SetCharFmtId( sal_uInt16 nNew ) { nCharFmtId = nNew; }
70 :
71 348 : sal_uInt16 GetPosition() const { return nPosition; }
72 0 : void SetPosition( sal_uInt16 nNew ) { nPosition = nNew; }
73 :
74 348 : sal_uInt16 GetAdjustment() const { return nAdjustment; }
75 0 : void SetAdjustment( sal_uInt16 nNew ) { nAdjustment = nNew; }
76 : };
77 :
78 : #endif
79 :
80 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|