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 _SVX_PROTITEM_HXX
29 : : #define _SVX_PROTITEM_HXX
30 : :
31 : : #include <svl/poolitem.hxx>
32 : : #include "editeng/editengdllapi.h"
33 : :
34 : : class SvXMLUnitConverter;
35 : : namespace rtl
36 : : {
37 : : class OUString;
38 : : }
39 : :
40 : : // class SvxProtectItem --------------------------------------------------
41 : :
42 : :
43 : : /* [Description]
44 : :
45 : : This item describes, if content, size or position should be protected.
46 : : */
47 : :
48 [ - + ]: 9118 : class EDITENG_DLLPUBLIC SvxProtectItem : public SfxPoolItem
49 : : {
50 : : sal_Bool bCntnt :1; // Content protected
51 : : sal_Bool bSize :1; // Size protected
52 : : sal_Bool bPos :1; // Position protected
53 : :
54 : : public:
55 : : TYPEINFO();
56 : :
57 : : inline SvxProtectItem( const sal_uInt16 nId );
58 : : inline SvxProtectItem &operator=( const SvxProtectItem &rCpy );
59 : :
60 : : // "pure virtual Methods" from SfxPoolItem
61 : : virtual int operator==( const SfxPoolItem& ) const;
62 : :
63 : : virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
64 : : SfxMapUnit eCoreMetric,
65 : : SfxMapUnit ePresMetric,
66 : : String &rText, const IntlWrapper * = 0 ) const;
67 : :
68 : :
69 : : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
70 : : virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
71 : : virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
72 : :
73 : 76343 : sal_Bool IsCntntProtected() const { return bCntnt; }
74 : 14785 : sal_Bool IsSizeProtected() const { return bSize; }
75 : 14595 : sal_Bool IsPosProtected() const { return bPos; }
76 : 236 : void SetCntntProtect( sal_Bool bNew ) { bCntnt = bNew; }
77 : 5 : void SetSizeProtect ( sal_Bool bNew ) { bSize = bNew; }
78 : 5 : void SetPosProtect ( sal_Bool bNew ) { bPos = bNew; }
79 : :
80 : : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
81 : : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
82 : : };
83 : :
84 : 3903 : inline SvxProtectItem::SvxProtectItem( const sal_uInt16 nId )
85 : 3903 : : SfxPoolItem( nId )
86 : : {
87 : 3903 : bCntnt = bSize = bPos = sal_False;
88 : 3903 : }
89 : :
90 : 992 : inline SvxProtectItem &SvxProtectItem::operator=( const SvxProtectItem &rCpy )
91 : : {
92 : 992 : bCntnt = rCpy.IsCntntProtected();
93 : 992 : bSize = rCpy.IsSizeProtected();
94 : 992 : bPos = rCpy.IsPosProtected();
95 : 992 : return *this;
96 : : }
97 : :
98 : :
99 : :
100 : :
101 : : #endif
102 : :
103 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|