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: frqitem.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>
38 #ifndef _TOOLS_TIME_HXX //autogen
39 #include <tools/time.hxx>
42 #ifndef _DATETIME_HXX //autogen
43 #include <tools/datetime.hxx>
47 #include <tools/string.hxx>
50 #include <bf_svtools/poolitem.hxx>
57 DBG_NAMEEX(SfxFrequencyItem
)
59 // class SfxFrequencyItem -------------------------------------------------
61 ///////////////////////////////////////////////////////////////////////////////
68 nInterval1 = USHRT_MAX
71 + wiederhole jede X'te Woche
74 + an SU, MO, TU, WE, TH, FR, SA
75 nInterval2 = WD_SUNDAY | WD_MONDAY | WD_TUESDAY | WD_WEDNESDAY |
76 WD_THURSDAY | WD_FRIDAY | WD_SATURDAY
79 * jeden X'ten Tag von jedem X'ten Monat
84 * jeden ersten, zweiten, dritten, vierten oder letzten Wochentag jeden X'ten Monats
86 nInterval2 = WD_SUNDAY | WD_MONDAY | WD_TUESDAY | WD_WEDNESDAY |
87 WD_THURSDAY | WD_FRIDAY | WD_SATURDAY
90 ===============================================================================
94 nTime1 = 00:00:00 - 24:00:00
97 * Wiederhole alle X Stunden
99 + zwischen Uhrzeit 1 und 2
100 nTime1 = 00:00:00 - 24:00:00
101 nTime2 = 00:00:00 - 24:00:00
104 ///////////////////////////////////////////////////////////////////////////////
110 FRQ_MONTHLY_DAILY
= 3,
111 FRQ_MONTHLY_LOGIC
= 4
114 enum FrequencyTimeMode
118 FRQ_TIME_REPEAT_RANGE
= 3
121 #define WD_SUNDAY 0x0001
122 #define WD_MONDAY 0x0002
123 #define WD_TUESDAY 0x0004
124 #define WD_WEDNESDAY 0x0008
125 #define WD_THURSDAY 0x0010
126 #define WD_FRIDAY 0x0020
127 #define WD_SATURDAY 0x0040
129 class SfxFrequencyItem
: public SfxPoolItem
132 FrequencyMode eFrqMode
;
133 FrequencyTimeMode eFrqTimeMode
;
144 DateTime aMissingDate
;
149 SfxFrequencyItem( const SfxFrequencyItem
& rCpy
);
150 SfxFrequencyItem( USHORT nWhich
, FrequencyMode eMode
, FrequencyTimeMode eTMode
,
151 USHORT nDI1
, USHORT nDI2
, USHORT nDI3
, USHORT nTI1
,
152 const Time
& rT1
, const Time
& rT2
);
153 ~SfxFrequencyItem() { DBG_DTOR(SfxFrequencyItem
, 0); }
155 virtual int operator==( const SfxPoolItem
& ) const;
156 using SfxPoolItem::Compare
;
157 virtual int Compare( const SfxPoolItem
&rWith
) const;
158 virtual SfxPoolItem
* Create( SvStream
&, USHORT nItemVersion
) const;
159 virtual SvStream
& Store( SvStream
&, USHORT nItemVersion
) const;
160 virtual SfxPoolItem
* Clone( SfxItemPool
* pPool
= 0 ) const;
161 virtual SfxItemPresentation
GetPresentation( SfxItemPresentation ePres
,
162 SfxMapUnit eCoreMetric
, SfxMapUnit ePresMetric
, XubString
&rText
,
163 const ::IntlWrapper
* = 0 ) const;
165 BOOL
HasMissingDate() const { return bMissingDate
; }
166 DateTime
GetMissingDate() const { return aMissingDate
; }
168 FrequencyMode
GetFrequencyMode() const { return eFrqMode
; }
169 FrequencyTimeMode
GetFrequencyTimeMode() const { return eFrqTimeMode
; }
170 USHORT
GetDInterval_1() const { return nDInterval1
; }
171 USHORT
GetDInterval_2() const { return nDInterval2
; }
172 USHORT
GetDInterval_3() const { return nDInterval3
; }
173 USHORT
GetTInterval_1() const { return nTInterval1
; }
174 const Time
& GetTime_1() const { return aTime1
; }
175 const Time
& GetTime_2() const { return aTime2
; }
177 void SetFrequencyMode(FrequencyMode eNew
) { eFrqMode
= eNew
; }
178 void SetFrequencyTimeMode(FrequencyTimeMode eNew
){ eFrqTimeMode
= eNew
; }
179 void SetDInterval_1(USHORT nNew
) { nDInterval1
= nNew
; }
180 void SetDInterval_2(USHORT nNew
) { nDInterval2
= nNew
; }
181 void SetDInterval_3(USHORT nNew
) { nDInterval3
= nNew
; }
182 void SetTInterval_1(USHORT nNew
) { nTInterval1
= nNew
; }
183 void SetTime_1(const Time
& rNew
) { aTime1
= rNew
; }
184 void SetTime_2(const Time
& rNew
) { aTime2
= rNew
; }