1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_INC_FMTRUBY_HXX
20 #define INCLUDED_SW_INC_FMTRUBY_HXX
23 #include <svl/poolitem.hxx>
24 #include <com/sun/star/text/RubyAdjust.hpp>
28 /// SfxPoolItem subclass that is owned by an SwTextRuby and contains info entered in Format -> Asian
29 /// Phonetic Guide. This is a character property, i.e. appears in the SwpHints of an SwTextNode.
30 class SW_DLLPUBLIC SwFormatRuby final
: public SfxPoolItem
32 friend class SwTextRuby
;
34 OUString m_sRubyText
; ///< The ruby text.
35 OUString m_sCharFormatName
; ///< Name of the charformat.
36 SwTextRuby
* m_pTextAttr
; ///< The TextAttribute.
37 sal_uInt16 m_nCharFormatId
; ///< PoolId of the charformat.
38 sal_uInt16 m_nPosition
; ///< Position of the Ruby-character.
39 css::text::RubyAdjust m_eAdjustment
; ///< Specific adjustment of the Ruby-ch.
42 SwFormatRuby( OUString aRubyText
);
43 SwFormatRuby( const SwFormatRuby
& rAttr
);
44 virtual ~SwFormatRuby() override
;
46 SwFormatRuby
& operator=( const SwFormatRuby
& rAttr
);
48 // "Pure virtual methods" of SfxPoolItem.
49 virtual bool operator==( const SfxPoolItem
& ) const override
;
50 virtual SwFormatRuby
* Clone( SfxItemPool
* pPool
= nullptr ) const override
;
52 virtual bool GetPresentation( SfxItemPresentation ePres
,
56 const IntlWrapper
& rIntl
) const override
;
58 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
59 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
61 const SwTextRuby
* GetTextRuby() const { return m_pTextAttr
; }
63 const OUString
& GetText() const { return m_sRubyText
; }
64 void SetText( const OUString
& rText
) { m_sRubyText
= rText
; }
66 const OUString
& GetCharFormatName() const { return m_sCharFormatName
; }
67 void SetCharFormatName( const OUString
& rNm
) { m_sCharFormatName
= rNm
; }
69 sal_uInt16
GetCharFormatId() const { return m_nCharFormatId
; }
70 void SetCharFormatId( sal_uInt16 nNew
) { m_nCharFormatId
= nNew
; }
72 sal_uInt16
GetPosition() const { return m_nPosition
; }
73 void SetPosition( sal_uInt16 nNew
) { m_nPosition
= nNew
; }
75 css::text::RubyAdjust
GetAdjustment() const { return m_eAdjustment
; }
76 void SetAdjustment( css::text::RubyAdjust nNew
) { m_eAdjustment
= nNew
; }
77 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */