konsolekalendar

konsolekalendarvariables.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * konsolekalendarvariables.cpp                                                *
00003  *                                                                             *
00004  * KonsoleKalendar is a command line interface to KDE calendars                *
00005  * Copyright (C) 2002-2004  Tuukka Pasanen <illuusio@mailcity.com>             *
00006  * Copyright (C) 2003-2005  Allen Winter <winter@kde.org>                      *
00007  *                                                                             *
00008  * This program is free software; you can redistribute it and/or modify        *
00009  * it under the terms of the GNU General Public License as published by        *
00010  * the Free Software Foundation; either version 2 of the License, or           *
00011  * (at your option) any later version.                                         *
00012  *                                                                             *
00013  * This program is distributed in the hope that it will be useful,             *
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of              *
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                *
00016  * GNU General Public License for more details.                                *
00017  *                                                                             *
00018  * You should have received a copy of the GNU General Public License           *
00019  * along with this program; if not, write to the Free Software                 *
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
00021  *                                                                             *
00022  * As a special exception, permission is given to link this program            *
00023  * with any edition of Qt, and distribute the resulting executable,            *
00024  * without including the source code for Qt in the source distribution.        *
00025  *                                                                             *
00026  ******************************************************************************/
00033 #include <klocale.h>
00034 #include <kdebug.h>
00035 #include <kglobal.h>
00036 #include <kconfig.h>
00037 #include <kstandarddirs.h>
00038 
00039 #include <qdatetime.h>
00040 #include <qstring.h>
00041 #include <qstringlist.h>
00042 
00043 #include <stdlib.h>
00044 #include <iostream>
00045 #include <stdio.h>
00046 #include <unistd.h>
00047 #include <time.h>
00048 
00049 #include "konsolekalendarvariables.h"
00050 
00051 using namespace KCal;
00052 using namespace std;
00053 
00054 KonsoleKalendarVariables::KonsoleKalendarVariables()
00055 {
00056   m_bIsUID = false;
00057   m_bIsStartDateTime = false;
00058   m_bIsEndDateTime = false;
00059   m_bNext = false;
00060   m_bVerbose = false;
00061   m_bDryRun = false;
00062   m_bUseEvents = false;
00063   m_bUseTodos = false;
00064   m_bUseJournals = false;
00065   m_calendar = "";
00066   m_exportType = ExportTypeText;
00067   m_bIsExportFile = false;
00068   m_bDescription = false;
00069   m_description = "";
00070   m_bLocation = false;
00071   m_location = "Default location";
00072   m_bSummary = false;
00073   m_summary = "Default summary";
00074   m_bFloating = true;
00075 }
00076 
00077 KonsoleKalendarVariables::~KonsoleKalendarVariables()
00078 {
00079   // delete m_resource;
00080 }
00081 
00082 void KonsoleKalendarVariables::setUID( QString uid )
00083 {
00084   m_bIsUID = true;
00085   m_UID = uid;
00086 }
00087 
00088 QString KonsoleKalendarVariables::getUID()
00089 {
00090   return m_UID;
00091 }
00092 
00093 bool KonsoleKalendarVariables::isUID()
00094 {
00095   return m_bIsUID;
00096 }
00097 
00098 void KonsoleKalendarVariables::setStartDateTime( QDateTime start )
00099 {
00100   m_bIsStartDateTime = true;
00101   m_startDateTime = start;
00102 }
00103 
00104 QDateTime KonsoleKalendarVariables::getStartDateTime()
00105 {
00106   return m_startDateTime;
00107 }
00108 
00109 bool KonsoleKalendarVariables::isStartDateTime()
00110 {
00111   return m_bIsStartDateTime;
00112 }
00113 
00114 void KonsoleKalendarVariables::setEndDateTime( QDateTime end )
00115 {
00116   m_bIsEndDateTime = true;
00117   m_endDateTime = end;
00118 }
00119 
00120 QDateTime KonsoleKalendarVariables::getEndDateTime()
00121 {
00122   return m_endDateTime;
00123 }
00124 
00125 bool KonsoleKalendarVariables::isEndDateTime()
00126 {
00127   return m_bIsEndDateTime;
00128 }
00129 
00130 void KonsoleKalendarVariables::setNext( bool next )
00131 {
00132   m_bNext = next;
00133 }
00134 
00135 bool KonsoleKalendarVariables::isNext()
00136 {
00137   return m_bNext;
00138 }
00139 
00140 void KonsoleKalendarVariables::setVerbose( bool verbose )
00141 {
00142   m_bVerbose = verbose;
00143 }
00144 
00145 bool KonsoleKalendarVariables::isVerbose()
00146 {
00147   return m_bVerbose;
00148 }
00149 
00150 void KonsoleKalendarVariables::setDryRun( bool dryrun )
00151 {
00152   m_bDryRun = dryrun;
00153 }
00154 
00155 bool KonsoleKalendarVariables::isDryRun()
00156 {
00157   return m_bDryRun;
00158 }
00159 
00160 void KonsoleKalendarVariables::setUseEvents( bool useEvents )
00161 {
00162   m_bUseEvents = useEvents;
00163 }
00164 
00165 bool KonsoleKalendarVariables::getUseEvents()
00166 {
00167   return( m_bUseEvents );
00168 }
00169 
00170 void KonsoleKalendarVariables::setUseTodos( bool useTodos )
00171 {
00172   m_bUseTodos = useTodos;
00173 }
00174 
00175 bool KonsoleKalendarVariables::getUseTodos()
00176 {
00177   return( m_bUseTodos );
00178 }
00179 
00180 void KonsoleKalendarVariables::setUseJournals( bool useJournals )
00181 {
00182   m_bUseJournals = useJournals;
00183 }
00184 
00185 bool KonsoleKalendarVariables::getUseJournals()
00186 {
00187   return( m_bUseJournals );
00188 }
00189 
00190 void KonsoleKalendarVariables::setCalendarFile( QString calendar )
00191 {
00192   m_calendar = calendar;
00193 }
00194 
00195 QString KonsoleKalendarVariables::getCalendarFile()
00196 {
00197   return m_calendar;
00198 }
00199 
00200 void KonsoleKalendarVariables::setImportFile( QString calendar )
00201 {
00202   m_import = calendar;
00203 }
00204 
00205 QString KonsoleKalendarVariables::getImportFile()
00206 {
00207   return m_import;
00208 }
00209 
00210 void KonsoleKalendarVariables::setCalendar( CalendarResources *resources )
00211 {
00212   m_calendarResources = resources;
00213 }
00214 
00215 CalendarResources *KonsoleKalendarVariables::getCalendar()
00216 {
00217   return m_calendarResources;
00218 }
00219 
00220 void KonsoleKalendarVariables::setExportType( ExportType exportType )
00221 {
00222   m_exportType = exportType;
00223 }
00224 
00225 ExportType KonsoleKalendarVariables::getExportType()
00226 {
00227   return m_exportType;
00228 }
00229 
00230 void KonsoleKalendarVariables::setExportFile( QString export_file )
00231 {
00232   m_exportFile = export_file;
00233   m_bIsExportFile = true;
00234 }
00235 
00236 bool KonsoleKalendarVariables::isExportFile()
00237 {
00238   return m_bIsExportFile;
00239 }
00240 
00241 QString KonsoleKalendarVariables::getExportFile()
00242 {
00243   return m_exportFile;
00244 }
00245 
00246 bool KonsoleKalendarVariables::isAll()
00247 {
00248   return m_bAll;
00249 }
00250 
00251 void KonsoleKalendarVariables::setAll( bool all )
00252 {
00253   m_bAll = all;
00254 }
00255 
00256 bool KonsoleKalendarVariables::getAll()
00257 {
00258   return m_bAll;
00259 }
00260 
00261 void KonsoleKalendarVariables::setDescription( QString description )
00262 {
00263   m_bDescription = true;
00264   m_description = description;
00265 }
00266 
00267 QString KonsoleKalendarVariables::getDescription()
00268 {
00269   return m_description;
00270 }
00271 
00272 bool KonsoleKalendarVariables::isDescription()
00273 {
00274   return m_bDescription;
00275 }
00276 
00277 void KonsoleKalendarVariables::setLocation( QString location )
00278 {
00279   m_bLocation = true;
00280   m_location = location;
00281 }
00282 
00283 QString KonsoleKalendarVariables::getLocation()
00284 {
00285   return m_location;
00286 }
00287 
00288 bool KonsoleKalendarVariables::isLocation()
00289 {
00290   return m_bLocation;
00291 }
00292 
00293 void KonsoleKalendarVariables::setSummary( QString summary )
00294 {
00295   m_bSummary = true;
00296   m_summary = summary;
00297 }
00298 
00299 QString KonsoleKalendarVariables::getSummary()
00300 {
00301   return m_summary;
00302 }
00303 
00304 bool KonsoleKalendarVariables::isSummary()
00305 {
00306   return m_bSummary;
00307 }
00308 
00309 void KonsoleKalendarVariables::setFloating( bool floating )
00310 {
00311   m_bFloating = floating;
00312 }
00313 
00314 bool KonsoleKalendarVariables::getFloating()
00315 {
00316   return m_bFloating;
00317 }
00318 
00319 void KonsoleKalendarVariables::setDaysCount( int count )
00320 {
00321   m_daysCount = count;
00322   m_bDaysCount = true;
00323 }
00324 
00325 int KonsoleKalendarVariables::getDaysCount()
00326 {
00327   return m_daysCount;
00328 }
00329 
00330 bool KonsoleKalendarVariables::isDaysCount()
00331 {
00332   return m_bDaysCount;
00333 }