[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
klfdisplaylabel.h
Go to the documentation of this file.
1 /***************************************************************************
2  * file klfdisplaylabel.h
3  * This file is part of the KLatexFormula Project.
4  * Copyright (C) 2011 by Philippe Faist
5  * philippe.faist at bluewin.ch
6  * *
7  * This program is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program; if not, write to the *
19  * Free Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  ***************************************************************************/
22 /* $Id: klfdisplaylabel.h 603 2011-02-26 23:14:55Z phfaist $ */
23 
24 #ifndef KLFDISPLAYLABEL_H
25 #define KLFDISPLAYLABEL_H
26 
27 #include <QLabel>
28 #include <QTemporaryFile>
29 
30 #include <klfdefs.h>
31 
34 class KLF_EXPORT KLFDisplayLabel : public QLabel
35 {
36  Q_OBJECT
37 
38  Q_PROPERTY(QSize labelFixedSize READ labelFixedSize WRITE setLabelFixedSize) ;
39  Q_PROPERTY(bool enableToolTipPreview READ enableToolTipPreview WRITE setEnableToolTipPreview) ;
40 
41  Q_PROPERTY(QString bigPreviewText READ bigPreviewText) ;
42  Q_PROPERTY(bool glowEffect READ glowEffect WRITE setGlowEffect) ;
43  Q_PROPERTY(QColor glowEffectColor READ glowEffectColor WRITE setGlowEffectColor) ;
44  Q_PROPERTY(int glowEffectRadius READ glowEffectRadius WRITE setGlowEffectRadius) ;
45 public:
46  KLFDisplayLabel(QWidget *parent);
47  virtual ~KLFDisplayLabel();
48 
49  virtual QSize labelFixedSize() const { return pLabelFixedSize; }
50  virtual bool enableToolTipPreview() const { return pEnableToolTipPreview; }
51 
52  virtual QString bigPreviewText() const { return _bigPreviewText; }
53 
54  inline bool glowEffect() const { return pGE; }
55  inline QColor glowEffectColor() const { return pGEcolor; }
56  inline int glowEffectRadius() const { return pGEradius; }
57 
58 signals:
59  void labelDrag();
60 
61 public slots:
62  virtual void setLabelFixedSize(const QSize& size);
63  virtual void setEnableToolTipPreview(bool enable) { pEnableToolTipPreview = enable; }
64 
65  virtual void displayClear();
66  virtual void display(QImage displayimg, QImage tooltipimage, bool labelenabled = true);
67  virtual void displayError(bool labelenabled = false);
68 
70  void setGlowEffect(bool on) { pGE = on; }
72  void setGlowEffectColor(const QColor& color) { pGEcolor = color; }
74  void setGlowEffectRadius(int r) { pGEradius = r; }
75 
76 protected:
77  virtual void mouseMoveEvent(QMouseEvent *e);
78 
79 private:
80 
81  QSize pLabelFixedSize;
82  bool pEnableToolTipPreview;
83  QTemporaryFile *mToolTipFile;
84 
85  QPalette pDefaultPalette;
86  QPalette pErrorPalette;
87 
88  QString _bigPreviewText;
89 
90  bool pGE;
91  QColor pGEcolor;
92  int pGEradius;
93 
94  void set_error(bool error_on);
95 };
96 
97 
98 
99 
100 
101 
102 
103 #endif
bool glowEffect() const
A label to display a LaTeX-formula-output-like image.
int glowEffectRadius() const
virtual void setEnableToolTipPreview(bool enable)
virtual bool enableToolTipPreview() const
QColor glowEffectColor() const
void setGlowEffectColor(const QColor &color)
void setGlowEffectRadius(int r)
virtual QSize labelFixedSize() const
virtual QString bigPreviewText() const
void setGlowEffect(bool on)

Generated by doxygen 1.8.8