1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dtritem.hxx,v $
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 ************************************************************************/
35 #include <tools/rtti.hxx>
39 #include <tools/datetime.hxx>
42 #include <bf_svtools/poolitem.hxx>
48 DBG_NAMEEX(SfxDateTimeRangeItem
)
50 // class SfxDateTimeRangeItem -------------------------------------------------
52 class SfxDateTimeRangeItem
: public SfxPoolItem
55 DateTime aStartDateTime
;
56 DateTime aEndDateTime
;
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
,
78 const ::IntlWrapper
* pIntlWrapper
= 0 )
81 virtual BOOL
PutValue ( const ::com::sun::star::uno::Any
& rVal
,
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" );