xref: /aoo41x/main/sw/inc/fmtruby.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _FMTRUBY_HXX
28 #define _FMTRUBY_HXX
29 
30 
31 #include <tools/string.hxx>
32 #include <svl/poolitem.hxx>
33 
34 class SwTxtRuby;
35 
36 class SW_DLLPUBLIC SwFmtRuby : public SfxPoolItem
37 {
38 	friend class SwTxtRuby;
39 
40 	String sRubyTxt;					// the ruby txt
41 	String sCharFmtName;				// name of the charformat
42 	SwTxtRuby* pTxtAttr;				// the TextAttribut
43 	sal_uInt16 nCharFmtId;					// PoolId of the charformat
44 	sal_uInt16 nPosition;					// Position of the Ruby-Character
45 	sal_uInt16 nAdjustment;					// specific adjustment of the Ruby-Ch.
46 
47 public:
48 	SwFmtRuby( const String& rRubyTxt );
49 	SwFmtRuby( const SwFmtRuby& rAttr );
50 	virtual ~SwFmtRuby();
51 
52 	SwFmtRuby& operator=( const SwFmtRuby& rAttr );
53 
54 	// "pure virtual Methoden" vom SfxPoolItem
55 	virtual int             operator==( const SfxPoolItem& ) const;
56 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
57 
58 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
59 									SfxMapUnit eCoreMetric,
60 									SfxMapUnit ePresMetric,
61 									String &rText,
62                                     const IntlWrapper* pIntl = 0 ) const;
63 
64 	virtual	sal_Bool        	QueryValue( com::sun::star::uno::Any& rVal,
65 										sal_uInt8 nMemberId = 0 ) const;
66 	virtual	sal_Bool			PutValue( const com::sun::star::uno::Any& rVal,
67 										sal_uInt8 nMemberId = 0 );
68 
69 
70 	const SwTxtRuby* GetTxtRuby() const			{ return pTxtAttr; }
71 	SwTxtRuby* GetTxtRuby()						{ return pTxtAttr; }
72 
73 	const String& GetText() const				{ return sRubyTxt; }
74 	void SetText( const String& rTxt )			{ sRubyTxt = rTxt; }
75 
76 	const String& GetCharFmtName() const		{ return sCharFmtName; }
77 	void SetCharFmtName( const String& rNm )	{ sCharFmtName = rNm; }
78 
79 	sal_uInt16 GetCharFmtId() const					{ return nCharFmtId; }
80 	void SetCharFmtId( sal_uInt16 nNew )			{ nCharFmtId = nNew; }
81 
82 	sal_uInt16 GetPosition() const					{ return nPosition; }
83 	void SetPosition( sal_uInt16 nNew )				{ nPosition = nNew; }
84 
85 	sal_uInt16 GetAdjustment() const				{ return nAdjustment; }
86 	void SetAdjustment( sal_uInt16 nNew )			{ nAdjustment = nNew; }
87 };
88 
89 
90 #endif
91 
92