• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeutils API Reference
  • KDE Home
  • Contact Us
 

superkaramba

  • sources
  • kde-4.12
  • kdeutils
  • superkaramba
  • src
  • meters
meters/textlabel.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2003 by Hans Karlsson *
3  * karlsson.h@home.se *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  ***************************************************************************/
10 #ifndef TEXTLABEL_H
11 #define TEXTLABEL_H
12 
13 #include "textfield.h"
14 #include "meter.h"
15 
16 class QPainter;
17 class Karamba;
18 
19 class TextLabel : public Meter
20 {
21  Q_OBJECT
22 public:
23  enum ScrollType { ScrollNone, ScrollNormal,
24  ScrollBackAndForth, ScrollOnePass };
25 
26  TextLabel(Karamba *k, int x, int y, int w, int h);
27  TextLabel(Karamba *k);
28  ~TextLabel();
29 
30  void setTextProps(TextField*);
31  void setValue(const QString& text);
32  void setValue(int);
33  //virtual QString getStringValue() const { return value.join( QLatin1String( "\n" )); };
34  QString getStringValue() const
35  {
36  return value.join( QLatin1String( "\n" ));
37  }
38  void setFontSize(int);
39  void setBGColor(QColor clr);
40  void setFont(const QString&);
41  void setAlignment(const QString&);
42  void setFixedPitch(bool);
43  void setShadow(int);
44 
45  void paint(QPainter *p, const QStyleOptionGraphicsItem *option,
46  QWidget *widget);
47 
48  virtual void show();
49  virtual void hide();
50  int getFontSize() const;
51  QColor getBGColor() const;
52  QString getFont() const;
53  QString getAlignment() const;
54  bool getFixedPitch() const;
55  int getShadow() const;
56  void setScroll(ScrollType type, QPoint speed, int gap, int pause);
57  void setScroll(const QString &type, const QPoint &speed, int gap, int pause);
58 
59  void attachClickArea(const QString &leftMouseButton, const QString &middleMouseButton,
60  const QString &rightMouseButton);
61 
62  bool mouseEvent(QEvent *e);
63 
64  QRectF boundingRect() const;
65 
66  void allowClick(bool enable);
67  bool clickable();
68 
69  int getTextWidth() const;
70  void setSize(int x, int y, int width, int height);
71 
72  int getX() const;
73  int getY() const;
74 
75  int getWidth() const;
76  int getHeight() const;
77 
78 private:
79  int alignment;
80  int clip;
81  QStringList value;
82  QFont font;
83  QColor bgColor;
84  int lineHeight;
85  QSize textSize;
86  int shadow;
87  TextField text;
88  QPoint scrollSpeed;
89  QPoint scrollPos;
90  int scrollGap;
91  int scrollPause;
92  int pauseCounter;
93  ScrollType scrollType;
94  QPoint origPoint;
95  bool m_clickable;
96  bool m_sizeGiven;
97 
98  QString m_leftMouseButtonAction;
99  QString m_middleMouseButtonAction;
100  QString m_rightMouseButtonAction;
101 
102  int drawText(QPainter *p, int x, int y, int width, int height,
103  const QString &text);
104 
105  bool calculateScrollCoords(const QRect &meterRect, QRect &textRect,
106  QPoint &next, int x, int y);
107  void calculateTextSize();
108 };
109 
110 #endif // TEXTLABEL_H
TextLabel::getBGColor
QColor getBGColor() const
Definition: meters/textlabel.cpp:163
TextLabel::~TextLabel
~TextLabel()
Definition: meters/textlabel.cpp:69
TextLabel::setAlignment
void setAlignment(const QString &)
Definition: meters/textlabel.cpp:190
TextLabel::ScrollBackAndForth
Definition: meters/textlabel.h:24
TextLabel
Definition: meters/textlabel.h:19
TextLabel::paint
void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: meters/textlabel.cpp:348
meter.h
QWidget
TextLabel::setScroll
void setScroll(ScrollType type, QPoint speed, int gap, int pause)
Definition: meters/textlabel.cpp:250
TextLabel::setFixedPitch
void setFixedPitch(bool)
Definition: meters/textlabel.cpp:213
TextLabel::ScrollNormal
Definition: meters/textlabel.h:23
TextLabel::setValue
void setValue(const QString &text)
Definition: meters/textlabel.cpp:144
Karamba
Definition: karamba.h:52
TextLabel::show
virtual void show()
Definition: meters/textlabel.cpp:72
TextLabel::setFont
void setFont(const QString &)
Definition: meters/textlabel.cpp:168
TextLabel::setFontSize
void setFontSize(int)
Definition: meters/textlabel.cpp:179
TextLabel::getStringValue
QString getStringValue() const
Definition: meters/textlabel.h:34
TextLabel::ScrollNone
Definition: meters/textlabel.h:23
textfield.h
TextLabel::allowClick
void allowClick(bool enable)
Definition: meters/textlabel.cpp:424
TextLabel::hide
virtual void hide()
Definition: meters/textlabel.cpp:78
TextLabel::TextLabel
TextLabel(Karamba *k, int x, int y, int w, int h)
Definition: meters/textlabel.cpp:22
TextLabel::ScrollOnePass
Definition: meters/textlabel.h:24
TextLabel::getHeight
int getHeight() const
Definition: meters/textlabel.cpp:475
TextLabel::ScrollType
ScrollType
Definition: meters/textlabel.h:23
TextLabel::getX
int getX() const
Definition: meters/textlabel.cpp:456
TextLabel::attachClickArea
void attachClickArea(const QString &leftMouseButton, const QString &middleMouseButton, const QString &rightMouseButton)
Definition: meters/textlabel.cpp:434
TextLabel::setBGColor
void setBGColor(QColor clr)
Definition: meters/textlabel.cpp:158
TextLabel::setSize
void setSize(int x, int y, int width, int height)
Definition: meters/textlabel.cpp:484
TextLabel::mouseEvent
bool mouseEvent(QEvent *e)
Definition: meters/textlabel.cpp:397
TextLabel::getShadow
int getShadow() const
Definition: meters/textlabel.cpp:228
Meter
Definition: meters/meter.h:23
TextLabel::setTextProps
void setTextProps(TextField *)
Definition: meters/textlabel.cpp:84
TextLabel::getAlignment
QString getAlignment() const
Definition: meters/textlabel.cpp:203
TextLabel::getY
int getY() const
Definition: meters/textlabel.cpp:461
TextLabel::clickable
bool clickable()
Definition: meters/textlabel.cpp:429
TextLabel::getWidth
int getWidth() const
Definition: meters/textlabel.cpp:466
TextLabel::getFixedPitch
bool getFixedPitch() const
Definition: meters/textlabel.cpp:218
TextLabel::setShadow
void setShadow(int)
Definition: meters/textlabel.cpp:223
TextLabel::getFontSize
int getFontSize() const
Definition: meters/textlabel.cpp:185
TextField
Ralph M.
Definition: textfield.h:22
TextLabel::boundingRect
QRectF boundingRect() const
Definition: meters/textlabel.cpp:445
TextLabel::getFont
QString getFont() const
Definition: meters/textlabel.cpp:174
TextLabel::getTextWidth
int getTextWidth() const
Definition: meters/textlabel.cpp:450
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:07:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • kremotecontrol
  • ktimer
  • kwallet
  • superkaramba
  • sweeper

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal