Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / sw / inc / fmtruby.hxx
blob646a26f7df43cd069c8b1ce97dd3ce9282353e3f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
22 #include <svl/poolitem.hxx>
23 #include <com/sun/star/text/RubyAdjust.hpp>
25 class SwTextRuby;
27 class SW_DLLPUBLIC SwFormatRuby : public SfxPoolItem
29 friend class SwTextRuby;
31 OUString sRubyText; ///< The ruby txt.
32 OUString sCharFormatName; ///< Name of the charformat.
33 SwTextRuby* pTextAttr; ///< The TextAttribute.
34 sal_uInt16 nCharFormatId; ///< PoolId of the charformat.
35 sal_uInt16 nPosition; ///< Position of the Ruby-character.
36 css::text::RubyAdjust nAdjustment; ///< Specific adjustment of the Ruby-ch.
38 public:
39 SwFormatRuby( const OUString& rRubyText );
40 SwFormatRuby( const SwFormatRuby& rAttr );
41 virtual ~SwFormatRuby() override;
43 SwFormatRuby& operator=( const SwFormatRuby& rAttr );
45 // "Pure virtual methods" of SfxPoolItem.
46 virtual bool operator==( const SfxPoolItem& ) const override;
47 virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
49 virtual bool GetPresentation( SfxItemPresentation ePres,
50 MapUnit eCoreMetric,
51 MapUnit ePresMetric,
52 OUString &rText,
53 const IntlWrapper* pIntl = nullptr ) const override;
55 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
56 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
58 const SwTextRuby* GetTextRuby() const { return pTextAttr; }
60 const OUString& GetText() const { return sRubyText; }
61 void SetText( const OUString& rText ) { sRubyText = rText; }
63 const OUString& GetCharFormatName() const { return sCharFormatName; }
64 void SetCharFormatName( const OUString& rNm ) { sCharFormatName = rNm; }
66 sal_uInt16 GetCharFormatId() const { return nCharFormatId; }
67 void SetCharFormatId( sal_uInt16 nNew ) { nCharFormatId = nNew; }
69 sal_uInt16 GetPosition() const { return nPosition; }
70 void SetPosition( sal_uInt16 nNew ) { nPosition = nNew; }
72 css::text::RubyAdjust GetAdjustment() const { return nAdjustment; }
73 void SetAdjustment( css::text::RubyAdjust nNew ) { nAdjustment = nNew; }
76 #endif
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */