Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _FCHRFMT_HXX
29 : : #define _FCHRFMT_HXX
30 : :
31 : :
32 : : #include <svl/poolitem.hxx>
33 : : #include <calbck.hxx>
34 : : #include <format.hxx>
35 : :
36 : : class SwCharFmt;
37 : : class SwTxtCharFmt;
38 : : class IntlWrapper;
39 : :
40 : : // ATT_CHARFMT *********************************************
41 : :
42 : :
43 : : class SW_DLLPUBLIC SwFmtCharFmt: public SfxPoolItem, public SwClient
44 : : {
45 : : friend class SwTxtCharFmt;
46 : : SwTxtCharFmt* pTxtAttr; // My text attribute.
47 : :
48 : : public:
49 : : SwFmtCharFmt() : pTxtAttr(0) {}
50 : :
51 : : // single argument ctors shall be explicit.
52 : : explicit SwFmtCharFmt( SwCharFmt *pFmt );
53 : : virtual ~SwFmtCharFmt();
54 : :
55 : : // @@@ public copy ctor, but no copy assignment?
56 : : SwFmtCharFmt( const SwFmtCharFmt& rAttr );
57 : : protected:
58 : : virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
59 : :
60 : : private:
61 : : // @@@ public copy ctor, but no copy assignment?
62 : : SwFmtCharFmt & operator= (const SwFmtCharFmt &);
63 : : public:
64 : :
65 : : TYPEINFO();
66 : :
67 : : // "pure virtual methods" of SfxPoolItem
68 : : virtual int operator==( const SfxPoolItem& ) const;
69 : : virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
70 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
71 : : SfxMapUnit eCoreMetric,
72 : : SfxMapUnit ePresMetric,
73 : : String &rText,
74 : : const IntlWrapper* pIntl = 0 ) const;
75 : :
76 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
77 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
78 : :
79 : : virtual sal_Bool GetInfo( SfxPoolItem& rInfo ) const;
80 : :
81 : 0 : void SetCharFmt( SwFmt* pFmt ) { pFmt->Add(this); }
82 : 36848 : SwCharFmt* GetCharFmt() const { return (SwCharFmt*)GetRegisteredIn(); }
83 : : };
84 : : #endif
85 : :
86 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|