home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ktimewidget.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.1 KB  |  87 lines

  1. /* This file is part of the KDE libraries
  2.    Copyright (C) 2002 Hans Petter bieker <bieker@kde.org>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License version 2 as published by the Free Software Foundation.
  7.  
  8.    This library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.    Library General Public License for more details.
  12.  
  13.    You should have received a copy of the GNU Library General Public License
  14.    along with this library; see the file COPYING.LIB.  If not, write to
  15.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16.    Boston, MA 02110-1301, USA.
  17. */
  18.  
  19. #ifndef __KTIMEWIDGET__
  20. #define __KTIMEWIDGET__
  21.  
  22. #include <qwidget.h>
  23. #include <qdatetime.h>
  24.  
  25. #include <kdelibs_export.h>
  26.  
  27. /**
  28.  * @short A time selection widget.
  29.  *
  30.  * This widget can be used to display or allow user selection of time.
  31.  *
  32.  * \image html ktimewidget.png "KDE Time Widget"
  33.  *
  34.  * @author Hans Petter Bieker <bieker@kde.org>
  35.  * @since 3.2
  36.  */
  37. class KDEUI_EXPORT KTimeWidget : public QWidget
  38. {
  39.   Q_OBJECT
  40.   Q_PROPERTY( QTime time READ time WRITE setTime )
  41.  
  42. public:
  43.   /**
  44.    * Constructs a time selection widget.
  45.    */
  46.   KTimeWidget(QWidget * parent = 0, const char * name = 0);
  47.  
  48.   /**
  49.    * Constructs a time selection widget with the initial time set to
  50.    * @p time.
  51.    */
  52.   KTimeWidget(const QTime & time,
  53.               QWidget * parent = 0, const char * name = 0 );
  54.  
  55.   /**
  56.    * Destructs the time selection widget.
  57.    */
  58.   virtual ~KTimeWidget();
  59.  
  60.   /**
  61.    * Returns the currently selected time.
  62.    */
  63.   QTime time() const;
  64.  
  65. public slots:
  66.   /**
  67.    * Changes the selected time to @p time.
  68.    */
  69.   void setTime(const QTime & time);
  70.  
  71. signals:
  72.   /**
  73.    * Emitted whenever the time of the widget
  74.    * is changed, either with setTime() or via user selection.
  75.    */
  76.   void valueChanged(const QTime & time);
  77.  
  78. private:
  79.   void init();
  80.  
  81. private:
  82.   class KTimeWidgetPrivate;
  83.   KTimeWidgetPrivate *d;
  84. };
  85.  
  86. #endif
  87.