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

superkaramba

input.h

Go to the documentation of this file.
00001 /****************************************************************************
00002  * Copyright (c) 2005 Alexander Wiedenbruch <mail@wiedenbruch.de>
00003  * Copyright (c) 2007 Matt Broadstone <mbroadst@gmail.com>
00004  *
00005  * This file is part of SuperKaramba.
00006  *
00007  *  SuperKaramba is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  SuperKaramba is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with SuperKaramba; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020  ****************************************************************************/
00021 
00022 #ifndef INPUT_H
00023 #define INPUT_H
00024 
00025 #include <QTextLayout>
00026 #include <QTimer>
00027 
00028 #include "meter.h"
00029 
00030 class TextField;
00031 class Karamba;
00032 class Input : public Meter
00033 {
00034     Q_OBJECT
00035 public:
00036     Input(Karamba* k, int ix, int iy, int iw, int ih);
00037     Input();
00038     ~Input();
00039 
00040     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
00041                QWidget *widget);
00042 
00043     void setValue(const QString &text);
00044     QString getStringValue() const;
00045 
00046     void setBGColor(QColor c);
00047     QColor getBGColor() const;
00048     void setColor(QColor c);
00049     QColor getColor() const;
00050     void setFontColor(QColor fontColor);
00051     QColor getFontColor() const;
00052     void setSelectionColor(QColor selectionColor);
00053     QColor getSelectionColor() const;
00054     void setSelectedTextColor(QColor selectedTextColor);
00055     QColor getSelectedTextColor() const;
00056     void setTextProps(TextField*);
00057 
00058     void hide();
00059     void show();
00060 
00061     void setSize(int ix, int iy, int iw, int ih);
00062     void setX(int ix);
00063     void setY(int iy);
00064     void setWidth(int iw);
00065     void setHeight(int ih);
00066 
00067     void setFont(const QString &f);
00068     QString getFont() const;
00069     void setFontSize(int size);
00070     int getFontSize() const;
00071 
00072     void setInputFocus();
00073     void clearInputFocus();
00074     void keyPress(QKeyEvent *event);
00075     void mouseEvent(QEvent *e);
00076     void mouseEventRelease(QGraphicsSceneMouseEvent *e);
00077     void mouseEventMove(QGraphicsSceneHoverEvent *e);
00078 
00079     int getTextWidth() const;
00080 
00081     void setSelection(int start, int length);
00082     void clearSelection();
00083     QTextLayout::FormatRange getSelection() const;
00084 
00085 protected:
00086     void focusOutEvent(QFocusEvent *event);
00087 
00088 private Q_SLOTS:
00089     void blinkCursor();
00090 
00091 private:
00092     QFont m_font;
00093 
00094     QColor m_bgColor;
00095     QColor m_fgColor;
00096     QColor m_fontColor;
00097     QColor m_selectedTextColor;
00098     QColor m_selectionColor;
00099 
00100     QString m_text;
00101 
00102     QTextLayout m_textLayout;
00103 
00104     double m_hscroll;
00105     int m_cursorPos;
00106     bool m_cursorVisible;
00107 
00108     QTimer m_cursorTimer;
00109 
00110     bool m_mouseMoved;
00111     int m_selStart;
00112     int m_selLength;
00113 
00114     QVector<QTextLayout::FormatRange> m_selection;
00115 
00116     void layoutText();
00117 };
00118 
00119 #endif

superkaramba

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

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal