2
This file is part of libkdepim.
4
Copyright (c) 2004 Bram Schoenmakers <bramschoenmakers@kde.nl>
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public
8
License as published by the Free Software Foundation; either
9
version 2 of the License, or (at your option) any later version.
11
This library is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
Library General Public License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with this library; see the file COPYING.LIB. If not, write to
18
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
Boston, MA 02110-1301, USA.
21
#ifndef KDATEPICKERPOPUP_H
22
#define KDATEPICKERPOPUP_H
30
@short This menu helps the user to select a date quickly.
32
This menu helps the user to select a date quicly. It offers various
33
ways of selecting, e.g. with a KDatePicker or with words like "Tomorrow".
35
The available items are:
37
@li NoDate: A menu-item with "No Date". If chosen, the datepicker will emit
39
@li DatePicker: Show a KDatePicker-widget.
40
@li Words: Show items like "Today", "Tomorrow" or "Next Week".
42
When supplying multiple items, separate each item with a bitwise OR.
44
@author Bram Schoenmakers <bram_s@softhome.net>
46
class KDatePickerPopup: public QMenu
57
Q_DECLARE_FLAGS( Items, ItemFlag )
60
A constructor for the KDatePickerPopup.
62
@param items List of all desirable items, separated with a bitwise OR.
63
@param date Initial date of datepicker-widget.
64
@param parent The object's parent.
65
@param name The object's name.
67
explicit KDatePickerPopup( Items items = DatePicker,
68
const QDate &date = QDate::currentDate(),
69
QWidget *parent = 0 );
72
@return A pointer to the private variable mDatePicker, an instance of
75
KDatePicker *datePicker() const;
77
void setDate( const QDate &date );
80
/** Set items which should be shown and rebuilds the menu afterwards.
81
Only if the menu is not visible.
82
@param items List of all desirable items, separated with a bitwise OR.
84
void setItems( int items = 1 );
86
/** @return Returns the bitwise result of the active items in the popup. */
87
int items() const { return mItems; }
92
This signal emits the new date (selected with datepicker or other
95
void dateChanged ( const QDate &date );
98
void slotDateChanged ( const QDate &date );
103
void slotNextMonth();
109
KDatePicker *mDatePicker;
113
Q_DECLARE_OPERATORS_FOR_FLAGS( KDatePickerPopup::Items )