/usr/include/Wt/Ext/Calendar is in libwtext-dev 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef EXT_CALENDAR_H_
#define EXT_CALENDAR_H_
#include <Wt/WJavaScript>
#include <Wt/WDate>
#include <Wt/Ext/Component>
namespace Wt {
namespace Ext {
/*! \class Calendar Wt/Ext/Calendar Wt/Ext/Calendar
* \brief A calendar.
*
* The calendar provides navigation by month and year, and indicates the
* current day.
*
* The calendar only allows selection of a single day, and you may
* listen for when the user selects a new date using the selected()
* signal.
*
* The API is a subset of the WCalendar API:
* <ul>
* <li>limited to single selection mode: no
* \link WCalendar::setMultipleSelection(bool) setMultipleSelection(bool)\endlink,
* \link WCalendar::select(const std::set<WDate>&) select(const std::set<WDate>&)\endlink methods;</li>
* <li>no support for programmatory navigation: no
* \link WCalendar::browseToNextMonth() browseToNextMonth() \endlink,
* \link WCalendar::browseTo() browseTo()\endlink, etc... methods
* </li>
* <li>no support for getting information on what is currently displayed: no
* \link WCalendar::currentMonth() currentMonth()\endlink and
* \link WCalendar::currentYear() currentYear()\endlink methods.
* </ul>
*
* Here is a snapshot taken on 01/09/2007 (shown as today), and 12/09/2007
* currently selected.
* \image html ExtCalendar-1.png "Calendar"
*
* \ingroup ext
*/
class WT_EXT_API Calendar : public Component
{
public:
/*! \brief Create a new calendar.
*
* Constructs a new calendar, with optional support for internationalization.
* The calendar shows the current day, and has an empty selection.
*/
Calendar(bool i18n = false, WContainerWidget *parent = 0);
/*! \brief Select a date.
*
* Select one date.
*/
void select(const WDate& date);
/*! \brief Get the current selection.
*
* Returns the set of dates currently selected. This set contains 0
* or 1 dates.
*/
const std::set<WDate>& selection() const { return selection_; }
/*! \brief %Signal emitted when the user changes the selection.
*
* Emitted after the user has changed the current selection, before
* the selected() signal is emitted.
*/
Signal<void>& selectionChanged() { return selectionChanged_; }
/*! \brief %Signal emitted when the user has selected a date.
*
* This signal indicates that the user has selected a new date,
* which is only available when in single selection mode.
*/
Signal<void>& selected() { return selected_; }
protected:
virtual void updateExt();
virtual void createConfig(std::ostream& config);
private:
Signal<void> selectionChanged_, selected_;
bool i18n_;
std::set<WDate> selection_;
virtual std::string createJS(DomElement *inContainer);
JSignal<std::string> extDateSelected_;
void onSelect(std::string date);
};
}
}
#endif // EXT_CALENDAR_H_
|