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
22 #include <svl/poolitem.hxx>
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.
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 SAL_OVERRIDE
;
46 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const SAL_OVERRIDE
;
48 virtual bool GetPresentation( SfxItemPresentation ePres
,
49 SfxMapUnit eCoreMetric
,
50 SfxMapUnit ePresMetric
,
52 const IntlWrapper
* pIntl
= 0 ) const SAL_OVERRIDE
;
54 virtual bool QueryValue( com::sun::star::uno::Any
& rVal
,
55 sal_uInt8 nMemberId
= 0 ) const SAL_OVERRIDE
;
56 virtual bool PutValue( const com::sun::star::uno::Any
& rVal
,
57 sal_uInt8 nMemberId
= 0 ) SAL_OVERRIDE
;
59 const SwTextRuby
* GetTextRuby() const { return pTextAttr
; }
60 SwTextRuby
* GetTextRuby() { return pTextAttr
; }
62 OUString
GetText() const { return sRubyText
; }
63 void SetText( const OUString
& rText
) { sRubyText
= rText
; }
65 OUString
GetCharFormatName() const { return sCharFormatName
; }
66 void SetCharFormatName( const OUString
& rNm
) { sCharFormatName
= rNm
; }
68 sal_uInt16
GetCharFormatId() const { return nCharFormatId
; }
69 void SetCharFormatId( sal_uInt16 nNew
) { nCharFormatId
= nNew
; }
71 sal_uInt16
GetPosition() const { return nPosition
; }
72 void SetPosition( sal_uInt16 nNew
) { nPosition
= nNew
; }
74 sal_uInt16
GetAdjustment() const { return nAdjustment
; }
75 void SetAdjustment( sal_uInt16 nNew
) { nAdjustment
= nNew
; }
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */