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 / kdatewidget.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.1 KB  |  91 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 2001 Waldo Bastian (bastian@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 __KDATECTL_H__
  20. #define __KDATECTL_H__
  21.  
  22. #include <qwidget.h>
  23. #include <qdatetime.h>
  24.  
  25. #include <kdelibs_export.h>
  26.  
  27. /**
  28. * @short A pushbutton to display or allow user selection of a date.
  29. *
  30. * This widget can be used to display or allow user selection of a date.
  31. *
  32. * @see KDatePicker
  33. *
  34. * @version $Id: kdatewidget.h 465272 2005-09-29 09:47:40Z mueller $
  35. */
  36. class KDEUI_EXPORT KDateWidget : public QWidget
  37. {
  38.   Q_OBJECT
  39.   Q_PROPERTY( QDate date READ date WRITE setDate )
  40.  
  41. public:
  42.   /**
  43.    * Constructs a date selection widget.
  44.    */
  45.   KDateWidget( QWidget *parent=0, const char *name=0 );
  46.  
  47.   /**
  48.    * Constructs a date selection widget with the initial date set to @p date.
  49.    */
  50.   KDateWidget( QDate date, QWidget *parent=0, const char *name=0 );
  51.  
  52.   /**
  53.    * Destructs the date selection widget.
  54.    */
  55.   virtual ~KDateWidget();
  56.  
  57.   /**
  58.    * Returns the currently selected date.
  59.    */
  60.   QDate date() const;
  61.  
  62.   /**
  63.    * Changes the selected date to @p date.
  64.    */
  65.   void setDate(QDate date);
  66.  
  67.  
  68. signals:
  69.   /**
  70.    * Emitted whenever the date of the widget
  71.    * is changed, either with setDate() or via user selection.
  72.    */
  73.    void changed(QDate);
  74.  
  75. protected:
  76.    void init();
  77.    void init(const QDate&);
  78.  
  79. protected slots:
  80.   void slotDateChanged();
  81.  
  82. protected:
  83.   virtual void virtual_hook( int id, void* data );
  84. private:
  85.    class KDateWidgetPrivate;
  86.    KDateWidgetPrivate *d;
  87. };
  88.  
  89. #endif
  90.  
  91.