2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __WETableCalcMatrix_H__
24 #define __WETableCalcMatrix_H__
26 #import <Foundation/NSObject.h>
27 #import <Foundation/NSMapTable.h>
28 #import <Foundation/NSRange.h>
33 Object to calculate HTML Table based charts, eg the
34 Appointment week-overview.
37 @interface WETableCalcMatrixSpan : NSObject
43 + (id)spanWithObject:(id)_obj range:(NSRange *)_range;
44 - (id)initWithObject:(id)_obj range:(NSRange *)_range;
51 /* calculates accessors */
53 - (BOOL)startsAtIndex:(unsigned)_idx;
54 - (BOOL)occupiesIndex:(unsigned)_idx;
59 @interface WETableCalcMatrix : NSObject
63 unsigned short height;
65 id delegate; /* non-retained */
70 - (id)initWithSize:(unsigned)_width:(unsigned)_height;
72 /* static accessors */
77 - (void)setDelegate:(id)_delegate;
80 /* clearing the structure */
82 - (void)removeAllObjects;
86 - (void)placeObjects:(NSArray *)_objects;
87 - (void)placeObject:(id)_object;
91 - (NSArray *)objectsInColumn:(unsigned)_x;
92 - (NSArray *)objectsInRow:(unsigned)_y;
93 - (NSArray *)spansOfColumn:(unsigned)_x;
94 - (NSArray *)spansOfRow:(unsigned)_y;
95 - (NSArray *)columnSpans;
96 - (NSArray *)rowSpans;
100 @interface NSObject(WETableCalcMatrixDelegate)
102 /* method for optimizing matrix scan (not required) */
104 - (BOOL)tableCalcMatrix:(WETableCalcMatrix *)_matrix
105 shouldProcessColumn:(unsigned)_x
106 forObject:(id)_object;
107 - (BOOL)tableCalcMatrix:(WETableCalcMatrix *)_matrix
108 shouldProcessRow:(unsigned)_y
109 forObject:(id)_object;
111 /* shall the object be placed at the specified coordinate ? */
113 - (BOOL)tableCalcMatrix:(WETableCalcMatrix *)_matrix
114 shouldPlaceObject:(id)_object
115 atPosition:(unsigned)_x:(unsigned)_y;
117 /* define if you want to create own span objects */
119 - (id)tableCalcMatrix:(WETableCalcMatrix *)_matrix
120 spanForObject:(id)_object
121 range:(NSRange)_range;
125 #endif /* __WETableCalcMatrix_H__ */