KAlarm Library
alarmtext.h
00001 /* 00002 * alarmtext.h - text/email alarm text conversion 00003 * This file is part of kalarmcal library, which provides access to KAlarm 00004 * calendar data. 00005 * Copyright © 2004,2005,2008-2012 by David Jarvie <djarvie@kde.org> 00006 * 00007 * This library is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU Library General Public License as published 00009 * by the Free Software Foundation; either version 2 of the License, or (at 00010 * your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but WITHOUT 00013 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00015 * 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 the 00019 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00020 * MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef ALARMTEXT_H 00024 #define ALARMTEXT_H 00025 00026 #include "kalarmcal_export.h" 00027 00028 #ifndef KALARMCAL_USE_KRESOURCES 00029 #include <kcalcore/todo.h> 00030 #else 00031 namespace KCal { class Todo; } 00032 #endif 00033 #include <QtCore/QString> 00034 00035 class QStringList; 00036 00037 namespace KAlarmCal 00038 { 00039 00040 class KAEvent; 00041 00056 class KALARMCAL_EXPORT AlarmText 00057 { 00058 public: 00063 explicit AlarmText(const QString& text = QString()); 00064 00065 AlarmText(const AlarmText& other); 00066 ~AlarmText(); 00067 AlarmText& operator=(const AlarmText& other); 00068 00072 void setText(const QString& text); 00073 00077 void setScript(const QString& text); 00078 00087 void setEmail(const QString& to, const QString& from, const QString& cc, const QString& time, 00088 const QString& subject, const QString& body, unsigned long kmailSerialNumber = 0); 00089 00090 #ifndef KALARMCAL_USE_KRESOURCES 00091 00094 void setTodo(const KCalCore::Todo::Ptr& todo); 00095 #else 00096 00099 void setTodo(const KCal::Todo* todo); 00100 #endif 00101 00107 QString displayText() const; 00111 QString to() const; 00115 QString from() const; 00119 QString cc() const; 00123 QString time() const; 00127 QString subject() const; 00131 QString body() const; 00132 00136 QString summary() const; 00140 QString location() const; 00144 QString due() const; 00148 QString description() const; 00149 00151 bool isEmpty() const; 00153 bool isEmail() const; 00155 bool isScript() const; 00157 bool isTodo() const; 00158 00162 unsigned long kmailSerialNumber() const; 00163 00171 static QString summary(const KAEvent& event, int maxLines = 1, bool* truncated = 0); 00172 00176 static bool checkIfEmail(const QString& text); 00177 00185 static QString emailHeaders(const QString& text, bool subjectOnly); 00186 00193 static QString fromCalendarText(const QString& text, bool& email); 00194 00199 static QString toCalendarText(const QString& text); 00200 00201 private: 00202 //@cond PRIVATE 00203 class Private; 00204 Private* const d; 00205 //@endcond 00206 }; 00207 00208 } // namespace KAlarmCal 00209 00210 #endif // ALARMTEXT_H 00211 00212 // vim: et sw=4:
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 05:13:34 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 05:13:34 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.