krita

kis_text_brush.h

00001 /*
00002  *  Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef _KIS_TEXT_BRUSH_H_ 
00020 #define _KIS_TEXT_BRUSH_H_
00021 
00022 #include "wdgtextbrush.h"
00023 #include "kis_brush.h"
00024 
00025 class KisTextBrushResource : public KisBrush
00026 {
00027     public:
00028         KisTextBrushResource() : KisBrush("")
00029         {
00030             setBrushType(MASK);
00031         }
00032         KisTextBrushResource(const QString& txt, const QFont& font) : KisBrush("")
00033         {
00034             setFont(font);
00035             setText(txt);
00036             updateBrush();
00037             setBrushType(MASK);
00038         };
00039     public:
00040         virtual bool load() { return false; };
00041         void setText(const QString& txt) { m_txt = txt; };
00042         void setFont(const QFont& font) { m_font = font; };
00043         void updateBrush();
00044     private:
00045         QFont m_font;
00046         QString m_txt;
00047 };
00048 
00049 class KisTextBrush : public KisWdgTextBrush
00050 {
00051     Q_OBJECT
00052 public:
00053     KisTextBrush(QWidget *parent, const char* name, const QString& caption);
00054 
00055 signals:
00056     void activatedResource(KisResource *r);
00057 
00058 private slots:
00059     void rebuildTextBrush();
00060     void getFont();
00061 
00062 private:
00063     KisTextBrushResource* m_textBrushResource;
00064     QFont m_font;
00065 };
00066 
00067 
00068 
00069 
00070 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys