chalk

kis_text_brush.h
1/*
2 * Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef _KIS_TEXT_BRUSH_H_
20#define _KIS_TEXT_BRUSH_H_
21
22#include "wdgtextbrush.h"
23#include "kis_brush.h"
24
25class KisTextBrushResource : public KisBrush
26{
27 public:
28 KisTextBrushResource() : KisBrush("")
29 {
30 setBrushType(MASK);
31 }
32 KisTextBrushResource(const TQString& txt, const TQFont& font) : KisBrush("")
33 {
34 setFont(font);
35 setText(txt);
36 updateBrush();
37 setBrushType(MASK);
38 };
39 public:
40 virtual bool load() { return false; };
41 void setText(const TQString& txt) { m_txt = txt; };
42 void setFont(const TQFont& font) { m_font = font; };
43 void updateBrush();
44 private:
45 TQFont m_font;
46 TQString m_txt;
47};
48
49class KisTextBrush : public KisWdgTextBrush
50{
51 TQ_OBJECT
52
53public:
54 KisTextBrush(TQWidget *parent, const char* name, const TQString& caption);
55
56signals:
57 void activatedResource(KisResource *r);
58
59private slots:
60 void rebuildTextBrush();
61 void getFont();
62
63private:
64 KisTextBrushResource* m_textBrushResource;
65 TQFont m_font;
66};
67
68
69
70
71#endif
The KisResource class provides a representation of Chalk image resources.