kexi

kexidisplayutils.h
1/* This file is part of the KDE project
2 Copyright (C) 2005-2006 Jaroslaw Staniek <js@iidea.pl>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (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 GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KEXIDISPUTILS_H
21#define KEXIDISPUTILS_H
22
23#include <tqfont.h>
24#include <tqcolor.h>
25class TQWidget;
26
28class KEXIGUIUTILS_EXPORT KexiDisplayUtils
29{
30 public:
32 class KEXIGUIUTILS_EXPORT DisplayParameters
33 {
34 public:
37
39 DisplayParameters(TQWidget *w);
40
41 TQColor textColor, selectedTextColor;
42 TQFont font;
43 int textWidth, textHeight;
44 };
45
47 static void initDisplayForAutonumberSign(DisplayParameters& par, TQWidget *widget);
48
50 static void paintAutonumberSign(const DisplayParameters& par, TQPainter* painter,
51 int x, int y, int width, int height, int align, bool overrideColor = false);
52
54 static void initDisplayForDefaultValue(DisplayParameters& par, TQWidget *widget);
55};
56
57#endif
Stores set of display parameters used in utility functions.
int textHeight
used for "(autonumber)" text only
DisplayParameters()
Creates uninitialized parameters.
A set of utilities related to displaying common elements in Kexi, like e.g. (autonumber) sign.
static void initDisplayForDefaultValue(DisplayParameters &par, TQWidget *widget)
Initializes display parameters for default value.
static void paintAutonumberSign(const DisplayParameters &par, TQPainter *painter, int x, int y, int width, int height, int align, bool overrideColor=false)
Paints autonumber sign using par parameters.
static void initDisplayForAutonumberSign(DisplayParameters &par, TQWidget *widget)
Initializes display parameters for autonumber sign.