xref: /aoo42x/main/sw/inc/fchrfmt.hxx (revision 1d2dbeb0)
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 _FCHRFMT_HXX
24 #define _FCHRFMT_HXX
25 
26 
27 #include <svl/poolitem.hxx>
28 #include <calbck.hxx>
29 #include <format.hxx>
30 
31 class SwCharFmt;
32 class SwTxtCharFmt;
33 class IntlWrapper;
34 
35 // ATT_CHARFMT *********************************************
36 
37 
38 class SW_DLLPUBLIC SwFmtCharFmt: public SfxPoolItem, public SwClient
39 {
40 	friend class SwTxtCharFmt;
41 	SwTxtCharFmt* pTxtAttr;		// mein TextAttribut
42 
43 public:
SwFmtCharFmt()44 	SwFmtCharFmt() : pTxtAttr(0) {}
45 
46 	// single argument ctors shall be explicit.
47 	explicit SwFmtCharFmt( SwCharFmt *pFmt );
48 	virtual ~SwFmtCharFmt();
49 
50 	// @@@ public copy ctor, but no copy assignment?
51 	SwFmtCharFmt( const SwFmtCharFmt& rAttr );
52 protected:
53    virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
54 
55 private:
56 	// @@@ public copy ctor, but no copy assignment?
57 	SwFmtCharFmt & operator= (const SwFmtCharFmt &);
58 public:
59 
60 	TYPEINFO();
61 
62 	// "pure virtual Methoden" vom SfxPoolItem
63 	virtual int             operator==( const SfxPoolItem& ) const;
64 	virtual SfxPoolItem*	Clone( SfxItemPool* pPool = 0 ) const;
65 	virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
66 									SfxMapUnit eCoreMetric,
67 									SfxMapUnit ePresMetric,
68 									String &rText,
69                                     const IntlWrapper*    pIntl = 0 ) const;
70 
71 	virtual	sal_Bool        	 QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
72 	virtual	sal_Bool			 PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
73 
74 	virtual sal_Bool 	GetInfo( SfxPoolItem& rInfo ) const;
75 
SetCharFmt(SwFmt * pFmt)76 	void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); }
GetCharFmt() const77 	SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); }
78 };
79 #endif
80 
81