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 class SW_DLLPUBLIC SwFormatRuby final
: public SfxPoolItem
30 friend class SwTextRuby
;
32 OUString m_sRubyText
; ///< The ruby text.
33 OUString m_sCharFormatName
; ///< Name of the charformat.
34 SwTextRuby
* m_pTextAttr
; ///< The TextAttribute.
35 sal_uInt16 m_nCharFormatId
; ///< PoolId of the charformat.
36 sal_uInt16 m_nPosition
; ///< Position of the Ruby-character.
37 css::text::RubyAdjust m_eAdjustment
; ///< Specific adjustment of the Ruby-ch.
40 SwFormatRuby( const OUString
& rRubyText
);
41 SwFormatRuby( const SwFormatRuby
& rAttr
);
42 virtual ~SwFormatRuby() override
;
44 SwFormatRuby
& operator=( const SwFormatRuby
& rAttr
);
46 // "Pure virtual methods" of SfxPoolItem.
47 virtual bool operator==( const SfxPoolItem
& ) const override
;
48 virtual SwFormatRuby
* Clone( SfxItemPool
* pPool
= nullptr ) const override
;
50 virtual bool GetPresentation( SfxItemPresentation ePres
,
54 const IntlWrapper
& rIntl
) const override
;
56 virtual bool QueryValue( css::uno::Any
& rVal
, sal_uInt8 nMemberId
= 0 ) const override
;
57 virtual bool PutValue( const css::uno::Any
& rVal
, sal_uInt8 nMemberId
) override
;
59 const SwTextRuby
* GetTextRuby() const { return m_pTextAttr
; }
61 const OUString
& GetText() const { return m_sRubyText
; }
62 void SetText( const OUString
& rText
) { m_sRubyText
= rText
; }
64 const OUString
& GetCharFormatName() const { return m_sCharFormatName
; }
65 void SetCharFormatName( const OUString
& rNm
) { m_sCharFormatName
= rNm
; }
67 sal_uInt16
GetCharFormatId() const { return m_nCharFormatId
; }
68 void SetCharFormatId( sal_uInt16 nNew
) { m_nCharFormatId
= nNew
; }
70 sal_uInt16
GetPosition() const { return m_nPosition
; }
71 void SetPosition( sal_uInt16 nNew
) { m_nPosition
= nNew
; }
73 css::text::RubyAdjust
GetAdjustment() const { return m_eAdjustment
; }
74 void SetAdjustment( css::text::RubyAdjust nNew
) { m_eAdjustment
= nNew
; }
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */