konsolekalendar

konsolekalendarvariables.cpp
Go to the documentation of this file.
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 *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 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 TQt, and distribute the resulting executable, *
24 * without including the source code for TQt in the source distribution. *
25 * *
26 ******************************************************************************/
33#include <tdelocale.h>
34#include <kdebug.h>
35#include <tdeglobal.h>
36#include <tdeconfig.h>
37#include <tdestandarddirs.h>
38
39#include <tqdatetime.h>
40#include <tqstring.h>
41#include <tqstringlist.h>
42
43#include <stdlib.h>
44#include <iostream>
45#include <stdio.h>
46#include <unistd.h>
47#include <time.h>
48
50
51using namespace KCal;
52using namespace std;
53
54KonsoleKalendarVariables::KonsoleKalendarVariables()
55{
56 m_bIsUID = false;
57 m_bIsStartDateTime = false;
58 m_bIsEndDateTime = false;
59 m_bNext = false;
60 m_bVerbose = false;
61 m_bDryRun = false;
62 m_bUseEvents = false;
63 m_bUseTodos = false;
64 m_bUseJournals = false;
65 m_calendar = "";
66 m_exportType = ExportTypeText;
67 m_bIsExportFile = false;
68 m_bDescription = false;
69 m_description = "";
70 m_bLocation = false;
71 m_location = "Default location";
72 m_bSummary = false;
73 m_summary = "Default summary";
74 m_bFloating = true;
75}
76
78{
79 // delete m_resource;
80}
81
83{
84 m_bIsUID = true;
85 m_UID = uid;
86}
87
89{
90 return m_UID;
91}
92
94{
95 return m_bIsUID;
96}
97
99{
100 m_bIsStartDateTime = true;
101 m_startDateTime = start;
102}
103
105{
106 return m_startDateTime;
107}
108
110{
111 return m_bIsStartDateTime;
112}
113
115{
116 m_bIsEndDateTime = true;
117 m_endDateTime = end;
118}
119
121{
122 return m_endDateTime;
123}
124
126{
127 return m_bIsEndDateTime;
128}
129
131{
132 m_bNext = next;
133}
134
136{
137 return m_bNext;
138}
139
141{
142 m_bVerbose = verbose;
143}
144
146{
147 return m_bVerbose;
148}
149
151{
152 m_bDryRun = dryrun;
153}
154
156{
157 return m_bDryRun;
158}
159
161{
162 m_bUseEvents = useEvents;
163}
164
166{
167 return( m_bUseEvents );
168}
169
171{
172 m_bUseTodos = useTodos;
173}
174
176{
177 return( m_bUseTodos );
178}
179
181{
182 m_bUseJournals = useJournals;
183}
184
186{
187 return( m_bUseJournals );
188}
189
191{
192 m_calendar = calendar;
193}
194
196{
197 return m_calendar;
198}
199
201{
202 m_import = calendar;
203}
204
206{
207 return m_import;
208}
209
210void KonsoleKalendarVariables::setCalendar( CalendarResources *resources )
211{
212 m_calendarResources = resources;
213}
214
216{
217 return m_calendarResources;
218}
219
221{
222 m_exportType = exportType;
223}
224
226{
227 return m_exportType;
228}
229
230void KonsoleKalendarVariables::setExportFile( TQString export_file )
231{
232 m_exportFile = export_file;
233 m_bIsExportFile = true;
234}
235
237{
238 return m_bIsExportFile;
239}
240
242{
243 return m_exportFile;
244}
245
247{
248 return m_bAll;
249}
250
252{
253 m_bAll = all;
254}
255
257{
258 return m_bAll;
259}
260
262{
263 m_bDescription = true;
264 m_description = description;
265}
266
268{
269 return m_description;
270}
271
273{
274 return m_bDescription;
275}
276
278{
279 m_bLocation = true;
280 m_location = location;
281}
282
284{
285 return m_location;
286}
287
289{
290 return m_bLocation;
291}
292
294{
295 m_bSummary = true;
296 m_summary = summary;
297}
298
300{
301 return m_summary;
302}
303
305{
306 return m_bSummary;
307}
308
310{
311 m_bFloating = floating;
312}
313
315{
316 return m_bFloating;
317}
318
320{
321 m_daysCount = count;
322 m_bDaysCount = true;
323}
324
326{
327 return m_daysCount;
328}
329
331{
332 return m_bDaysCount;
333}
bool getFloating()
Return if Event is floating.
void setDescription(TQString description)
Add description.
void setCalendar(CalendarResources *resources)
Set calendar resources for global use.
bool isStartDateTime()
Is there start date?
bool getUseTodos()
Get use Todos switch.
bool getUseEvents()
Get use Events switch.
void setEndDateTime(TQDateTime end)
Sets end date.
bool isDryRun()
Is this program only in testing mode?
TQString getImportFile()
Return import filename.
void setStartDateTime(TQDateTime start)
Sets start date.
void setUID(TQString uid)
Sets the UID, the unique tag for VCard entry.
void setUseEvents(bool useEvents)
Set switch to use Events.
void setAll(bool all)
View all option.
void setNext(bool next)
Show only next activity and exit.
TQString getCalendarFile()
Returns fullpath to calendar file.
void setFloating(bool floating)
Set if Event is floating.
TQString getDescription()
Return description.
int getDaysCount()
Get how many day should be seen.
bool isDaysCount()
Is there some cound of days should be seen.
TQString getExportFile()
To what file we'll output.
void setExportType(ExportType exportType)
Set export type that'll we use.
bool isDescription()
Is there an event description?
void setCalendarFile(TQString calendar)
Set calendar file.
bool isVerbose()
Should program be more verbose?
bool isNext()
Should we show only next activity and exit?
void setUseTodos(bool useTodos)
Set switch to use Todos.
void setVerbose(bool verbose)
Should program be more verbose?
TQDateTime getStartDateTime()
Get start date.
bool isLocation()
Is there event location information available?
bool getUseJournals()
Get use Journals switch.
void setDaysCount(int count)
Set how many day should be seen.
void setDryRun(bool dryrun)
Should we only try to run it and do nothing?
void setUseJournals(bool useJournals)
Set switch to use Journals.
TQString getLocation()
Return location information.
void setSummary(TQString summary)
Add summary.
ExportType getExportType()
What export type to use.
void setImportFile(TQString calendar)
Set file to import active calendar.
bool isExportFile()
Has an Export File been set?
bool isSummary()
Is there an event summary?
TQDateTime getEndDateTime()
Get end date.
TQString getUID()
Get UID, the unique tag for VCard entry.
void setLocation(TQString location)
Add location information.
void setExportFile(TQString export_file)
Set output file.
bool isAll()
Is the all option set?
CalendarResources * getCalendar()
Get global calendar resources.
Provides the KonsoleKalendarVariables class definition.
ExportType
ExportType is the type of Export output.
@ ExportTypeText
Export as text (default)