2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __WETableCalcMatrix_H__
23 #define __WETableCalcMatrix_H__
25 #import <Foundation/NSObject.h>
26 #import <Foundation/NSMapTable.h>
27 #import <Foundation/NSRange.h>
32 Object to calculate HTML Table based charts, eg the
33 Appointment week-overview.
36 @interface WETableCalcMatrixSpan : NSObject
42 + (id)spanWithObject:(id)_obj range:(NSRange *)_range;
43 - (id)initWithObject:(id)_obj range:(NSRange *)_range;
50 /* calculates accessors */
52 - (BOOL)startsAtIndex:(unsigned)_idx;
53 - (BOOL)occupiesIndex:(unsigned)_idx;
58 @interface WETableCalcMatrix : NSObject
62 unsigned short height;
64 id delegate; /* non-retained */
69 - (id)initWithSize:(unsigned)_width:(unsigned)_height;
71 /* static accessors */
76 - (void)setDelegate:(id)_delegate;
79 /* clearing the structure */
81 - (void)removeAllObjects;
85 - (void)placeObjects:(NSArray *)_objects;
86 - (void)placeObject:(id)_object;
90 - (NSArray *)objectsInColumn:(unsigned)_x;
91 - (NSArray *)objectsInRow:(unsigned)_y;
92 - (NSArray *)spansOfColumn:(unsigned)_x;
93 - (NSArray *)spansOfRow:(unsigned)_y;
94 - (NSArray *)columnSpans;
95 - (NSArray *)rowSpans;
99 @interface NSObject(WETableCalcMatrixDelegate)
101 /* method for optimizing matrix scan (not required) */
103 - (BOOL)tableCalcMatrix:(WETableCalcMatrix *)_matrix
104 shouldProcessColumn:(unsigned)_x
105 forObject:(id)_object;
106 - (BOOL)tableCalcMatrix:(WETableCalcMatrix *)_matrix
107 shouldProcessRow:(unsigned)_y
108 forObject:(id)_object;
110 /* shall the object be placed at the specified coordinate ? */
112 - (BOOL)tableCalcMatrix:(WETableCalcMatrix *)_matrix
113 shouldPlaceObject:(id)_object
114 atPosition:(unsigned)_x:(unsigned)_y;
116 /* define if you want to create own span objects */
118 - (id)tableCalcMatrix:(WETableCalcMatrix *)_matrix
119 spanForObject:(id)_object
120 range:(NSRange)_range;
124 #endif /* __WETableCalcMatrix_H__ */