SVN_SILENT made messages (.desktop file)
[kdepim.git] / console / konsolekalendar / konsolekalendarvariables.cpp
blob628f006bb25b495b8e214ad22573033e999197af
1 /******************************************************************************
2 * konsolekalendarvariables.cpp *
3 * *
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> *
7 * *
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. *
12 * *
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. *
17 * *
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. *
21 * *
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. *
25 * *
26 *****************************************************************************/
27 /**
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 <qdebug.h>
37 #include <kconfig.h>
39 #include <QtCore/QDateTime>
40 #include <QtCore/QString>
41 #include <QtCore/QStringList>
43 #include <stdlib.h>
44 #include <iostream>
45 #include <stdio.h>
46 #include <unistd.h>
47 #include <time.h>
49 using namespace KCalCore;
50 using namespace std;
52 KonsoleKalendarVariables::KonsoleKalendarVariables()
54 m_bIsUID = false;
55 m_bIsStartDateTime = false;
56 m_bIsEndDateTime = false;
57 m_bNext = false;
58 m_bVerbose = false;
59 m_bDryRun = false;
60 m_bUseEvents = false;
61 m_bUseTodos = false;
62 m_bUseJournals = false;
63 m_exportType = ExportTypeText;
64 m_bIsExportFile = false;
65 m_bDescription = false;
66 m_description.clear();
67 m_bLocation = false;
68 m_location = QLatin1String("Default location"); //i18n ?
69 m_bSummary = false;
70 m_summary = QLatin1String("Default summary"); //i18n?
71 m_bFloating = true;
72 m_bAllowGui = false;
73 m_collectionId = -1;
76 KonsoleKalendarVariables::~KonsoleKalendarVariables()
80 void KonsoleKalendarVariables::setUID(const QString &uid)
82 m_bIsUID = true;
83 m_UID = uid;
86 QString KonsoleKalendarVariables::getUID() const
88 return m_UID;
91 bool KonsoleKalendarVariables::isUID() const
93 return m_bIsUID;
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;
115 m_endDateTime = end;
118 QDateTime KonsoleKalendarVariables::getEndDateTime() const
120 return m_endDateTime;
123 bool KonsoleKalendarVariables::isEndDateTime() const
125 return m_bIsEndDateTime;
128 void KonsoleKalendarVariables::setNext(bool next)
130 m_bNext = next;
133 bool KonsoleKalendarVariables::isNext() const
135 return m_bNext;
138 void KonsoleKalendarVariables::setVerbose(bool verbose)
140 m_bVerbose = verbose;
143 bool KonsoleKalendarVariables::isVerbose() const
145 return m_bVerbose;
148 void KonsoleKalendarVariables::setDryRun(bool dryrun)
150 m_bDryRun = dryrun;
153 bool KonsoleKalendarVariables::isDryRun() const
155 return m_bDryRun;
158 void KonsoleKalendarVariables::setUseEvents(bool useEvents)
160 m_bUseEvents = useEvents;
163 bool KonsoleKalendarVariables::getUseEvents() const
165 return m_bUseEvents;
168 void KonsoleKalendarVariables::setUseTodos(bool useTodos)
170 m_bUseTodos = useTodos;
173 bool KonsoleKalendarVariables::getUseTodos() const
175 return m_bUseTodos;
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)
200 m_import = calendar;
203 QString KonsoleKalendarVariables::getImportFile() const
205 return m_import;
208 void KonsoleKalendarVariables::setCalendar(const Akonadi::FetchJobCalendar::Ptr &resources)
210 m_calendar = resources;
213 Akonadi::FetchJobCalendar::Ptr KonsoleKalendarVariables::getCalendar() const
215 return m_calendar;
218 void KonsoleKalendarVariables::setExportType(ExportType exportType)
220 m_exportType = exportType;
223 ExportType KonsoleKalendarVariables::getExportType() const
225 return m_exportType;
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
241 return m_exportFile;
244 bool KonsoleKalendarVariables::isAll() const
246 return m_bAll;
249 void KonsoleKalendarVariables::setAll(bool all)
251 m_bAll = all;
254 bool KonsoleKalendarVariables::getAll() const
256 return m_bAll;
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)
277 m_bLocation = true;
278 m_location = location;
281 QString KonsoleKalendarVariables::getLocation() const
283 return m_location;
286 bool KonsoleKalendarVariables::isLocation() const
288 return m_bLocation;
291 void KonsoleKalendarVariables::setSummary(const QString &summary)
293 m_bSummary = true;
294 m_summary = summary;
297 QString KonsoleKalendarVariables::getSummary() const
299 return m_summary;
302 bool KonsoleKalendarVariables::isSummary() const
304 return m_bSummary;
307 void KonsoleKalendarVariables::setFloating(bool floating)
309 m_bFloating = floating;
312 bool KonsoleKalendarVariables::getFloating() const
314 return m_bFloating;
317 void KonsoleKalendarVariables::setDaysCount(int count)
319 m_daysCount = count;
320 m_bDaysCount = true;
323 int KonsoleKalendarVariables::getDaysCount() const
325 return m_daysCount;
328 bool KonsoleKalendarVariables::isDaysCount() const
330 return m_bDaysCount;
333 void KonsoleKalendarVariables::setAllowGui(bool allow)
335 m_bAllowGui = allow;
338 void KonsoleKalendarVariables::setCollectionId(Akonadi::Collection::Id id)
340 m_collectionId = id;
343 Akonadi::Collection::Id KonsoleKalendarVariables::collectionId() const
345 return m_collectionId;
348 bool KonsoleKalendarVariables::allowGui() const
350 return m_bAllowGui;