Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svtools / frqitem.hxx
blob7c91559212764df8955fa31418d76f6f635fde72
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: frqitem.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 _FRQITEM_HXX
32 #define _FRQITEM_HXX
34 #ifndef _RTTI_HXX
35 #include <tools/rtti.hxx>
36 #endif
38 #ifndef _TOOLS_TIME_HXX //autogen
39 #include <tools/time.hxx>
40 #endif
42 #ifndef _DATETIME_HXX //autogen
43 #include <tools/datetime.hxx>
44 #endif
46 #ifndef _STRING_HXX
47 #include <tools/string.hxx>
48 #endif
50 #include <bf_svtools/poolitem.hxx>
52 class SvStream;
54 namespace binfilter
57 DBG_NAMEEX(SfxFrequencyItem)
59 // class SfxFrequencyItem -------------------------------------------------
61 ///////////////////////////////////////////////////////////////////////////////
63 FRQ_DAILY
64 * jeden X'ten Tag
65 nInterval1 = 1 .. 999
67 * jeden Wochentag
68 nInterval1 = USHRT_MAX
70 FRQ_WEEKLY
71 + wiederhole jede X'te Woche
72 nInterval1 = 1 .. 99
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
78 FRQ_MONTHLY_DAILY
79 * jeden X'ten Tag von jedem X'ten Monat
80 nInterval1 = 1 .. 31
81 nInterval2 = 1 .. 6
83 FRQ_MONTHLY_LOGIC
84 * jeden ersten, zweiten, dritten, vierten oder letzten Wochentag jeden X'ten Monats
85 nInterval1 = 0 .. 4
86 nInterval2 = WD_SUNDAY | WD_MONDAY | WD_TUESDAY | WD_WEDNESDAY |
87 WD_THURSDAY | WD_FRIDAY | WD_SATURDAY
88 nInterval3 = 1 .. 6
90 ===============================================================================
92 FRQ_TIME_AT
93 * Update um Uhrzeit
94 nTime1 = 00:00:00 - 24:00:00
96 FRQ_TIME_REPEAT
97 * Wiederhole alle X Stunden
98 nTInterval1 = 1 .. 8
99 + zwischen Uhrzeit 1 und 2
100 nTime1 = 00:00:00 - 24:00:00
101 nTime2 = 00:00:00 - 24:00:00
104 ///////////////////////////////////////////////////////////////////////////////
106 enum FrequencyMode
108 FRQ_DAILY = 1,
109 FRQ_WEEKLY = 2,
110 FRQ_MONTHLY_DAILY = 3,
111 FRQ_MONTHLY_LOGIC = 4
114 enum FrequencyTimeMode
116 FRQ_TIME_AT = 1,
117 FRQ_TIME_REPEAT = 2,
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
131 private:
132 FrequencyMode eFrqMode;
133 FrequencyTimeMode eFrqTimeMode;
135 USHORT nDInterval1;
136 USHORT nDInterval2;
137 USHORT nDInterval3;
139 USHORT nTInterval1;
140 Time aTime1;
141 Time aTime2;
143 BOOL bMissingDate;
144 DateTime aMissingDate;
146 public:
147 TYPEINFO();
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; }
189 #endif