/src/libreoffice/sw/inc/fmtruby.hxx
Line | Count | Source |
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 "names.hxx" |
23 | | #include "swdllapi.h" |
24 | | #include <svl/poolitem.hxx> |
25 | | #include <com/sun/star/text/RubyAdjust.hpp> |
26 | | |
27 | | class SwTextRuby; |
28 | | |
29 | | /// SfxPoolItem subclass that is owned by an SwTextRuby and contains info entered in Format -> Asian |
30 | | /// Phonetic Guide. This is a character property, i.e. appears in the SwpHints of an SwTextNode. |
31 | | class SW_DLLPUBLIC SwFormatRuby final : public SfxPoolItem |
32 | | { |
33 | | friend class SwTextRuby; |
34 | | |
35 | | OUString m_sRubyText; ///< The ruby text. |
36 | | UIName m_sCharFormatName; ///< Name of the charformat. |
37 | | SwTextRuby* m_pTextAttr; ///< The TextAttribute. |
38 | | SwPoolFormatId m_nCharFormatId; ///< PoolId of the charformat. |
39 | | sal_uInt16 m_nPosition; ///< Position of the Ruby-character. |
40 | | css::text::RubyAdjust m_eAdjustment; ///< Specific adjustment of the Ruby-ch. |
41 | | |
42 | | public: |
43 | | DECLARE_ITEM_TYPE_FUNCTION(SwFormatRuby) |
44 | | SwFormatRuby( OUString aRubyText ); |
45 | | SwFormatRuby( const SwFormatRuby& rAttr ); |
46 | | virtual ~SwFormatRuby() override; |
47 | | |
48 | | SwFormatRuby& operator=( const SwFormatRuby& rAttr ); |
49 | | |
50 | | // "Pure virtual methods" of SfxPoolItem. |
51 | | virtual bool operator==( const SfxPoolItem& ) const override; |
52 | | virtual SwFormatRuby* Clone( SfxItemPool* pPool = nullptr ) const override; |
53 | | |
54 | | virtual bool GetPresentation( SfxItemPresentation ePres, |
55 | | MapUnit eCoreMetric, |
56 | | MapUnit ePresMetric, |
57 | | OUString &rText, |
58 | | const IntlWrapper& rIntl ) const override; |
59 | | |
60 | | virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; |
61 | | virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; |
62 | | |
63 | 0 | const SwTextRuby* GetTextRuby() const { return m_pTextAttr; } |
64 | | |
65 | 3.13k | const OUString& GetText() const { return m_sRubyText; } |
66 | 0 | void SetText( const OUString& rText ) { m_sRubyText = rText; } |
67 | | |
68 | 1.46k | const UIName& GetCharFormatName() const { return m_sCharFormatName; } |
69 | 2 | void SetCharFormatName( const UIName& rNm ) { m_sCharFormatName = rNm; } |
70 | | |
71 | 2 | SwPoolFormatId GetCharFormatId() const { return m_nCharFormatId; } |
72 | 4 | void SetCharFormatId( SwPoolFormatId nNew ) { m_nCharFormatId = nNew; } |
73 | | |
74 | 1.56k | sal_uInt16 GetPosition() const { return m_nPosition; } |
75 | 0 | void SetPosition( sal_uInt16 nNew ) { m_nPosition = nNew; } |
76 | | |
77 | 1.56k | css::text::RubyAdjust GetAdjustment() const { return m_eAdjustment; } |
78 | 0 | void SetAdjustment( css::text::RubyAdjust nNew ) { m_eAdjustment = nNew; } |
79 | | void dumpAsXml(xmlTextWriterPtr pWriter) const override; |
80 | | }; |
81 | | |
82 | | #endif |
83 | | |
84 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |