lib

KoPictureClipart.h
1/* This file is part of the KDE project
2 Copyright (c) 2001 Simon Hausmann <hausmann@kde.org>
3 Copyright (C) 2002, 2004 Nicolas GOUTTE <goutte@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20#ifndef __koPictureClipart_h__
21#define __koPictureClipart_h__
22
23#include <tqstring.h>
24#include <tqpicture.h>
25
26class TQPainter;
27class TQSize;
28
29// TODO: fix documentation
30
35class KoPictureClipart : public KoPictureBase
36{
37public:
41 KoPictureClipart();
42
46 virtual ~KoPictureClipart();
47
48 virtual KoPictureType::Type getType(void) const;
49
50 virtual KoPictureBase* newCopy(void) const;
51
52
56 virtual bool isNull(void) const;
57
73 virtual void draw(TQPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false);
74
75 virtual bool loadData(const TQByteArray& array, const TQString& extension);
76
81 virtual bool save(TQIODevice* io) const;
82
83 virtual TQSize getOriginalSize(void) const;
84
85 virtual TQPixmap generatePixmap(const TQSize& size, bool smoothScale = false);
86
87 virtual TQString getMimeType(const TQString& extension) const;
88
89protected:
90 TQPixmap getPixmap(TQImage& image);
95 void drawTQPicture(TQPicture& clipart, TQPainter& painter,
96 int x, int y, int width, int height, int sx, int sy, int sw, int sh);
97protected:
98 TQPicture m_clipart;
99 TQByteArray m_rawData;
100};
101
102#endif /* __koPictureClipart_h__ */