• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kruler.h

Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /* This file is part of the KDE libraries
00003     Copyright (C) 1998 Jörg Habenicht (j.habenicht@europemail.com)
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KRULER_H
00022 #define KRULER_H
00023 
00024 #include <kdeui_export.h>
00025 
00026 #include <QtGui/QAbstractSlider>
00027 
00071 class KDEUI_EXPORT KRuler : public QAbstractSlider
00072 {
00073   Q_OBJECT
00074   Q_PROPERTY( bool showTinyMarks READ showTinyMarks WRITE setShowTinyMarks )
00075   Q_PROPERTY( bool showLittleMarks READ showLittleMarks WRITE setShowLittleMarks )
00076   Q_PROPERTY( bool showMediumMarks READ showMediumMarks WRITE setShowMediumMarks )
00077   Q_PROPERTY( bool showBigMarks READ showBigMarks WRITE setShowBigMarks )
00078   Q_PROPERTY( bool showPointer READ showPointer WRITE setShowPointer )
00079   Q_PROPERTY( bool showEndLabel READ showEndLabel WRITE setShowEndLabel )
00080   Q_PROPERTY( int tinyMarkDistance READ tinyMarkDistance WRITE setTinyMarkDistance )
00081   Q_PROPERTY( int littleMarkDistance READ littleMarkDistance WRITE setLittleMarkDistance )
00082   Q_PROPERTY( int mediumMarkDistance READ mediumMarkDistance WRITE setBigMarkDistance )
00083   Q_PROPERTY( int bigMarkDistance READ bigMarkDistance WRITE setBigMarkDistance )
00084   Q_PROPERTY( double pixelPerMark READ pixelPerMark WRITE setPixelPerMark )
00085   Q_PROPERTY( bool lengthFixed READ lengthFixed WRITE setLengthFixed )
00086   Q_PROPERTY( QString endLabel READ endLabel WRITE setEndLabel )
00087   Q_ENUMS( MetricStyle )
00088   Q_PROPERTY( int length READ length WRITE setLength )
00089   Q_PROPERTY( int offset READ offset )
00090   Q_PROPERTY( int endOffset READ endOffset )
00091 
00092 public:
00093 
00094 /*
00095 #define KRULER_ROTATE_TEST KRULER_ROTATE_TEST
00096 #undef KRULER_ROTATE_TEST
00097 #ifdef KRULER_ROTATE_TEST
00098   double xtrans, ytrans, rotate;
00099 # warning tmporaer variablen eingeschaltet
00100 #endif
00101 */
00102 
00106   enum MetricStyle { Custom=0, Pixel, Inch, Millimetres, Centimetres, Metres };
00107 
00111     //  enum PaintStyle { Flat, Raised, Sunken };
00112 
00116   explicit KRuler(QWidget *parent=0);
00129   explicit KRuler(Qt::Orientation orient, QWidget *parent=0, Qt::WFlags f=0);
00130 
00145   KRuler(Qt::Orientation orient, int widgetWidth, QWidget *parent=0,
00146      Qt::WFlags f=0);
00147 
00151   ~KRuler();
00152 
00160   KDE_DEPRECATED void setMinValue(int);
00161 
00165   KDE_DEPRECATED int minValue() const;
00166 
00173   KDE_DEPRECATED void setMaxValue(int);
00174 
00178   KDE_DEPRECATED int maxValue() const;
00179 
00180 
00186   void setTinyMarkDistance(int);
00190   int tinyMarkDistance() const;
00191 
00197   void setLittleMarkDistance(int);
00198 
00202   int littleMarkDistance() const;
00203 
00210   void setMediumMarkDistance(int);
00211   int mediumMarkDistance() const;
00212 
00218   void setBigMarkDistance(int);
00222   int bigMarkDistance() const;
00223 
00227   void setShowTinyMarks(bool);
00228   bool showTinyMarks() const;
00232   void setShowLittleMarks(bool);
00233   bool showLittleMarks() const;
00237   void setShowMediumMarks(bool);
00238   bool showMediumMarks() const;
00242   void setShowBigMarks(bool);
00243   bool showBigMarks() const;
00247   void setShowEndMarks(bool);
00248   bool showEndMarks() const;
00252   void setShowPointer(bool);
00253   bool showPointer() const;
00254 
00255 
00256   void setFrameStyle(int);
00257 
00263     //  void setShowLittleMarkLabel(bool);
00264 
00270     //  void setShowMediumMarkLabel(bool);
00271 
00277     //  void showBigMarkLabel(bool);
00278 
00284    void setShowEndLabel(bool);
00285    bool showEndLabel() const;
00286 
00291   void setEndLabel(const QString&);
00292   QString endLabel() const;
00293 
00299   void setRulerMetricStyle(KRuler::MetricStyle);
00300 
00319   void setPixelPerMark(double rate);
00320 
00324   double pixelPerMark() const;
00325 
00335   void setLength(int);
00336   int length() const;
00337 
00344   void setLengthFixed(bool fix);
00345   bool lengthFixed() const;
00346 
00358   void slideUp(int count = 1);
00359 
00371   void slideDown(int count = 1);
00372 
00381   void setOffset(int offset);
00382 
00386   int offset() const;
00387 
00388   int endOffset() const;
00389 
00390 public Q_SLOTS:
00391 
00398   void slotNewValue(int);
00399 
00406   void slotNewOffset(int);
00407 
00408   void slotEndOffset(int);
00409 
00410 protected:
00411   virtual void paintEvent(QPaintEvent *);
00412 
00413 private:
00414   void init(Qt::Orientation orientation);
00415 
00416 private:
00417   class KRulerPrivate;
00418   KRulerPrivate * const d;
00419 };
00420 
00421 #endif

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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