.TH "ThumbCreator" kde3 "11 Jun 2005" "Version Version 3.4.1" "kio Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ThumbCreator \- This is the baseclass for 'thumbnail-plugins' in \fBKDE\fP. Baseclass for thumbnail-generating plugins.  

.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
.ti -1c
.RI "virtual \fBFlags\fP \fBflags\fP () const "
.br
.in -1c
.SH "Detailed Description"
.PP 
This is the baseclass for 'thumbnail-plugins' in \fBKDE\fP. Baseclass for thumbnail-generating plugins. 

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: 
.PD 0

.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();
   }
 };

.fi
.PP

.PP
Compile your ThumbCreator as a module. The contents of Makefile.am need to look like this: 
.PP
.nf
 INCLUDES = $(all_includes)
 kde_module_LTLIBRARIES = yourthumbcreator.la
 yourthumbcreator_la_SOURCES = yourthumbcreator.cpp
 yourthumbcreator_la_LIBADD = $(LIB_KIO)
 yourthumbcreator_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
 kde_services_DATA = yourthumbcreator.desktop

.fi
.PP
.PP
.PD 0
.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

.fi
.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 (where you see [slash], put a /) 
.PP
.nf
              text[slash]* or image[slash]*.

.fi
.PP
.PP
If your plugin is rather inexpensive (e.g. like the text preview ThumbCreator), you can set CacheThumbnail=false to prevent your thumbnails from being cached on disk.
.PP
Definition at line 82 of file thumbcreator.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "enum \fBThumbCreator::Flags\fP"
.PP
The flags of this plugin. 
.PP
\fBSee also:\fP
.RS 4
\fBflags()\fP 
.RE
.PP

.PP
Definition at line 89 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. 
.PP
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 \fBFlags\fP ThumbCreator::flags () const\fC [inline, virtual]\fP"
.PP
The flags of this plugin: 
.PD 0

.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

.PP
\fBReturns:\fP
.RS 4
flags for this plugin 
.RE
.PP

.PP
Definition at line 117 of file thumbcreator.h.

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