LibreOffice Module sw (master) 1
fchrfmt.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_SW_INC_FCHRFMT_HXX
20#define INCLUDED_SW_INC_FCHRFMT_HXX
21
22#include <svl/poolitem.hxx>
23#include "calbck.hxx"
24#include "format.hxx"
25#include "charfmt.hxx"
26
28class IntlWrapper;
29
31{
32 friend class SwTextCharFormat;
34
35public:
37 explicit SwFormatCharFormat( SwCharFormat *pFormat );
38 virtual ~SwFormatCharFormat() override;
39
42
43private:
44 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
45
48public:
49
50
52 virtual bool operator==( const SfxPoolItem& ) const override;
53 virtual SwFormatCharFormat* Clone( SfxItemPool* pPool = nullptr ) const override;
54 virtual bool GetPresentation( SfxItemPresentation ePres,
55 MapUnit eCoreMetric,
56 MapUnit ePresMetric,
57 OUString &rText,
58 const IntlWrapper& rIntl ) const override;
59
60 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
61 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
62
63 virtual bool GetInfo( SfxPoolItem& rInfo ) const override;
64
65 void SetCharFormat( SwFormat* pFormat )
66 {
67 assert(!pFormat->IsDefault()); // expose cases that lead to use-after-free
68 pFormat->Add(this);
69 }
70 SwCharFormat* GetCharFormat() const { return const_cast<SwCharFormat*>(static_cast<const SwCharFormat*>(GetRegisteredIn())); }
71
72 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
73};
74#endif
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
virtual bool GetPresentation(SfxItemPresentation ePresentation, MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual bool operator==(const SfxPoolItem &) const=0
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
SfxPoolItem & operator=(const SfxPoolItem &)=delete
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
Represents the style of a text portion.
Definition: charfmt.hxx:27
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:166
virtual void SwClientNotify(const SwModify &, const SfxHint &rHint) override
Definition: calbck.cxx:120
SwCharFormat * GetCharFormat() const
Definition: fchrfmt.hxx:70
void SetCharFormat(SwFormat *pFormat)
Definition: fchrfmt.hxx:65
SwTextCharFormat * m_pTextAttribute
My text attribute.
Definition: fchrfmt.hxx:33
Base class for various Writer styles.
Definition: format.hxx:47
bool IsDefault() const
Definition: format.hxx:129
bool GetInfo(SfxPoolItem const &rInfo) const
Definition: txtatr2.cxx:71
struct _xmlTextWriter * xmlTextWriterPtr
MapUnit
SfxItemPresentation
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
unsigned char sal_uInt8