• Skip to content
  • Skip to link menu
KDE 4.1 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( MetricStyle rulerMetricStyle WRITE setRulerMetricStyle )
00089   Q_PROPERTY( int length READ length WRITE setLength )
00090   Q_PROPERTY( int offset READ offset )
00091   Q_PROPERTY( int endOffset READ endOffset )
00092 
00093 public:
00094 
00095 /*
00096 #define KRULER_ROTATE_TEST KRULER_ROTATE_TEST
00097 #undef KRULER_ROTATE_TEST
00098 #ifdef KRULER_ROTATE_TEST
00099   double xtrans, ytrans, rotate;
00100 # warning tmporaer variablen eingeschaltet
00101 #endif
00102 */
00103 
00107   enum MetricStyle { Custom=0, Pixel, Inch, Millimetres, Centimetres, Metres };
00108 
00112     //  enum PaintStyle { Flat, Raised, Sunken };
00113 
00117   explicit KRuler(QWidget *parent=0);
00130   explicit KRuler(Qt::Orientation orient, QWidget *parent=0, Qt::WFlags f=0);
00131 
00146   KRuler(Qt::Orientation orient, int widgetWidth, QWidget *parent=0,
00147      Qt::WFlags f=0);
00148 
00152   ~KRuler();
00153 
00161   KDE_DEPRECATED void setMinValue(int);
00162 
00166   KDE_DEPRECATED int minValue() const;
00167 
00174   KDE_DEPRECATED void setMaxValue(int);
00175 
00179   KDE_DEPRECATED int maxValue() const;
00180 
00181 
00187   void setTinyMarkDistance(int);
00191   int tinyMarkDistance() const;
00192 
00198   void setLittleMarkDistance(int);
00199 
00203   int littleMarkDistance() const;
00204 
00211   void setMediumMarkDistance(int);
00212   int mediumMarkDistance() const;
00213 
00219   void setBigMarkDistance(int);
00223   int bigMarkDistance() const;
00224 
00228   void setShowTinyMarks(bool);
00229   bool showTinyMarks() const;
00233   void setShowLittleMarks(bool);
00234   bool showLittleMarks() const;
00238   void setShowMediumMarks(bool);
00239   bool showMediumMarks() const;
00243   void setShowBigMarks(bool);
00244   bool showBigMarks() const;
00248   void setShowEndMarks(bool);
00249   bool showEndMarks() const;
00253   void setShowPointer(bool);
00254   bool showPointer() const;
00255 
00256 
00257   void setFrameStyle(int);
00258 
00264     //  void setShowLittleMarkLabel(bool);
00265 
00271     //  void setShowMediumMarkLabel(bool);
00272 
00278     //  void showBigMarkLabel(bool);
00279 
00285    void setShowEndLabel(bool);
00286    bool showEndLabel() const;
00287 
00292   void setEndLabel(const QString&);
00293   QString endLabel() const;
00294 
00300   void setRulerMetricStyle(KRuler::MetricStyle);
00301 
00320   void setPixelPerMark(double rate);
00321 
00325   double pixelPerMark() const;
00326 
00336   void setLength(int);
00337   int length() const;
00338 
00345   void setLengthFixed(bool fix);
00346   bool lengthFixed() const;
00347 
00359   void slideUp(int count = 1);
00360 
00372   void slideDown(int count = 1);
00373 
00382   void setOffset(int offset);
00383 
00387   int offset() const;
00388 
00389   int endOffset() const;
00390 
00391 public Q_SLOTS:
00392 
00399   void slotNewValue(int);
00400 
00407   void slotNewOffset(int);
00408 
00409   void slotEndOffset(int);
00410 
00411 protected:
00412   virtual void paintEvent(QPaintEvent *);
00413 
00414 private:
00415   void init(Qt::Orientation orientation);
00416 
00417 private:
00418   class KRulerPrivate;
00419   KRulerPrivate * const d;
00420 };
00421 
00422 #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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs 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