diff options
Diffstat (limited to 'Source/CMCopyTable.h')
-rw-r--r-- | Source/CMCopyTable.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/CMCopyTable.h b/Source/CMCopyTable.h index 6baa2527..948607bc 100644 --- a/Source/CMCopyTable.h +++ b/Source/CMCopyTable.h @@ -25,6 +25,8 @@ #import <AppKit/AppKit.h> #import "SPTableView.h" +#define SP_MAX_CELL_WIDTH 200 + @class SPDataStorage; /*! @@ -112,6 +114,40 @@ */ - (void)setTableData:(SPDataStorage *)theTableStorage; +/*! + @method autodetectColumnWidthsForFont: + @abstract Autodetect and return column widths based on contents + @discussion Support autocalculating column widths for the represented data. + This uses the underlying table storage, calculates string widths, + and eventually returns an array of table column widths. + Suitable for calling on background threads, but ensure that the + data storage range in use (currently rows 1-200) won't be altered + while this accesses it. + @param The font to use when calculating widths + @result A dictionary - mapped by column identifier - of the column widths to use +*/ +- (NSDictionary *) autodetectColumnWidthsForFont:(NSFont *)theFont; + +/*! + @method autodetectWidthForColumnDefinition:usingFont:maxRows: + @abstract Autodetect and return column width based on contents + @discussion Support autocalculating column width for the represented data. + This uses the underlying table storage, and the supplied column definition, + iterating through the data and returning a reasonable column width to + display that data. + Suitable for calling on background threads, but ensure that the data + storage range in use won't be altered while being accessed. + @param A column definition for a represented column; the column to use is derived + @param The font to use when calculating widths + @param The maximum number of rows to process when looking at string lengths + @result A reasonable column width to use when displaying data +*/ +/** + * Autodetect the column width for a specified column - derived from the supplied + * column definition, using the stored data and the specified font. + */ +- (NSUInteger)autodetectWidthForColumnDefinition:(NSDictionary *)columnDefinition usingFont:(NSFont *)theFont maxRows:(NSUInteger)rowsToCheck; + @end extern NSInteger MENU_EDIT_COPY; |