.TH "ThumbCreator" 3 "28 Jan 2004" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ThumbCreator \- This is the baseclass for 'thumbnail-plugins' in \fBKDE\fP.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <thumbcreator.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum \fBFlags\fP { \fBNone\fP =  0, \fBDrawFrame\fP =  1, \fBBlendIcon\fP =  2 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBcreate\fP (const  \fBQString\fP &path, int width, int height, \fBQImage\fP &img)=0"
.br
.RI "\fICreates a thumbnail Note that the width and height parameters should not be used for scaling. \fP"
.ti -1c
.RI "virtual Flags \fBflags\fP () const "
.br
.RI "\fIThe flags of this plugin: 
.IP "\(bu" 2
None nothing special 
.IP "\(bu" 2
DrawFrame a frame should be painted around the preview 
.IP "\(bu" 2
BlendIcon the mimetype icon should be blended over the preview. 
.PP
\fP"
.in -1c
.SH "Detailed Description"
.PP 
This is the baseclass for 'thumbnail-plugins' in \fBKDE\fP. 

Using the class \fBKIO::PreviewJob\fP allows you to generate small images (thumbnails) for any kind of file, where a 'ThumbCreator' is available. Have a look at kdebase/kioslave/thumbnail/ for existing ThumbCreators.
.PP
What you need to do to create and register a ThumbCreator: 
.IP "\(bu" 2
Inherit from this class and reimplement the \fBcreate\fP() method to generate a thumbnail for the given file-path. 
.IP "\(bu" 2
Provide a factory method in your implementation file to instantiate your plugin, e.g.: 
.PP
.nf

 extern 'C'
 {
   ThumbCreator *new_creator()
   {
     return new YourThumbCreator();
   }
 };
 
.PP

.PP
Compile your ThumbCreator as a module. The contents of Makefile.am need to look like this: 
.PP
.nf

 INCLUDES = 
 LDFLAGS =  
 kde_module_LTLIBRARIES = yourthumbcreator.la
 yourthumbcreator_la_SOURCES = yourthumbcreator.cpp
 yourthumbcreator_la_LIBADD = 
 yourthumbcreator_la_LDFLAGS =  -module 
 servicedir = 
 service_DATA = yourthumbcreator.desktop
 
.PP
.PP
.IP "\(bu" 2
Create a file yourthumbcreator.desktop with the following contents: 
.PP
.nf

 [Desktop Entry]
 Encoding=UTF-8
 Type=Service
 Name=Name of the type of files your ThumbCreator supports
 ServiceTypes=ThumbCreator
 MimeTypes=application/x-somemimetype
 CacheThumbnail=true
 X-KDE-Library=yourthumbcreator
 
.PP

.PP
You can supply a comma-separated list of mimetypes to the MimeTypes entry, naming all mimetypes your ThumbCreator supports. You can also use simple wildcards, like 
.PP
Definition at line 84 of file thumbcreator.h.
.SH "Member Function Documentation"
.PP 
.SS "virtual bool ThumbCreator::create (const \fBQString\fP & path, int width, int height, \fBQImage\fP & img)\fC [pure virtual]\fP"
.PP
Creates a thumbnail Note that the width and height parameters should not be used for scaling. Only plugins that create an image 'from scratch', like the TextCreator should directly use the specified size. If the resulting preview is larger than width x height, it will be scaled down.
.PP
\fBParameters:\fP
.RS 4
\fIpath\fP the (always local) file path to create a preview for 
.br
\fIwidth\fP maximum width for the preview 
.br
\fIheight\fP maximum height for the preview 
.br
\fIimg\fP this image will contain the preview on success
.RE
.PP
\fBReturns:\fP
.RS 4
true if preview generation succeeded 
.RE
.PP

.SS "virtual Flags ThumbCreator::flags () const\fC [inline, virtual]\fP"
.PP
The flags of this plugin: 
.IP "\(bu" 2
None nothing special 
.IP "\(bu" 2
DrawFrame a frame should be painted around the preview 
.IP "\(bu" 2
BlendIcon the mimetype icon should be blended over the preview. 
.PP
\fBReturns:\fP
.RS 4
flags for this plugin 
.RE
.PP
Definition at line 113 of file thumbcreator.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kio Library from the source code.
