• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KCal Library

  • KCal
  • Period
Public Types | Public Member Functions | List of all members
KCal::Period Class Reference

#include <period.h>

Inheritance diagram for KCal::Period:
Inheritance graph
[legend]

Public Types

typedef QList< Period > List
 

Public Member Functions

 Period ()
 
 Period (const KDateTime &start, const KDateTime &end)
 
 Period (const KDateTime &start, const Duration &duration)
 
 Period (const Period &period)
 
 ~Period ()
 
Duration duration () const
 
Duration duration (Duration::Type type) const
 
KDateTime end () const
 
bool hasDuration () const
 
bool operator!= (const Period &other) const
 
bool operator< (const Period &other) const
 
Period & operator= (const Period &other)
 
bool operator== (const Period &other) const
 
bool operator> (const Period &other) const
 
void shiftTimes (const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
 
KDateTime start () const
 

Detailed Description

The period can be defined by either a start time and an end time or by a start time and a duration.

Definition at line 47 of file period.h.

Member Typedef Documentation

typedef QList<Period> KCal::Period::List

List of periods.

Definition at line 53 of file period.h.

Constructor & Destructor Documentation

Period::Period ( )

Constructs a period without a duration.

Definition at line 57 of file period.cpp.

Period::Period ( const KDateTime &  start,
const KDateTime &  end 
)

Constructs a period from start to end.

Parameters
startthe time the period begins.
endthe time the period ends.

Definition at line 61 of file period.cpp.

Period::Period ( const KDateTime &  start,
const Duration &  duration 
)

Constructs a period from start and lasting duration.

Parameters
startthe time when the period starts.
durationhow long the period lasts.

Definition at line 66 of file period.cpp.

Period::Period ( const Period &  period)

Constructs a period by copying another period object.

Parameters
periodthe period to copy

Definition at line 72 of file period.cpp.

Period::~Period ( )

Destroys a period.

Definition at line 77 of file period.cpp.

Member Function Documentation

Duration Period::duration ( ) const

Returns the duration of the period.

If the period is defined in terms of a start and end time, the duration is computed from these. In this case, if the time of day in start and end is equal, and their time specifications (i.e. time zone etc.) are the same, the duration will be set in terms of days. Otherwise, the duration will be set in terms of seconds.

If the period is defined in terms of a duration, that duration is returned unchanged.

Definition at line 116 of file period.cpp.

Duration Period::duration ( Duration::Type  type) const

Returns the duration of the period.

If the period is defined in terms of a start and end time, the duration is first computed from these.

If type is Days, and the duration is not an exact number of days, the duration will be rounded down to the nearest whole number of days.

Parameters
typethe unit of time to use (seconds or days)

Definition at line 126 of file period.cpp.

KDateTime Period::end ( ) const

Returns when this period ends.

Definition at line 111 of file period.cpp.

bool Period::hasDuration ( ) const

Returns true if this period has a set duration, false if it just has a start and an end.

Definition at line 131 of file period.cpp.

bool KCal::Period::operator!= ( const Period &  other) const
inline

Returns true if this period is not equal to the other one.

Parameters
otherthe other period to compare
See also
operator==()

Definition at line 121 of file period.h.

bool Period::operator< ( const Period &  other) const

Returns true if the start of this period is earlier than the start of the other one.

Parameters
otheris the other period to compare.

Definition at line 82 of file period.cpp.

Period & Period::operator= ( const Period &  other)

Sets this period equal to the other one.

Parameters
otheris the other period to compare.

Definition at line 95 of file period.cpp.

bool Period::operator== ( const Period &  other) const

Returns true if this period is equal to the other one.

Even if their start and end times are the same, two periods are considered not equal if one is defined in terms of a duration and the other in terms of a start and end time.

Parameters
otherthe other period to compare

Definition at line 87 of file period.cpp.

bool KCal::Period::operator> ( const Period &  other) const
inline

Returns true if the start of this period is later than the start of the other one.

Parameters
otherthe other period to compare

Definition at line 103 of file period.h.

void Period::shiftTimes ( const KDateTime::Spec &  oldSpec,
const KDateTime::Spec &  newSpec 
)

Shift the times of the period so that they appear at the same clock time as before but in a new time zone.

The shift is done from a viewing time zone rather than from the actual period time zone.

For example, shifting a period whose start time is 09:00 America/New York, using an old viewing time zone (oldSpec) of Europe/London, to a new time zone (newSpec) of Europe/Paris, will result in the time being shifted from 14:00 (which is the London time of the period start) to 14:00 Paris time.

Parameters
oldSpecthe time specification which provides the clock times
newSpecthe new time specification

Definition at line 136 of file period.cpp.

KDateTime Period::start ( ) const

Returns when this period starts.

Definition at line 106 of file period.cpp.


The documentation for this class was generated from the following files:
  • period.h
  • period.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal