LibreOffice Module editeng (master) 1
protitem.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_EDITENG_PROTITEM_HXX
20#define INCLUDED_EDITENG_PROTITEM_HXX
21
22#include <svl/poolitem.hxx>
24
25// class SvxProtectItem --------------------------------------------------
26
27
28/* [Description]
29
30 This item describes, if content, size or position should be protected.
31*/
32
34{
35 bool bCntnt :1; // Content protected
36 bool bSize :1; // Size protected
37 bool bPos :1; // Position protected
38
39public:
40 static SfxPoolItem* CreateDefault();
41
42 explicit inline SvxProtectItem( const sal_uInt16 nId );
43 SvxProtectItem(SvxProtectItem const &) = default; // SfxPoolItem copy function dichotomy
44
45 // "pure virtual Methods" from SfxPoolItem
46 virtual bool operator==( const SfxPoolItem& ) const override;
47
48 virtual bool GetPresentation( SfxItemPresentation ePres,
49 MapUnit eCoreMetric,
50 MapUnit ePresMetric,
51 OUString &rText, const IntlWrapper& ) const override;
52
53
54 virtual SvxProtectItem* Clone( SfxItemPool *pPool = nullptr ) const override;
55
56 bool IsContentProtected() const { return bCntnt; }
57 bool IsSizeProtected() const { return bSize; }
58 bool IsPosProtected() const { return bPos; }
59 void SetContentProtect( bool bNew ) { bCntnt = bNew; }
60 void SetSizeProtect ( bool bNew ) { bSize = bNew; }
61 void SetPosProtect ( bool bNew ) { bPos = bNew; }
62
63 virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
64 virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
65 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
66};
67
68inline SvxProtectItem::SvxProtectItem( const sal_uInt16 nId )
69 : SfxPoolItem( nId )
70{
71 bCntnt = bSize = bPos = false;
72}
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)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void SetSizeProtect(bool bNew)
Definition: protitem.hxx:60
void SetContentProtect(bool bNew)
Definition: protitem.hxx:59
SvxProtectItem(const sal_uInt16 nId)
Definition: protitem.hxx:68
bool IsPosProtected() const
Definition: protitem.hxx:58
bool IsContentProtected() const
Definition: protitem.hxx:56
bool IsSizeProtected() const
Definition: protitem.hxx:57
SvxProtectItem(SvxProtectItem const &)=default
void SetPosProtect(bool bNew)
Definition: protitem.hxx:61
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28
struct _xmlTextWriter * xmlTextWriterPtr
MapUnit
sal_Int16 nId
SfxItemPresentation
unsigned char sal_uInt8