1 /******************************************************************************
2 * konsolekalendarvariables.cpp *
4 * KonsoleKalendar is a command line interface to KDE calendars *
5 * Copyright (C) 2002-2004 Tuukka Pasanen <illuusio@mailcity.com> *
6 * Copyright (C) 2003-2005 Allen Winter <winter@kde.org> *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
18 * You should have received a copy of the GNU General Public License along *
19 * with this program; if not, write to the Free Software Foundation, Inc., *
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22 * As a special exception, permission is given to link this program *
23 * with any edition of Qt, and distribute the resulting executable, *
24 * without including the source code for Qt in the source distribution. *
26 *****************************************************************************/
28 * @file konsolekalendarvariables.cpp
29 * Provides the KonsoleKalendarVariables class definition.
30 * @author Tuukka Pasanen
31 * @author Allen Winter
33 #include "konsolekalendarvariables.h"
35 #include <KLocalizedString>
36 #include "konsolekalendar_debug.h"
41 #include <QStringList>
49 using namespace KCalCore
;
52 KonsoleKalendarVariables::KonsoleKalendarVariables()
55 m_bIsStartDateTime
= false;
56 m_bIsEndDateTime
= false;
62 m_bUseJournals
= false;
63 m_exportType
= ExportTypeText
;
64 m_bIsExportFile
= false;
65 m_bDescription
= false;
66 m_description
.clear();
68 m_location
= QStringLiteral("Default location"); //i18n ?
70 m_summary
= QStringLiteral("Default summary"); //i18n?
76 KonsoleKalendarVariables::~KonsoleKalendarVariables()
80 void KonsoleKalendarVariables::setUID(const QString
&uid
)
86 QString
KonsoleKalendarVariables::getUID() const
91 bool KonsoleKalendarVariables::isUID() const
96 void KonsoleKalendarVariables::setStartDateTime(const QDateTime
&start
)
98 m_bIsStartDateTime
= true;
99 m_startDateTime
= start
;
102 QDateTime
KonsoleKalendarVariables::getStartDateTime() const
104 return m_startDateTime
;
107 bool KonsoleKalendarVariables::isStartDateTime() const
109 return m_bIsStartDateTime
;
112 void KonsoleKalendarVariables::setEndDateTime(const QDateTime
&end
)
114 m_bIsEndDateTime
= true;
118 QDateTime
KonsoleKalendarVariables::getEndDateTime() const
120 return m_endDateTime
;
123 bool KonsoleKalendarVariables::isEndDateTime() const
125 return m_bIsEndDateTime
;
128 void KonsoleKalendarVariables::setNext(bool next
)
133 bool KonsoleKalendarVariables::isNext() const
138 void KonsoleKalendarVariables::setVerbose(bool verbose
)
140 m_bVerbose
= verbose
;
143 bool KonsoleKalendarVariables::isVerbose() const
148 void KonsoleKalendarVariables::setDryRun(bool dryrun
)
153 bool KonsoleKalendarVariables::isDryRun() const
158 void KonsoleKalendarVariables::setUseEvents(bool useEvents
)
160 m_bUseEvents
= useEvents
;
163 bool KonsoleKalendarVariables::getUseEvents() const
168 void KonsoleKalendarVariables::setUseTodos(bool useTodos
)
170 m_bUseTodos
= useTodos
;
173 bool KonsoleKalendarVariables::getUseTodos() const
178 void KonsoleKalendarVariables::setUseJournals(bool useJournals
)
180 m_bUseJournals
= useJournals
;
183 bool KonsoleKalendarVariables::getUseJournals() const
185 return m_bUseJournals
;
188 void KonsoleKalendarVariables::setCalendarFile(const QString
&calendar
)
190 m_calendarFile
= calendar
;
193 QString
KonsoleKalendarVariables::getCalendarFile() const
195 return m_calendarFile
;
198 void KonsoleKalendarVariables::setImportFile(const QString
&calendar
)
203 QString
KonsoleKalendarVariables::getImportFile() const
208 void KonsoleKalendarVariables::setCalendar(const Akonadi::FetchJobCalendar::Ptr
&resources
)
210 m_calendar
= resources
;
213 Akonadi::FetchJobCalendar::Ptr
KonsoleKalendarVariables::getCalendar() const
218 void KonsoleKalendarVariables::setExportType(ExportType exportType
)
220 m_exportType
= exportType
;
223 ExportType
KonsoleKalendarVariables::getExportType() const
228 void KonsoleKalendarVariables::setExportFile(const QString
&export_file
)
230 m_exportFile
= export_file
;
231 m_bIsExportFile
= true;
234 bool KonsoleKalendarVariables::isExportFile() const
236 return m_bIsExportFile
;
239 QString
KonsoleKalendarVariables::getExportFile() const
244 bool KonsoleKalendarVariables::isAll() const
249 void KonsoleKalendarVariables::setAll(bool all
)
254 bool KonsoleKalendarVariables::getAll() const
259 void KonsoleKalendarVariables::setDescription(const QString
&description
)
261 m_bDescription
= true;
262 m_description
= description
;
265 QString
KonsoleKalendarVariables::getDescription() const
267 return m_description
;
270 bool KonsoleKalendarVariables::isDescription() const
272 return m_bDescription
;
275 void KonsoleKalendarVariables::setLocation(const QString
&location
)
278 m_location
= location
;
281 QString
KonsoleKalendarVariables::getLocation() const
286 bool KonsoleKalendarVariables::isLocation() const
291 void KonsoleKalendarVariables::setSummary(const QString
&summary
)
297 QString
KonsoleKalendarVariables::getSummary() const
302 bool KonsoleKalendarVariables::isSummary() const
307 void KonsoleKalendarVariables::setFloating(bool floating
)
309 m_bFloating
= floating
;
312 bool KonsoleKalendarVariables::getFloating() const
317 void KonsoleKalendarVariables::setDaysCount(int count
)
323 int KonsoleKalendarVariables::getDaysCount() const
328 bool KonsoleKalendarVariables::isDaysCount() const
333 void KonsoleKalendarVariables::setAllowGui(bool allow
)
338 void KonsoleKalendarVariables::setCollectionId(Akonadi::Collection::Id id
)
343 Akonadi::Collection::Id
KonsoleKalendarVariables::collectionId() const
345 return m_collectionId
;
348 bool KonsoleKalendarVariables::allowGui() const