• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kalarm/lib

TimePeriod Class Reference

#include <timeperiod.h>

Inheritance diagram for TimePeriod:

Inheritance graph
[legend]

List of all members.


Detailed Description

Time period entry widget.

The TimePeriod class provides a widget for entering a time period as a number of weeks, days, hours and minutes, or minutes.

It displays a combo box to select the time units (weeks, days, hours and minutes, or minutes) alongside a spin box to enter the number of units. The type of spin box displayed alters according to the units selection: day, week and minute values are entered in a normal spin box, while hours and minutes are entered in a time spin box (with two pairs of spin buttons, one for hours and one for minutes).

The widget may be set as read-only. This has the same effect as disabling it, except that its appearance is unchanged.

Author:
David Jarvie <djarvie@kde.org>

Definition at line 51 of file timeperiod.h.


Public Types

enum  Units { Minutes, HoursMinutes, Days, Weeks }

Signals

void valueChanged (const KCal::Duration &period)

Public Member Functions

bool isReadOnly () const
KCal::Duration period () const
void setDateOnly (bool dateOnly)
void setFocusOnCount ()
void setMaximum (int hourmin, int days)
void setPeriod (const KCal::Duration &period, bool dateOnly, Units defaultUnits)
virtual void setReadOnly (bool readOnly)
void setSelectOnStep (bool select)
void setWhatsThises (const QString &units, const QString &dayWeek, const QString &hourMin=QString())
 TimePeriod (bool allowMinute, QWidget *parent)

Member Enumeration Documentation

enum TimePeriod::Units

Units for the time period.

  • Minutes - the time period is entered as a number of minutes.
  • HoursMinutes - the time period is entered as an hours/minutes value.
  • Days - the time period is entered as a number of days.
  • Weeks - the time period is entered as a number of weeks.
Enumerator:
Minutes 
HoursMinutes 
Days 
Weeks 

Definition at line 61 of file timeperiod.h.


Constructor & Destructor Documentation

TimePeriod::TimePeriod ( bool  allowMinute,
QWidget *  parent 
)

Constructor.

Parameters:
allowMinute Set false to prevent hours/minutes or minutes from being allowed as units; only days and weeks can ever be used, regardless of other method calls. Set true to allow minutes, hours/minutes, days or weeks as units.
parent The parent object of this widget.

Definition at line 49 of file timeperiod.cpp.


Member Function Documentation

bool TimePeriod::isReadOnly (  )  const [inline]

Returns true if the widget is read only.

Definition at line 72 of file timeperiod.h.

Duration TimePeriod::period (  )  const

Gets the entered time period.

Definition at line 148 of file timeperiod.cpp.

void TimePeriod::setDateOnly ( bool  dateOnly  )  [inline]

Enables or disables minutes and hours/minutes units in the combo box.

To disable minutes and hours/minutes, set dateOnly true; to enable minutes and hours/minutes, set dateOnly false. But note that minutes and hours/minutes cannot be enabled if it was disallowed in the constructor.

Definition at line 91 of file timeperiod.h.

void TimePeriod::setFocusOnCount (  ) 

Sets the input focus to the count field.

Definition at line 118 of file timeperiod.cpp.

void TimePeriod::setMaximum ( int  hourmin,
int  days 
)

Sets the maximum values for the minutes and hours/minutes, and days/weeks spin boxes.

Set hourmin = 0 to leave the minutes and hours/minutes maximum unchanged.

Definition at line 127 of file timeperiod.cpp.

void TimePeriod::setPeriod ( const KCal::Duration &  period,
bool  dateOnly,
Units  defaultUnits 
)

Initialises the time period value.

Parameters:
period The value of the time period to set.
dateOnly True to restrict the units available in the combo box to days or weeks.
defaultUnits The units to display initially in the combo box.

void TimePeriod::setReadOnly ( bool  readOnly  )  [virtual]

Sets whether the widget is read-only for the user.

If read-only, the time period cannot be edited and the units combo box is inactive.

Parameters:
readOnly True to set the widget read-only, false to set it read-write.

Definition at line 94 of file timeperiod.cpp.

void TimePeriod::setSelectOnStep ( bool  select  ) 

Sets whether the editor text is to be selected whenever spin buttons are clicked.

The default is to select it.

Definition at line 109 of file timeperiod.cpp.

void TimePeriod::setWhatsThises ( const QString &  units,
const QString &  dayWeek,
const QString &  hourMin = QString() 
)

Sets separate WhatsThis texts for the count spin boxes and the units combo box.

If hourMin is omitted, both spin boxes are set to the same WhatsThis text.

Definition at line 383 of file timeperiod.cpp.

void TimePeriod::valueChanged ( const KCal::Duration &  period  )  [signal]

This signal is emitted whenever the value held in the widget changes.

Parameters:
period The current value of the time period.


The documentation for this class was generated from the following files:
  • timeperiod.h
  • timeperiod.cpp

kalarm/lib

Skip menu "kalarm/lib"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim 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