#ifndef GALLERYWINDOW_HPP
#define GALLERYWINDOW_HPP

// $VER: GalleryWindow.hpp 39.7 (05.06.97)
//
//
// (C) Copyright 1996,97 Markus Hillenbrand
//     All Rights Reserved, No Warranty

#include <GUIC_Classes/GUIC_Button.hpp>
#include <GUIC_Classes/GUIC_Register.hpp>
#include <GUIC_Classes/GUIC_FileString.hpp>
#include <GUIC_Classes/GUIC_FileExamine.hpp>
#include <GUIC_Classes/GUIC_PathString.hpp>
#include <GUIC_Classes/GUIC_SlidingInteger.hpp>
#include <GUIC_Classes/GUIC_Checkbox.hpp>
#include <GUIC_Classes/GUIC_Integer.hpp>
#include <GUIC_Classes/GUIC_Label.hpp>
#include <GUIC_Classes/GUIC_String.hpp>
#include <GUIC_Classes/GUIC_Screen.hpp>
#include <GUIC_Classes/GUIC_Application.hpp>
#include <GUIC_Classes/GUIC_Window.hpp>

// Defines 
#define MINLINES							3
#define MINCOLUMNS					3	
#define MAXLINES							200
#define MAXCOLUMNS					200	
#define DEFAULTLINES					3
#define DEFAULTCOLUMNS			5
#define MENUFRAMEWIDTH			150
#define MINTHUMBNAILWIDTH 		50
#define MINTHUMBNAILHEIGHT		50
#define MAXTHUMBNAILWIDTH		200
#define MAXTHUMBNAILHEIGHT	200
#define DEFTHUMBNAILWIDTH 		100
#define DEFTHUMBNAILHEIGHT		100
#define MINTABLEBORDERSIZE		0
#define MAXTABLEBORDERSIZE	20
#define DEFTABLEBORDERSIZE		4

#define COPYRIGHT	"<SMALL> index file created with 'Gallery', (c) 1997 by <A HREF=\"http://www.student.uni-kl.de/~hillenbr\" TARGET=_top>Markus Hillenbrand</A> </SMALL>"
#define FILEFILTER 	"#?.(jpeg|jpg|gif|iff|ilbm|iff24|bmp|pcx|tiff)"
#define COMMAND		"C:GfxCon_68020 >CON:0/999/640/150/Gallery-Output/AUTO/INACTIVE \"%s\" TO \"%s\" FORMAT JPEG QUALITY 90 BOXFIT %ld %ld"

extern class StatusWindowC;

class GalleryWindowC 	: public GUIC_WindowC
	{
	public:
		GalleryWindowC					(GUIC_ApplicationC *app, GUIC_ScreenC *screen, StatusWindowC *sWindow);
		~GalleryWindowC 				(VOID);
		BOOL 	action					(GUIC_EventC &);
	protected:
		ULONG	scanDirectory		(STRPTR dir, STRPTR pattern, BOOL allFiles);
		VOID		generateGallery	(VOID);
		STRING 	makeThumbnail	(GUIC_FileExamineC &file, LONG thumbnailWidth, LONG thumbnailHeight);
		VOID 		createGallery		(GUIC_ListC &fileList, STRPTR pattern, LONG linesInTable, LONG columnsInTable, BOOL picClick, BOOL showSize, BOOL showDate, LONG menuFrameWidth, LONG thumbnailWidth, LONG thumbnailHeight, LONG tableBorderSize, STRPTR baseName, BOOL noFrames);
		VOID 		createHTML		(GUIC_ListC &fileList, STRPTR pattern, BOOL showDate, LONG tableBorderSize, STRPTR baseName, BOOL noFrames);
		VOID		cleanUp 				(VOID);
	private:
		GUIC_ButtonC				*start, *quit;
		GUIC_RegisterC			*reg;
		GUIC_FileStringC			*pattern;
		GUIC_PathStringC		*directory;
		GUIC_SlidingIntegerC 	*lines, *columns, *width, *height, *tableBorder;
		GUIC_CheckboxC		*click, *size, *date, *noFrames, *createAll;
		GUIC_IntegerC				*frame;
		GUIC_LabelC				*dirLabel, *pattLabel, *linesLabel, *columnsLabel, *clickLabel, *sizeLabel, *dateLabel, *frameLabel, *widthLabel, *heightLabel, *tableBorderLabel, *baseNameLabel, *noFramesLabel, *createAllLabel, *programLabel;
		GUIC_StringC				*baseName, *program;
		GUIC_ScreenC				*screen;
		GUIC_ApplicationC		*app;
		GUIC_ListC					fileList, errorList;
		
		StatusWindowC	*sWindow;
		LONG					totalFiles, actualFiles;
	};

#endif

