xref: /aoo41x/main/sw/inc/fmtruby.hxx (revision 1d2dbeb0)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1d2dbeb0SAndrew Rist  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1d2dbeb0SAndrew Rist  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19*1d2dbeb0SAndrew Rist  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _FMTRUBY_HXX
24cdf0e10cSrcweir #define _FMTRUBY_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/string.hxx>
28cdf0e10cSrcweir #include <svl/poolitem.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class SwTxtRuby;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir class SW_DLLPUBLIC SwFmtRuby : public SfxPoolItem
33cdf0e10cSrcweir {
34cdf0e10cSrcweir 	friend class SwTxtRuby;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir 	String sRubyTxt;					// the ruby txt
37cdf0e10cSrcweir 	String sCharFmtName;				// name of the charformat
38cdf0e10cSrcweir 	SwTxtRuby* pTxtAttr;				// the TextAttribut
39cdf0e10cSrcweir 	sal_uInt16 nCharFmtId;					// PoolId of the charformat
40cdf0e10cSrcweir 	sal_uInt16 nPosition;					// Position of the Ruby-Character
41cdf0e10cSrcweir 	sal_uInt16 nAdjustment;					// specific adjustment of the Ruby-Ch.
42cdf0e10cSrcweir 
43cdf0e10cSrcweir public:
44cdf0e10cSrcweir 	SwFmtRuby( const String& rRubyTxt );
45cdf0e10cSrcweir 	SwFmtRuby( const SwFmtRuby& rAttr );
46cdf0e10cSrcweir 	virtual ~SwFmtRuby();
47cdf0e10cSrcweir 
48cdf0e10cSrcweir 	SwFmtRuby& operator=( const SwFmtRuby& rAttr );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	// "pure virtual Methoden" vom SfxPoolItem
51cdf0e10cSrcweir 	virtual int             operator==( const SfxPoolItem& ) const;
52cdf0e10cSrcweir 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
55cdf0e10cSrcweir 									SfxMapUnit eCoreMetric,
56cdf0e10cSrcweir 									SfxMapUnit ePresMetric,
57cdf0e10cSrcweir 									String &rText,
58cdf0e10cSrcweir                                     const IntlWrapper* pIntl = 0 ) const;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	virtual	sal_Bool        	QueryValue( com::sun::star::uno::Any& rVal,
61cdf0e10cSrcweir 										sal_uInt8 nMemberId = 0 ) const;
62cdf0e10cSrcweir 	virtual	sal_Bool			PutValue( const com::sun::star::uno::Any& rVal,
63cdf0e10cSrcweir 										sal_uInt8 nMemberId = 0 );
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 
GetTxtRuby() const66cdf0e10cSrcweir 	const SwTxtRuby* GetTxtRuby() const			{ return pTxtAttr; }
GetTxtRuby()67cdf0e10cSrcweir 	SwTxtRuby* GetTxtRuby()						{ return pTxtAttr; }
68cdf0e10cSrcweir 
GetText() const69cdf0e10cSrcweir 	const String& GetText() const				{ return sRubyTxt; }
SetText(const String & rTxt)70cdf0e10cSrcweir 	void SetText( const String& rTxt )			{ sRubyTxt = rTxt; }
71cdf0e10cSrcweir 
GetCharFmtName() const72cdf0e10cSrcweir 	const String& GetCharFmtName() const		{ return sCharFmtName; }
SetCharFmtName(const String & rNm)73cdf0e10cSrcweir 	void SetCharFmtName( const String& rNm )	{ sCharFmtName = rNm; }
74cdf0e10cSrcweir 
GetCharFmtId() const75cdf0e10cSrcweir 	sal_uInt16 GetCharFmtId() const					{ return nCharFmtId; }
SetCharFmtId(sal_uInt16 nNew)76cdf0e10cSrcweir 	void SetCharFmtId( sal_uInt16 nNew )			{ nCharFmtId = nNew; }
77cdf0e10cSrcweir 
GetPosition() const78cdf0e10cSrcweir 	sal_uInt16 GetPosition() const					{ return nPosition; }
SetPosition(sal_uInt16 nNew)79cdf0e10cSrcweir 	void SetPosition( sal_uInt16 nNew )				{ nPosition = nNew; }
80cdf0e10cSrcweir 
GetAdjustment() const81cdf0e10cSrcweir 	sal_uInt16 GetAdjustment() const				{ return nAdjustment; }
SetAdjustment(sal_uInt16 nNew)82cdf0e10cSrcweir 	void SetAdjustment( sal_uInt16 nNew )			{ nAdjustment = nNew; }
83cdf0e10cSrcweir };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 
86cdf0e10cSrcweir #endif
87cdf0e10cSrcweir 
88