merge the formfield patch from ooo-build
[ooovba.git] / binfilter / inc / bf_svtools / dtritem.hxx
blob6287199af466d48f792208aa9d8e277fb006bc2f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dtritem.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DTRITEM_HXX
32 #define _DTRITEM_HXX
34 #ifndef _RTTI_HXX
35 #include <tools/rtti.hxx>
36 #endif
38 #ifndef _DATETIME_HXX
39 #include <tools/datetime.hxx>
40 #endif
42 #include <bf_svtools/poolitem.hxx>
44 class SvStream;
46 namespace binfilter {
48 DBG_NAMEEX(SfxDateTimeRangeItem)
50 // class SfxDateTimeRangeItem -------------------------------------------------
52 class SfxDateTimeRangeItem : public SfxPoolItem
54 private:
55 DateTime aStartDateTime;
56 DateTime aEndDateTime;
58 public:
59 TYPEINFO();
61 SfxDateTimeRangeItem( const SfxDateTimeRangeItem& rCpy );
62 SfxDateTimeRangeItem( USHORT nWhich, const DateTime& rStartDT,
63 const DateTime& rEndDT );
65 ~SfxDateTimeRangeItem()
66 { DBG_DTOR(SfxDateTimeRangeItem, 0); }
68 virtual int operator==( const SfxPoolItem& ) const;
69 using SfxPoolItem::Compare;
70 virtual int Compare( const SfxPoolItem &rWith ) const;
71 virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const;
72 virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const;
73 virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
74 virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
75 SfxMapUnit eCoreMetric,
76 SfxMapUnit ePresMetric,
77 XubString &rText,
78 const ::IntlWrapper * pIntlWrapper = 0 )
79 const;
81 virtual BOOL PutValue ( const ::com::sun::star::uno::Any& rVal,
82 BYTE nMemberId = 0 );
83 virtual BOOL QueryValue( ::com::sun::star::uno::Any& rVal,
84 BYTE nMemberId = 0 ) const;
86 const DateTime& GetStartDateTime() const { return aStartDateTime; }
87 const DateTime& GetEndDateTime() const { return aEndDateTime; }
89 void SetStartDateTime( const DateTime& rDT )
90 { DBG_ASSERT( GetRefCount() == 0, "SetDateTime() with pooled item" );
91 aStartDateTime = rDT; }
93 void SetEndDateTime( const DateTime& rDT )
94 { DBG_ASSERT( GetRefCount() == 0, "SetDateTime() with pooled item" );
95 aEndDateTime = rDT; }
100 #endif