• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

KCal Library

alarm.h

Go to the documentation of this file.
00001 /*
00002   This file is part of the kcal library.
00003 
00004   Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
00005   Copyright (c) 2003 David Jarvie <software@astrojar.org.uk>
00006 
00007   This library is free software; you can redistribute it and/or
00008   modify it under the terms of the GNU Library General Public
00009   License as published by the Free Software Foundation; either
00010   version 2 of the License, or (at your option) any later version.
00011 
00012   This library is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015   Library General Public License for more details.
00016 
00017   You should have received a copy of the GNU Library General Public License
00018   along with this library; see the file COPYING.LIB.  If not, write to
00019   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020   Boston, MA 02110-1301, USA.
00021 */
00030 #ifndef KCAL_ALARM_H
00031 #define KCAL_ALARM_H
00032 
00033 #include <QtCore/QString>
00034 #include <QtCore/QStringList>
00035 #include <QtCore/QList>
00036 
00037 #include <kdatetime.h>
00038 
00039 #include "customproperties.h"
00040 #include "duration.h"
00041 #include "person.h"
00042 #include "listbase.h"
00043 #include "kcal_export.h"
00044 
00045 #include <kpimutils/supertrait.h>
00046 
00047 namespace boost {
00048   template <typename T> class shared_ptr;
00049 }
00050 
00051 namespace KCal {
00052 
00053 class Incidence;
00054 
00065 class KCAL_EXPORT Alarm : public CustomProperties
00066 {
00067   public:
00071     enum Type {
00072       Invalid,   
00073       Display,   
00074       Procedure, 
00075       Email,     
00076       Audio      
00077     };
00078 
00082     typedef ListBase<Alarm> List;
00083 
00087     typedef boost::shared_ptr<Alarm> Ptr;
00088 
00094     explicit Alarm( Incidence *parent );
00095 
00100     Alarm( const Alarm &other );
00101 
00105     virtual ~Alarm();
00106 
00111     bool operator==( const Alarm &a ) const;
00112 
00118     bool operator!=( const Alarm &a ) const { return !operator==( a ); }
00119 
00127     void setParent( Incidence *parent );
00128 
00134     Incidence *parent() const;
00135 
00145     void setType( Type type );
00146 
00152     Type type() const;
00153 
00163     void setDisplayAlarm( const QString &text = QString() );
00164 
00173     void setText( const QString &text );
00174 
00181     QString text() const;
00182 
00192     void setAudioAlarm( const QString &audioFile = QString() );
00193 
00203     void setAudioFile( const QString &audioFile );
00204 
00211     QString audioFile() const;
00212 
00224     void setProcedureAlarm( const QString &programFile,
00225                             const QString &arguments = QString() );
00226 
00237     void setProgramFile( const QString &programFile );
00238 
00246     QString programFile() const;
00247 
00257     void setProgramArguments( const QString &arguments );
00258 
00266     QString programArguments() const;
00267 
00282     void setEmailAlarm( const QString &subject, const QString &text,
00283                         const QList<Person> &addressees,
00284                         const QStringList &attachments = QStringList() );
00285 
00296     void setMailAddress( const Person &mailAlarmAddress );
00297 
00308     void setMailAddresses( const QList<Person> &mailAlarmAddresses );
00309 
00320     void addMailAddress( const Person &mailAlarmAddress );
00321 
00328     QList<Person> mailAddresses() const;
00329 
00340     void setMailSubject( const QString &mailAlarmSubject );
00341 
00348     QString mailSubject() const;
00349 
00360     void setMailAttachment( const QString &mailAttachFile );
00361 
00372     void setMailAttachments( const QStringList &mailAttachFiles );
00373 
00383     void addMailAttachment( const QString &mailAttachFile );
00384 
00391     QStringList mailAttachments() const;
00392 
00403     void setMailText( const QString &text );
00404 
00411     QString mailText() const;
00412 
00420     void setTime( const KDateTime &alarmTime );
00421 
00427     KDateTime time() const;
00428 
00435     KDateTime endTime() const;
00436 
00440     bool hasTime() const;
00441 
00450     void setStartOffset( const Duration &offset );
00451 
00459     Duration startOffset() const;
00460 
00467     bool hasStartOffset() const;
00468 
00477     void setEndOffset( const Duration &offset );
00478 
00486     Duration endOffset() const;
00487 
00494     bool hasEndOffset() const;
00495 
00510     void shiftTimes( const KDateTime::Spec &oldSpec,
00511                      const KDateTime::Spec &newSpec );
00512 
00520     void setSnoozeTime( const Duration &alarmSnoozeTime );
00521 
00527     Duration snoozeTime() const;
00528 
00538     void setRepeatCount( int alarmRepeatCount );
00539 
00545     int repeatCount() const;
00546 
00558     KDateTime nextRepetition( const KDateTime &preTime ) const;
00559 
00573     KDateTime previousRepetition( const KDateTime &afterTime ) const;
00574 
00579     Duration duration() const;
00580 
00587     void toggleAlarm();
00588 
00596     void setEnabled( bool enable );
00597 
00603     bool enabled() const;
00604 
00605   protected:
00610     virtual void customPropertyUpdated();
00611 
00612   private:
00613     //@cond PRIVATE
00614     class Private;
00615     Private *const d;
00616     //@endcond
00617 };
00618 
00619 }
00620 
00621 #endif

KCal Library

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.6.1
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