pixmapedit.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3 Copyright (C) 2004 Alexander Dymo <cloudtemple@mskat.net>
4 Copyright (C) 2005 Jaroslaw Staniek <js@iidea.pl>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KPROPERTY_PIXMAPEDIT_H
23#define KPROPERTY_PIXMAPEDIT_H
24
25#include "../widget.h"
26#include <tqpixmap.h>
27#include <tqvariant.h>
28
29class TQLabel;
30class TQPushButton;
31
32namespace KoProperty {
33
34class KOPROPERTY_EXPORT PixmapEdit : public Widget
35{
36 TQ_OBJECT
37
38
39 public:
40 PixmapEdit(Property *property, TQWidget *parent=0, const char *name=0);
41 virtual ~PixmapEdit();
42
43 virtual TQVariant value() const;
44 virtual void setValue(const TQVariant &value, bool emitChange=true);
45 virtual void drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value);
46
47 void resizeEvent(TQResizeEvent *ev);
48 bool eventFilter(TQObject *o, TQEvent *ev);
49
50 protected:
51 virtual void setReadOnlyInternal(bool readOnly);
52
53 protected slots:
58 TQString selectPixmapFileName();
59
61 virtual void selectPixmap();
62
63 protected:
64 TQLabel *m_edit;
65 TQLabel *m_popup;
66 TQPushButton *m_button;
67 TQVariant m_recentlyPainted;
68 TQPixmap m_pixmap, m_scaledPixmap, m_previewPixmap;
69};
70
71}
72
73#endif
Namespace for a set of classes implementing generic properties framework.