tdf#92527 construct default Segments sequence, when there is none
[LibreOffice.git] / sw / inc / fmtruby.hxx
blob62f27043e5de5ee64360b9c7a530c307decebd53
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>
24 class SwTextRuby;
26 class SW_DLLPUBLIC SwFormatRuby : public SfxPoolItem
28 friend class SwTextRuby;
30 OUString sRubyText; ///< The ruby txt.
31 OUString sCharFormatName; ///< Name of the charformat.
32 SwTextRuby* pTextAttr; ///< The TextAttribute.
33 sal_uInt16 nCharFormatId; ///< PoolId of the charformat.
34 sal_uInt16 nPosition; ///< Position of the Ruby-character.
35 sal_uInt16 nAdjustment; ///< Specific adjustment of the Ruby-ch.
37 public:
38 SwFormatRuby( const OUString& rRubyText );
39 SwFormatRuby( const SwFormatRuby& rAttr );
40 virtual ~SwFormatRuby();
42 SwFormatRuby& operator=( const SwFormatRuby& rAttr );
44 // "Pure virtual methods" of SfxPoolItem.
45 virtual bool operator==( const SfxPoolItem& ) const override;
46 virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
48 virtual bool GetPresentation( SfxItemPresentation ePres,
49 SfxMapUnit eCoreMetric,
50 SfxMapUnit ePresMetric,
51 OUString &rText,
52 const IntlWrapper* pIntl = nullptr ) const override;
54 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
55 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
57 const SwTextRuby* GetTextRuby() const { return pTextAttr; }
59 OUString GetText() const { return sRubyText; }
60 void SetText( const OUString& rText ) { sRubyText = rText; }
62 OUString GetCharFormatName() const { return sCharFormatName; }
63 void SetCharFormatName( const OUString& rNm ) { sCharFormatName = rNm; }
65 sal_uInt16 GetCharFormatId() const { return nCharFormatId; }
66 void SetCharFormatId( sal_uInt16 nNew ) { nCharFormatId = nNew; }
68 sal_uInt16 GetPosition() const { return nPosition; }
69 void SetPosition( sal_uInt16 nNew ) { nPosition = nNew; }
71 sal_uInt16 GetAdjustment() const { return nAdjustment; }
72 void SetAdjustment( sal_uInt16 nNew ) { nAdjustment = nNew; }
75 #endif
77 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */