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