fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / xoutdev / xattr2.cxx
bloba697fba53b3265f19fe3202278210cc37838c728
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <com/sun/star/drawing/LineJoint.hpp>
21 #include <com/sun/star/drawing/LineCap.hpp>
22 #include <com/sun/star/uno/Any.hxx>
24 #include <svx/dialogs.hrc>
25 #include "svx/xattr.hxx"
26 #include <svx/xtable.hxx>
27 #include <svx/dialmgr.hxx>
28 #include <editeng/itemtype.hxx>
29 #include <svx/xdef.hxx>
30 #include <svx/AffineMatrixItem.hxx>
32 /************************************************************************/
34 //------------------------------
35 // class XLineTransparenceItem
36 //------------------------------
37 TYPEINIT1_AUTOFACTORY(XLineTransparenceItem, SfxUInt16Item);
39 /*************************************************************************
41 |* XLineTransparenceItem::XLineTransparenceItem(sal_uInt16)
43 *************************************************************************/
45 XLineTransparenceItem::XLineTransparenceItem(sal_uInt16 nLineTransparence) :
46 SfxUInt16Item(XATTR_LINETRANSPARENCE, nLineTransparence)
50 /*************************************************************************
52 |* XLineTransparenceItem::XLineTransparenceItem(SvStream& rIn)
54 *************************************************************************/
56 XLineTransparenceItem::XLineTransparenceItem(SvStream& rIn) :
57 SfxUInt16Item(XATTR_LINETRANSPARENCE, rIn)
61 /*************************************************************************
63 |* XLineTransparenceItem::Clone(SfxItemPool* pPool) const
65 *************************************************************************/
67 SfxPoolItem* XLineTransparenceItem::Clone(SfxItemPool* /*pPool*/) const
69 return new XLineTransparenceItem(*this);
72 /*************************************************************************
74 |* SfxPoolItem* XLineTransparenceItem::Create(SvStream& rIn, sal_uInt16 nVer) const
76 *************************************************************************/
78 SfxPoolItem* XLineTransparenceItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
80 return new XLineTransparenceItem(rIn);
83 //------------------------------------------------------------------------
85 SfxItemPresentation XLineTransparenceItem::GetPresentation
87 SfxItemPresentation ePres,
88 SfxMapUnit /*eCoreUnit*/,
89 SfxMapUnit /*ePresUnit*/,
90 OUString& rText, const IntlWrapper *
91 ) const
93 rText = OUString();
95 switch ( ePres )
97 case SFX_ITEM_PRESENTATION_NONE:
98 return ePres;
99 case SFX_ITEM_PRESENTATION_COMPLETE:
100 rText = OUString( ResId( RID_SVXSTR_TRANSPARENCE, DIALOG_MGR() ) ) + ": ";
101 case SFX_ITEM_PRESENTATION_NAMELESS:
102 rText = rText + OUString::number( GetValue() ) + "%";
103 return ePres;
104 default:
105 return SFX_ITEM_PRESENTATION_NONE;
109 //-----------------------
110 // class XLineJointItem -
111 //-----------------------
113 TYPEINIT1_AUTOFACTORY(XLineJointItem, SfxEnumItem);
115 // -----------------------------------------------------------------------------
117 XLineJointItem::XLineJointItem( com::sun::star::drawing::LineJoint eLineJoint ) :
118 SfxEnumItem(XATTR_LINEJOINT, sal::static_int_cast< sal_uInt16 >(eLineJoint))
122 // -----------------------------------------------------------------------------
124 XLineJointItem::XLineJointItem( SvStream& rIn ) :
125 SfxEnumItem( XATTR_LINEJOINT, rIn )
129 // -----------------------------------------------------------------------------
131 sal_uInt16 XLineJointItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
133 return 1;
136 // -----------------------------------------------------------------------------
138 SfxPoolItem* XLineJointItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
140 XLineJointItem* pRet = new XLineJointItem( rIn );
142 if(nVer < 1)
143 pRet->SetValue(com::sun::star::drawing::LineJoint_ROUND);
145 return pRet;
148 // -----------------------------------------------------------------------------
150 SfxPoolItem* XLineJointItem::Clone(SfxItemPool* /*pPool*/) const
152 return new XLineJointItem( *this );
155 // -----------------------------------------------------------------------------
157 SfxItemPresentation XLineJointItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/,
158 SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper*) const
160 rText = OUString();
162 switch( ePres )
164 case SFX_ITEM_PRESENTATION_NONE: return ePres;
166 case SFX_ITEM_PRESENTATION_COMPLETE:
167 case SFX_ITEM_PRESENTATION_NAMELESS:
169 sal_uInt16 nId = 0;
171 switch( GetValue() )
173 case( com::sun::star::drawing::LineJoint_MAKE_FIXED_SIZE ):
174 case( com::sun::star::drawing::LineJoint_NONE ):
175 nId = RID_SVXSTR_LINEJOINT_NONE;
176 break;
178 case( com::sun::star::drawing::LineJoint_MIDDLE ):
179 nId = RID_SVXSTR_LINEJOINT_MIDDLE;
180 break;
183 case( com::sun::star::drawing::LineJoint_BEVEL ):
184 nId = RID_SVXSTR_LINEJOINT_BEVEL;
185 break;
188 case( com::sun::star::drawing::LineJoint_MITER ):
189 nId = RID_SVXSTR_LINEJOINT_MITER;
190 break;
193 case( com::sun::star::drawing::LineJoint_ROUND ):
194 nId = RID_SVXSTR_LINEJOINT_ROUND;
195 break;
198 if( nId )
199 rText = SVX_RESSTR( nId );
201 return ePres;
203 default:
204 return SFX_ITEM_PRESENTATION_NONE;
208 // -----------------------------------------------------------------------------
210 bool XLineJointItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
212 const ::com::sun::star::drawing::LineJoint eJoint = GetValue();
213 rVal <<= eJoint;
214 return true;
217 // -----------------------------------------------------------------------------
219 bool XLineJointItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
221 ::com::sun::star::drawing::LineJoint eUnoJoint;
223 if(!(rVal >>= eUnoJoint))
225 // also try an int (for Basic)
226 sal_Int32 nLJ = 0;
227 if(!(rVal >>= nLJ))
228 return false;
229 eUnoJoint = (::com::sun::star::drawing::LineJoint)nLJ;
232 SetValue( sal::static_int_cast< sal_uInt16 >( eUnoJoint ) );
234 return true;
237 // -----------------------------------------------------------------------------
239 sal_uInt16 XLineJointItem::GetValueCount() const
241 // don't forget to update the api interface also
242 return 5;
245 //---------------------
246 // class AffineMatrixItem
247 //---------------------
249 TYPEINIT1_AUTOFACTORY(AffineMatrixItem, SfxPoolItem);
251 AffineMatrixItem::AffineMatrixItem(const com::sun::star::geometry::AffineMatrix2D* pMatrix)
252 : SfxPoolItem(SID_ATTR_TRANSFORM_MATRIX)
254 if(pMatrix)
256 maMatrix = *pMatrix;
258 else
260 maMatrix.m00 = 1.0;
261 maMatrix.m01 = 0.0;
262 maMatrix.m02 = 0.0;
263 maMatrix.m10 = 0.0;
264 maMatrix.m11 = 1.0;
265 maMatrix.m12 = 0.0;
269 AffineMatrixItem::AffineMatrixItem(SvStream& rIn)
270 : SfxPoolItem(SID_ATTR_TRANSFORM_MATRIX)
272 rIn >> maMatrix.m00;
273 rIn >> maMatrix.m01;
274 rIn >> maMatrix.m02;
275 rIn >> maMatrix.m10;
276 rIn >> maMatrix.m11;
277 rIn >> maMatrix.m12;
280 AffineMatrixItem::AffineMatrixItem(const AffineMatrixItem& rRef)
281 : SfxPoolItem(SID_ATTR_TRANSFORM_MATRIX)
283 maMatrix = rRef.maMatrix;
286 AffineMatrixItem::~AffineMatrixItem()
290 int AffineMatrixItem::operator==(const SfxPoolItem& rRef) const
292 if(!SfxPoolItem::operator==(rRef))
294 return 0;
297 const AffineMatrixItem* pRef = dynamic_cast< const AffineMatrixItem* >(&rRef);
299 if(!pRef)
301 return 0;
304 return (maMatrix.m00 == pRef->maMatrix.m00
305 && maMatrix.m01 == pRef->maMatrix.m01
306 && maMatrix.m02 == pRef->maMatrix.m02
307 && maMatrix.m10 == pRef->maMatrix.m10
308 && maMatrix.m11 == pRef->maMatrix.m11
309 && maMatrix.m12 == pRef->maMatrix.m12);
312 SfxPoolItem* AffineMatrixItem::Clone( SfxItemPool* /*pPool*/ ) const
314 return new AffineMatrixItem(*this);
317 SfxPoolItem* AffineMatrixItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/ ) const
319 return new AffineMatrixItem(rIn);
322 SvStream& AffineMatrixItem::Store(SvStream &rStream, sal_uInt16 /*nItemVersion*/ ) const
324 rStream << maMatrix.m00;
325 rStream << maMatrix.m01;
326 rStream << maMatrix.m02;
327 rStream << maMatrix.m10;
328 rStream << maMatrix.m11;
329 rStream << maMatrix.m12;
330 return rStream;
333 bool AffineMatrixItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
335 rVal <<= maMatrix;
336 return true;
339 bool AffineMatrixItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
341 if (rVal >>= maMatrix)
343 return true;
346 OSL_ENSURE(false, "AffineMatrixItem::PutValue - Wrong type!");
347 return false;
350 const com::sun::star::geometry::AffineMatrix2D& AffineMatrixItem::GetAffineMatrix2D() const
352 return maMatrix;
355 //-----------------------
356 // class XLineCapItem -
357 //-----------------------
359 TYPEINIT1_AUTOFACTORY(XLineCapItem, SfxEnumItem);
361 // -----------------------------------------------------------------------------
363 XLineCapItem::XLineCapItem(com::sun::star::drawing::LineCap eLineCap)
364 : SfxEnumItem(XATTR_LINECAP, sal::static_int_cast< sal_uInt16 >(eLineCap))
368 // -----------------------------------------------------------------------------
370 XLineCapItem::XLineCapItem( SvStream& rIn )
371 : SfxEnumItem(XATTR_LINECAP, rIn)
375 // -----------------------------------------------------------------------------
377 sal_uInt16 XLineCapItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
379 return 1;
382 // -----------------------------------------------------------------------------
384 SfxPoolItem* XLineCapItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
386 XLineCapItem* pRet = new XLineCapItem( rIn );
388 if(nVer < 1)
389 pRet->SetValue(com::sun::star::drawing::LineCap_BUTT);
391 return pRet;
394 // -----------------------------------------------------------------------------
396 SfxPoolItem* XLineCapItem::Clone(SfxItemPool* /*pPool*/) const
398 return new XLineCapItem( *this );
401 // -----------------------------------------------------------------------------
403 SfxItemPresentation XLineCapItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/,
404 SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper*) const
406 rText = OUString();
408 switch( ePres )
410 case SFX_ITEM_PRESENTATION_NONE: return ePres;
412 case SFX_ITEM_PRESENTATION_COMPLETE:
413 case SFX_ITEM_PRESENTATION_NAMELESS:
415 sal_uInt16 nId = 0;
417 switch( GetValue() )
419 default: /*com::sun::star::drawing::LineCap_BUTT*/
420 nId = RID_SVXSTR_LINECAP_BUTT;
421 break;
423 case(com::sun::star::drawing::LineCap_ROUND):
424 nId = RID_SVXSTR_LINECAP_ROUND;
425 break;
427 case(com::sun::star::drawing::LineCap_SQUARE):
428 nId = RID_SVXSTR_LINECAP_SQUARE;
429 break;
432 if( nId )
433 rText = SVX_RESSTR( nId );
435 return ePres;
437 default:
438 return SFX_ITEM_PRESENTATION_NONE;
442 // -----------------------------------------------------------------------------
444 bool XLineCapItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
446 const com::sun::star::drawing::LineCap eCap(GetValue());
447 rVal <<= eCap;
448 return true;
451 // -----------------------------------------------------------------------------
453 bool XLineCapItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
455 com::sun::star::drawing::LineCap eUnoCap;
457 if(!(rVal >>= eUnoCap))
459 // also try an int (for Basic)
460 sal_Int32 nLJ(0);
462 if(!(rVal >>= nLJ))
464 return false;
467 eUnoCap = (com::sun::star::drawing::LineCap)nLJ;
470 OSL_ENSURE(com::sun::star::drawing::LineCap_BUTT == eUnoCap
471 || com::sun::star::drawing::LineCap_ROUND == eUnoCap
472 || com::sun::star::drawing::LineCap_SQUARE == eUnoCap, "Unknown enum value in XATTR_LINECAP (!)");
474 SetValue(sal::static_int_cast< sal_uInt16 >(eUnoCap));
476 return true;
479 // -----------------------------------------------------------------------------
481 sal_uInt16 XLineCapItem::GetValueCount() const
483 // don't forget to update the api interface also
484 return 3;
487 // -----------------------------------------------------------------------------
489 com::sun::star::drawing::LineCap XLineCapItem::GetValue() const
491 const com::sun::star::drawing::LineCap eRetval((com::sun::star::drawing::LineCap)SfxEnumItem::GetValue());
492 OSL_ENSURE(com::sun::star::drawing::LineCap_BUTT == eRetval
493 || com::sun::star::drawing::LineCap_ROUND == eRetval
494 || com::sun::star::drawing::LineCap_SQUARE == eRetval, "Unknown enum value in XATTR_LINECAP (!)");
496 return eRetval;
499 //------------------------------
500 // class XFillTransparenceItem
501 //------------------------------
502 TYPEINIT1_AUTOFACTORY(XFillTransparenceItem, SfxUInt16Item);
504 /*************************************************************************
506 |* XFillTransparenceItem::XFillTransparenceItem(sal_uInt16)
508 *************************************************************************/
510 XFillTransparenceItem::XFillTransparenceItem(sal_uInt16 nFillTransparence) :
511 SfxUInt16Item(XATTR_FILLTRANSPARENCE, nFillTransparence)
515 /*************************************************************************
517 |* XFillTransparenceItem::XFillTransparenceItem(SvStream& rIn)
519 *************************************************************************/
521 XFillTransparenceItem::XFillTransparenceItem(SvStream& rIn) :
522 SfxUInt16Item(XATTR_FILLTRANSPARENCE, rIn)
526 /*************************************************************************
528 |* XFillTransparenceItem::Clone(SfxItemPool* pPool) const
530 *************************************************************************/
532 SfxPoolItem* XFillTransparenceItem::Clone(SfxItemPool* /*pPool*/) const
534 return new XFillTransparenceItem(*this);
537 /*************************************************************************
539 |* SfxPoolItem* XFillTransparenceItem::Create(SvStream& rIn, sal_uInt16 nVer) const
541 *************************************************************************/
543 SfxPoolItem* XFillTransparenceItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
545 return new XFillTransparenceItem(rIn);
548 //------------------------------------------------------------------------
550 SfxItemPresentation XFillTransparenceItem::GetPresentation
552 SfxItemPresentation ePres,
553 SfxMapUnit /*eCoreUnit*/,
554 SfxMapUnit /*ePresUnit*/,
555 OUString& rText, const IntlWrapper *
556 ) const
558 rText = OUString();
560 switch ( ePres )
562 case SFX_ITEM_PRESENTATION_NONE:
563 return ePres;
564 case SFX_ITEM_PRESENTATION_COMPLETE:
565 rText = OUString( ResId( RID_SVXSTR_TRANSPARENCE, DIALOG_MGR() ) ) + ": ";
566 case SFX_ITEM_PRESENTATION_NAMELESS:
567 rText = rText + OUString::number( GetValue() ) + "%";
568 return ePres;
569 default:
570 return SFX_ITEM_PRESENTATION_NONE;
574 //------------------------------
575 // class XFormTextShadowTranspItem
576 //------------------------------
577 TYPEINIT1_AUTOFACTORY(XFormTextShadowTranspItem, SfxUInt16Item);
579 /*************************************************************************
581 |* XFormTextShadowTranspItem::XFormTextShadowTranspItem(sal_uInt16)
583 *************************************************************************/
585 XFormTextShadowTranspItem::XFormTextShadowTranspItem(sal_uInt16 nShdwTransparence) :
586 SfxUInt16Item(XATTR_FORMTXTSHDWTRANSP, nShdwTransparence)
590 /*************************************************************************
592 |* XFormTextShadowTranspItem::XFormTextShadowTranspItem(SvStream& rIn)
594 *************************************************************************/
596 XFormTextShadowTranspItem::XFormTextShadowTranspItem(SvStream& rIn) :
597 SfxUInt16Item(XATTR_FORMTXTSHDWTRANSP, rIn)
601 /*************************************************************************
603 |* XFormTextShadowTranspItem::Clone(SfxItemPool* pPool) const
605 *************************************************************************/
607 SfxPoolItem* XFormTextShadowTranspItem::Clone(SfxItemPool* /*pPool*/) const
609 return new XFormTextShadowTranspItem(*this);
612 /*************************************************************************
614 |* SfxPoolItem* XFormTextShadowTranspItem::Create(SvStream& rIn, sal_uInt16 nVer) const
616 *************************************************************************/
618 SfxPoolItem* XFormTextShadowTranspItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
620 return new XFormTextShadowTranspItem(rIn);
624 //------------------------------
625 // class XFillGradientStepCountItem
626 //------------------------------
627 TYPEINIT1_AUTOFACTORY(XGradientStepCountItem, SfxUInt16Item);
629 /*************************************************************************
631 |* XGradientStepCountItem::XGradientStepCountItem( sal_uInt16 )
633 *************************************************************************/
635 XGradientStepCountItem::XGradientStepCountItem( sal_uInt16 nStepCount ) :
636 SfxUInt16Item( XATTR_GRADIENTSTEPCOUNT, nStepCount )
640 /*************************************************************************
642 |* XGradientStepCountItem::XGradientStepCountItem( SvStream& rIn )
644 *************************************************************************/
646 XGradientStepCountItem::XGradientStepCountItem( SvStream& rIn ) :
647 SfxUInt16Item( XATTR_GRADIENTSTEPCOUNT, rIn )
651 /*************************************************************************
653 |* XGradientStepCountItem::Clone( SfxItemPool* pPool ) const
655 *************************************************************************/
657 SfxPoolItem* XGradientStepCountItem::Clone( SfxItemPool* /*pPool*/) const
659 return new XGradientStepCountItem( *this );
662 /*************************************************************************
664 |* SfxPoolItem* XGradientStepCountItem::Create(SvStream& rIn, sal_uInt16 nVer) const
666 *************************************************************************/
668 SfxPoolItem* XGradientStepCountItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
670 return new XGradientStepCountItem( rIn );
673 //------------------------------------------------------------------------
675 SfxItemPresentation XGradientStepCountItem::GetPresentation
677 SfxItemPresentation ePres,
678 SfxMapUnit /*eCoreUnit*/,
679 SfxMapUnit /*ePresUnit*/,
680 OUString& rText, const IntlWrapper *
681 ) const
683 rText = OUString();
685 switch ( ePres )
687 case SFX_ITEM_PRESENTATION_NONE:
688 return ePres;
689 case SFX_ITEM_PRESENTATION_COMPLETE:
690 // rText = OUString( ResId( RID_SVXSTR_GRADIENTSTEPCOUNT, DIALOG_MGR() ) ) + ": ";
691 case SFX_ITEM_PRESENTATION_NAMELESS:
692 rText += OUString::number(GetValue());
693 return ePres;
694 default:
695 return SFX_ITEM_PRESENTATION_NONE;
700 //------------------------------
701 // class XFillBmpTileItem
702 //------------------------------
703 TYPEINIT1_AUTOFACTORY( XFillBmpTileItem, SfxBoolItem );
705 XFillBmpTileItem::XFillBmpTileItem( sal_Bool bTile ) :
706 SfxBoolItem( XATTR_FILLBMP_TILE, bTile )
710 XFillBmpTileItem::XFillBmpTileItem( SvStream& rIn ) :
711 SfxBoolItem( XATTR_FILLBMP_TILE, rIn )
715 SfxPoolItem* XFillBmpTileItem::Clone( SfxItemPool* /*pPool*/) const
717 return new XFillBmpTileItem( *this );
720 SfxPoolItem* XFillBmpTileItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
722 return new XFillBmpTileItem( rIn );
725 SfxItemPresentation XFillBmpTileItem::GetPresentation
727 SfxItemPresentation ePres,
728 SfxMapUnit /*eCoreUnit*/,
729 SfxMapUnit /*ePresUnit*/,
730 OUString& rText, const IntlWrapper *
731 ) const
733 rText = OUString();
735 switch ( ePres )
737 case SFX_ITEM_PRESENTATION_NONE:
738 return ePres;
739 case SFX_ITEM_PRESENTATION_COMPLETE:
740 case SFX_ITEM_PRESENTATION_NAMELESS:
741 return ePres;
742 default:
743 return SFX_ITEM_PRESENTATION_NONE;
748 //------------------------------
749 // class XFillBmpTilePosItem
750 //------------------------------
751 TYPEINIT1_AUTOFACTORY( XFillBmpPosItem, SfxEnumItem );
753 XFillBmpPosItem::XFillBmpPosItem( RECT_POINT eRP ) :
754 SfxEnumItem( XATTR_FILLBMP_POS, sal::static_int_cast< sal_uInt16 >( eRP ) )
758 XFillBmpPosItem::XFillBmpPosItem( SvStream& rIn ) :
759 SfxEnumItem( XATTR_FILLBMP_POS, rIn )
763 SfxPoolItem* XFillBmpPosItem::Clone( SfxItemPool* /*pPool*/) const
765 return new XFillBmpPosItem( *this );
768 SfxPoolItem* XFillBmpPosItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
770 return new XFillBmpPosItem( rIn );
773 SfxItemPresentation XFillBmpPosItem::GetPresentation
775 SfxItemPresentation ePres,
776 SfxMapUnit /*eCoreUnit*/,
777 SfxMapUnit /*ePresUnit*/,
778 OUString& rText, const IntlWrapper *
779 ) const
781 rText = OUString();
783 switch ( ePres )
785 case SFX_ITEM_PRESENTATION_NONE:
786 return ePres;
787 case SFX_ITEM_PRESENTATION_COMPLETE:
788 case SFX_ITEM_PRESENTATION_NAMELESS:
789 return ePres;
790 default:
791 return SFX_ITEM_PRESENTATION_NONE;
795 sal_uInt16 XFillBmpPosItem::GetValueCount() const
797 return 9;
801 //------------------------------
802 // class XFillBmpTileSizeXItem
803 //------------------------------
804 TYPEINIT1_AUTOFACTORY( XFillBmpSizeXItem, SfxMetricItem );
806 XFillBmpSizeXItem::XFillBmpSizeXItem( long nSizeX ) :
807 SfxMetricItem( XATTR_FILLBMP_SIZEX, nSizeX )
811 XFillBmpSizeXItem::XFillBmpSizeXItem( SvStream& rIn ) :
812 SfxMetricItem( XATTR_FILLBMP_SIZEX, rIn )
816 SfxPoolItem* XFillBmpSizeXItem::Clone( SfxItemPool* /*pPool*/) const
818 return new XFillBmpSizeXItem( *this );
821 SfxPoolItem* XFillBmpSizeXItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
823 return new XFillBmpSizeXItem( rIn );
826 SfxItemPresentation XFillBmpSizeXItem::GetPresentation
828 SfxItemPresentation ePres,
829 SfxMapUnit /*eCoreUnit*/,
830 SfxMapUnit /*ePresUnit*/,
831 OUString& rText, const IntlWrapper *
832 ) const
834 rText = OUString();
836 switch ( ePres )
838 case SFX_ITEM_PRESENTATION_NONE:
839 return ePres;
840 case SFX_ITEM_PRESENTATION_COMPLETE:
841 case SFX_ITEM_PRESENTATION_NAMELESS:
842 return ePres;
843 default:
844 return SFX_ITEM_PRESENTATION_NONE;
848 bool XFillBmpSizeXItem::HasMetrics() const
850 return GetValue() > 0L;
854 //------------------------------
855 // class XFillBmpTileSizeYItem
856 //------------------------------
857 TYPEINIT1_AUTOFACTORY( XFillBmpSizeYItem, SfxMetricItem );
859 XFillBmpSizeYItem::XFillBmpSizeYItem( long nSizeY ) :
860 SfxMetricItem( XATTR_FILLBMP_SIZEY, nSizeY )
864 XFillBmpSizeYItem::XFillBmpSizeYItem( SvStream& rIn ) :
865 SfxMetricItem( XATTR_FILLBMP_SIZEY, rIn )
869 SfxPoolItem* XFillBmpSizeYItem::Clone( SfxItemPool* /*pPool*/) const
871 return new XFillBmpSizeYItem( *this );
874 SfxPoolItem* XFillBmpSizeYItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
876 return new XFillBmpSizeYItem( rIn );
879 SfxItemPresentation XFillBmpSizeYItem::GetPresentation
881 SfxItemPresentation ePres,
882 SfxMapUnit /*eCoreUnit*/,
883 SfxMapUnit /*ePresUnit*/,
884 OUString& rText, const IntlWrapper *
885 ) const
887 rText = OUString();
889 switch ( ePres )
891 case SFX_ITEM_PRESENTATION_NONE:
892 return ePres;
893 case SFX_ITEM_PRESENTATION_COMPLETE:
894 case SFX_ITEM_PRESENTATION_NAMELESS:
895 return ePres;
896 default:
897 return SFX_ITEM_PRESENTATION_NONE;
901 bool XFillBmpSizeYItem::HasMetrics() const
903 return GetValue() > 0L;
907 //------------------------------
908 // class XFillBmpTileLogItem
909 //------------------------------
910 TYPEINIT1_AUTOFACTORY( XFillBmpSizeLogItem, SfxBoolItem );
912 XFillBmpSizeLogItem::XFillBmpSizeLogItem( sal_Bool bLog ) :
913 SfxBoolItem( XATTR_FILLBMP_SIZELOG, bLog )
917 XFillBmpSizeLogItem::XFillBmpSizeLogItem( SvStream& rIn ) :
918 SfxBoolItem( XATTR_FILLBMP_SIZELOG, rIn )
922 SfxPoolItem* XFillBmpSizeLogItem::Clone( SfxItemPool* /*pPool*/) const
924 return new XFillBmpSizeLogItem( *this );
927 SfxPoolItem* XFillBmpSizeLogItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
929 return new XFillBmpSizeLogItem( rIn );
932 SfxItemPresentation XFillBmpSizeLogItem::GetPresentation
934 SfxItemPresentation ePres,
935 SfxMapUnit /*eCoreUnit*/,
936 SfxMapUnit /*ePresUnit*/,
937 OUString& rText, const IntlWrapper *
938 ) const
940 rText = OUString();
942 switch ( ePres )
944 case SFX_ITEM_PRESENTATION_NONE:
945 return ePres;
946 case SFX_ITEM_PRESENTATION_COMPLETE:
947 case SFX_ITEM_PRESENTATION_NAMELESS:
948 return ePres;
949 default:
950 return SFX_ITEM_PRESENTATION_NONE;
955 //------------------------------
956 // class XFillBmpTileOffXItem
957 //------------------------------
958 TYPEINIT1_AUTOFACTORY( XFillBmpTileOffsetXItem, SfxUInt16Item );
960 XFillBmpTileOffsetXItem::XFillBmpTileOffsetXItem( sal_uInt16 nOffX ) :
961 SfxUInt16Item( XATTR_FILLBMP_TILEOFFSETX, nOffX )
965 XFillBmpTileOffsetXItem::XFillBmpTileOffsetXItem( SvStream& rIn ) :
966 SfxUInt16Item( XATTR_FILLBMP_TILEOFFSETX, rIn )
970 SfxPoolItem* XFillBmpTileOffsetXItem::Clone( SfxItemPool* /*pPool*/) const
972 return new XFillBmpTileOffsetXItem( *this );
975 SfxPoolItem* XFillBmpTileOffsetXItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
977 return new XFillBmpTileOffsetXItem( rIn );
980 SfxItemPresentation XFillBmpTileOffsetXItem::GetPresentation
982 SfxItemPresentation ePres,
983 SfxMapUnit /*eCoreUnit*/,
984 SfxMapUnit /*ePresUnit*/,
985 OUString& rText, const IntlWrapper *
986 ) const
988 rText = OUString();
990 switch ( ePres )
992 case SFX_ITEM_PRESENTATION_NONE:
993 return ePres;
994 case SFX_ITEM_PRESENTATION_COMPLETE:
995 case SFX_ITEM_PRESENTATION_NAMELESS:
996 return ePres;
997 default:
998 return SFX_ITEM_PRESENTATION_NONE;
1003 //------------------------------
1004 // class XFillBmpTileOffYItem
1005 //------------------------------
1006 TYPEINIT1_AUTOFACTORY( XFillBmpTileOffsetYItem, SfxUInt16Item );
1008 XFillBmpTileOffsetYItem::XFillBmpTileOffsetYItem( sal_uInt16 nOffY ) :
1009 SfxUInt16Item( XATTR_FILLBMP_TILEOFFSETY, nOffY )
1013 XFillBmpTileOffsetYItem::XFillBmpTileOffsetYItem( SvStream& rIn ) :
1014 SfxUInt16Item( XATTR_FILLBMP_TILEOFFSETY, rIn )
1018 SfxPoolItem* XFillBmpTileOffsetYItem::Clone( SfxItemPool* /*pPool*/) const
1020 return new XFillBmpTileOffsetYItem( *this );
1023 SfxPoolItem* XFillBmpTileOffsetYItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
1025 return new XFillBmpTileOffsetYItem( rIn );
1028 SfxItemPresentation XFillBmpTileOffsetYItem::GetPresentation
1030 SfxItemPresentation ePres,
1031 SfxMapUnit /*eCoreUnit*/,
1032 SfxMapUnit /*ePresUnit*/,
1033 OUString& rText, const IntlWrapper *
1034 ) const
1036 rText = OUString();
1038 switch ( ePres )
1040 case SFX_ITEM_PRESENTATION_NONE:
1041 return ePres;
1042 case SFX_ITEM_PRESENTATION_COMPLETE:
1043 case SFX_ITEM_PRESENTATION_NAMELESS:
1044 return ePres;
1045 default:
1046 return SFX_ITEM_PRESENTATION_NONE;
1051 //------------------------------
1052 // class XFillBmpStretchItem
1053 //------------------------------
1054 TYPEINIT1_AUTOFACTORY( XFillBmpStretchItem, SfxBoolItem );
1056 XFillBmpStretchItem::XFillBmpStretchItem( sal_Bool bStretch ) :
1057 SfxBoolItem( XATTR_FILLBMP_STRETCH, bStretch )
1061 XFillBmpStretchItem::XFillBmpStretchItem( SvStream& rIn ) :
1062 SfxBoolItem( XATTR_FILLBMP_STRETCH, rIn )
1066 SfxPoolItem* XFillBmpStretchItem::Clone( SfxItemPool* /*pPool*/) const
1068 return new XFillBmpStretchItem( *this );
1071 SfxPoolItem* XFillBmpStretchItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
1073 return new XFillBmpStretchItem( rIn );
1076 SfxItemPresentation XFillBmpStretchItem::GetPresentation
1078 SfxItemPresentation ePres,
1079 SfxMapUnit /*eCoreUnit*/,
1080 SfxMapUnit /*ePresUnit*/,
1081 OUString& rText, const IntlWrapper *
1082 ) const
1084 rText = OUString();
1086 switch ( ePres )
1088 case SFX_ITEM_PRESENTATION_NONE:
1089 return ePres;
1090 case SFX_ITEM_PRESENTATION_COMPLETE:
1091 case SFX_ITEM_PRESENTATION_NAMELESS:
1092 return ePres;
1093 default:
1094 return SFX_ITEM_PRESENTATION_NONE;
1099 //------------------------------
1100 // class XFillBmpTileOffPosXItem
1101 //------------------------------
1102 TYPEINIT1_AUTOFACTORY( XFillBmpPosOffsetXItem, SfxUInt16Item );
1104 XFillBmpPosOffsetXItem::XFillBmpPosOffsetXItem( sal_uInt16 nOffPosX ) :
1105 SfxUInt16Item( XATTR_FILLBMP_POSOFFSETX, nOffPosX )
1109 XFillBmpPosOffsetXItem::XFillBmpPosOffsetXItem( SvStream& rIn ) :
1110 SfxUInt16Item( XATTR_FILLBMP_POSOFFSETX, rIn )
1114 SfxPoolItem* XFillBmpPosOffsetXItem::Clone( SfxItemPool* /*pPool*/) const
1116 return new XFillBmpPosOffsetXItem( *this );
1119 SfxPoolItem* XFillBmpPosOffsetXItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
1121 return new XFillBmpPosOffsetXItem( rIn );
1124 SfxItemPresentation XFillBmpPosOffsetXItem::GetPresentation
1126 SfxItemPresentation ePres,
1127 SfxMapUnit /*eCoreUnit*/,
1128 SfxMapUnit /*ePresUnit*/,
1129 OUString& rText, const IntlWrapper *
1130 ) const
1132 rText = OUString();
1134 switch ( ePres )
1136 case SFX_ITEM_PRESENTATION_NONE:
1137 return ePres;
1138 case SFX_ITEM_PRESENTATION_COMPLETE:
1139 case SFX_ITEM_PRESENTATION_NAMELESS:
1140 return ePres;
1141 default:
1142 return SFX_ITEM_PRESENTATION_NONE;
1147 //------------------------------
1148 // class XFillBmpTileOffPosYItem
1149 //------------------------------
1150 TYPEINIT1_AUTOFACTORY( XFillBmpPosOffsetYItem, SfxUInt16Item );
1152 XFillBmpPosOffsetYItem::XFillBmpPosOffsetYItem( sal_uInt16 nOffPosY ) :
1153 SfxUInt16Item( XATTR_FILLBMP_POSOFFSETY, nOffPosY )
1157 XFillBmpPosOffsetYItem::XFillBmpPosOffsetYItem( SvStream& rIn ) :
1158 SfxUInt16Item( XATTR_FILLBMP_POSOFFSETY, rIn )
1162 SfxPoolItem* XFillBmpPosOffsetYItem::Clone( SfxItemPool* /*pPool*/) const
1164 return new XFillBmpPosOffsetYItem( *this );
1167 SfxPoolItem* XFillBmpPosOffsetYItem::Create( SvStream& rIn, sal_uInt16 /*nVer*/) const
1169 return new XFillBmpPosOffsetYItem( rIn );
1172 SfxItemPresentation XFillBmpPosOffsetYItem::GetPresentation
1174 SfxItemPresentation ePres,
1175 SfxMapUnit /*eCoreUnit*/,
1176 SfxMapUnit /*ePresUnit*/,
1177 OUString& rText, const IntlWrapper *
1178 ) const
1180 rText = OUString();
1182 switch ( ePres )
1184 case SFX_ITEM_PRESENTATION_NONE:
1185 return ePres;
1186 case SFX_ITEM_PRESENTATION_COMPLETE:
1187 case SFX_ITEM_PRESENTATION_NAMELESS:
1188 return ePres;
1189 default:
1190 return SFX_ITEM_PRESENTATION_NONE;
1194 //--------------------------
1195 // class XFillBackgroundItem
1196 //--------------------------
1197 TYPEINIT1_AUTOFACTORY(XFillBackgroundItem, SfxBoolItem);
1199 /*************************************************************************
1201 |* XFillBackgroundItem::XFillBackgroundItem( sal_Bool )
1203 *************************************************************************/
1205 XFillBackgroundItem::XFillBackgroundItem( sal_Bool bFill ) :
1206 SfxBoolItem( XATTR_FILLBACKGROUND, bFill )
1210 /*************************************************************************
1212 |* XFillBackgroundItem::XFillBackgroundItem( SvStream& rIn )
1214 *************************************************************************/
1216 XFillBackgroundItem::XFillBackgroundItem( SvStream& rIn ) :
1217 SfxBoolItem( XATTR_FILLBACKGROUND, rIn )
1221 /*************************************************************************
1223 |* XFillBackgroundItem::Clone( SfxItemPool* pPool ) const
1225 *************************************************************************/
1227 SfxPoolItem* XFillBackgroundItem::Clone( SfxItemPool* /*pPool*/) const
1229 return new XFillBackgroundItem( *this );
1232 /*************************************************************************
1234 |* SfxPoolItem* XFillBackgroundItem::Create(SvStream& rIn, sal_uInt16 nVer) const
1236 *************************************************************************/
1238 SfxPoolItem* XFillBackgroundItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const
1240 return new XFillBackgroundItem( rIn );
1243 //------------------------------------------------------------------------
1245 SfxItemPresentation XFillBackgroundItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/,
1246 SfxMapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper*) const
1248 rText = OUString();
1250 switch( ePres )
1252 case SFX_ITEM_PRESENTATION_NONE:
1253 return ePres;
1255 case SFX_ITEM_PRESENTATION_COMPLETE:
1256 case SFX_ITEM_PRESENTATION_NAMELESS:
1257 return ePres;
1258 default:
1259 return SFX_ITEM_PRESENTATION_NONE;
1265 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */