//
//  BXImageBrowserCell.h
//  BXAppKit
//
//  Created by Michael Ehrmann on 04.12.06.
//  Copyright 2006 Boinx Software. All rights reserved.
//

// #import <Cocoa/Cocoa.h> //Imported in PrefixHeader

//#define showMethodNames
//#define debugScaling
//#define debugRects
//#define debugDrawing

extern CGFloat BXImageBrowserCellShadowOffsetX;
extern CGFloat BXImageBrowserCellShadowOffsetY;
extern CGFloat BXImageBrowserCellShadowBlurRadius;
extern CGFloat BXImageBrowserCellShadowColorRed;
extern CGFloat BXImageBrowserCellShadowColorGreen;
extern CGFloat BXImageBrowserCellShadowColorBlue;
extern CGFloat BXImageBrowserCellShadowColorAlpha;
extern CGFloat BXImageBrowserCellBackgroundColorThreshold;
extern CGFloat BXImageBrowserCellBorderColorMaxBrightness;



@interface BXImageBrowserCell : NSCell {
	
	id representedImageBrowserItem;
	NSString *imageName;
	
	BOOL drawImageNames;
	BOOL drawShadow;
	BOOL drawBorder;
	
	CGFloat selectionCornerRadius;
	
	NSColor *selectionColor;
	NSColor* backgroundColor;
	NSColor* imageNameColor;
	
	NSSize _originalSize;
	NSSize _innerPadding;
	
	NSRect _imageRect;
	NSRect _titleRect;
	
	CIImage *_thumbnailCheckerboardImage;
	CIImage *_thumbnailUsedMarkImage;
	CIImage *_thumbnailUsedMarkBandImage;
}

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;

- (id) initWithImageBrowserItem:(id)inItem;

- (NSRect)drawRectForBounds:(NSRect)theRect;
- (NSRect)markBandRectForBounds:(NSRect)inBounds;
- (NSRect)markRectForBounds:(NSRect)inBounds;
- (NSRect)imageRectForBounds:(NSRect)theRect;
- (NSRect)titleRectForBounds:(NSRect)theRect;

- (NSRect)currentImageRect;
- (NSRect)currentTitleRect;

- (id)representedImageBrowserItem;
- (void)setRepresentedImageBrowserItem:(id)inRepresentedImageBrowserItem;

- (NSSize)imageSize;

- (NSString*)imageName;
- (void)setImageName:(NSString*)name;

- (BOOL)drawImageNames;
- (void)setDrawImageNames:(BOOL)value;
- (void)setImageNameColor:(NSColor*)value;
- (void)toggleDrawImageNames;

- (BOOL)drawShadow;
- (void)setDrawShadow:(BOOL)value;
- (void)toggleDrawShadow;

- (BOOL)drawBorder;
- (void)setDrawBorder:(BOOL)value;
- (void)toggleDrawBorder;

- (CGFloat)selectionCornerRadius;
- (void)setSelectionCornerRadius:(CGFloat)value;

- (NSColor*)selectionColor;
- (void)setSelectionColor:(NSColor*)value;

- (NSColor*)backgroundColor;
- (void)setBackgroundColor:(NSColor*)value;

- (NSSize)innerPadding;
- (void)setInnerPadding:(NSSize)value;
@end
