LibreOffice Module sw (master)  1
fmtruby.hxx
Go to the documentation of this file.
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 "swdllapi.h"
23 #include <svl/poolitem.hxx>
24 #include <com/sun/star/text/RubyAdjust.hpp>
25 
26 class SwTextRuby;
27 
29 {
30  friend class SwTextRuby;
31 
32  OUString m_sRubyText;
33  OUString m_sCharFormatName;
35  sal_uInt16 m_nCharFormatId;
36  sal_uInt16 m_nPosition;
37  css::text::RubyAdjust m_eAdjustment;
38 
39 public:
40  SwFormatRuby( const OUString& rRubyText );
41  SwFormatRuby( const SwFormatRuby& rAttr );
42  virtual ~SwFormatRuby() override;
43 
44  SwFormatRuby& operator=( const SwFormatRuby& rAttr );
45 
46  // "Pure virtual methods" of SfxPoolItem.
47  virtual bool operator==( const SfxPoolItem& ) const override;
48  virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override;
49 
50  virtual bool GetPresentation( SfxItemPresentation ePres,
51  MapUnit eCoreMetric,
52  MapUnit ePresMetric,
53  OUString &rText,
54  const IntlWrapper& rIntl ) const override;
55 
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;
58 
59  const SwTextRuby* GetTextRuby() const { return m_pTextAttr; }
60 
61  const OUString& GetText() const { return m_sRubyText; }
62  void SetText( const OUString& rText ) { m_sRubyText = rText; }
63 
64  const OUString& GetCharFormatName() const { return m_sCharFormatName; }
65  void SetCharFormatName( const OUString& rNm ) { m_sCharFormatName = rNm; }
66 
67  sal_uInt16 GetCharFormatId() const { return m_nCharFormatId; }
68  void SetCharFormatId( sal_uInt16 nNew ) { m_nCharFormatId = nNew; }
69 
70  sal_uInt16 GetPosition() const { return m_nPosition; }
71  void SetPosition( sal_uInt16 nNew ) { m_nPosition = nNew; }
72 
73  css::text::RubyAdjust GetAdjustment() const { return m_eAdjustment; }
74  void SetAdjustment( css::text::RubyAdjust nNew ) { m_eAdjustment = nNew; }
75 };
76 
77 #endif
78 
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const OUString & GetCharFormatName() const
Definition: fmtruby.hxx:64
virtual bool operator==(const SfxPoolItem &) const =0
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
void SetAdjustment(css::text::RubyAdjust nNew)
Definition: fmtruby.hxx:74
SfxPoolItem & operator=(const SfxPoolItem &)=delete
void SetCharFormatName(const OUString &rNm)
Definition: fmtruby.hxx:65
const SwTextRuby * GetTextRuby() const
Definition: fmtruby.hxx:59
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
const OUString & GetText() const
Definition: fmtruby.hxx:61
sal_uInt16 GetPosition() const
Definition: fmtruby.hxx:70
OUString m_sRubyText
The ruby text.
Definition: fmtruby.hxx:32
SfxItemPresentation
sal_uInt16 GetCharFormatId() const
Definition: fmtruby.hxx:67
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
OUString m_sCharFormatName
Name of the charformat.
Definition: fmtruby.hxx:33
void SetPosition(sal_uInt16 nNew)
Definition: fmtruby.hxx:71
SwTextRuby * m_pTextAttr
The TextAttribute.
Definition: fmtruby.hxx:34
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
unsigned char sal_uInt8
css::text::RubyAdjust GetAdjustment() const
Definition: fmtruby.hxx:73
MapUnit
sal_uInt16 m_nCharFormatId
PoolId of the charformat.
Definition: fmtruby.hxx:35
css::text::RubyAdjust m_eAdjustment
Specific adjustment of the Ruby-ch.
Definition: fmtruby.hxx:37
void SetText(const OUString &rText)
Definition: fmtruby.hxx:62
void SetCharFormatId(sal_uInt16 nNew)
Definition: fmtruby.hxx:68
sal_uInt16 m_nPosition
Position of the Ruby-character.
Definition: fmtruby.hxx:36