kpilot
kroupware.h
Go to the documentation of this file.00001 #ifndef _KPILOT_KROUPWARE_H 00002 #define _KPILOT_KROUPWARE_H 00003 /* kroupware.h KPilot 00004 ** 00005 ** Copyright still to be determined. 00006 ** 00007 ** This file defines the actions taken when KPilot 00008 ** is Kroupware-enabled. Basically it just does a 00009 ** little communication with the local Kroupware agent (KMail). 00010 */ 00011 00012 /* 00013 ** This program is free software; you can redistribute it and/or modify 00014 ** it under the terms of the GNU General Public License as published by 00015 ** the Free Software Foundation; either version 2 of the License, or 00016 ** (at your option) any later version. 00017 ** 00018 ** This program is distributed in the hope that it will be useful, 00019 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 ** GNU General Public License for more details. 00022 ** 00023 ** You should have received a copy of the GNU General Public License 00024 ** along with this program in a file called COPYING; if not, write to 00025 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00026 ** MA 02110-1301, USA. 00027 */ 00028 00029 /* 00030 ** Bug reports and questions can be sent to kde-pim@kde.org 00031 */ 00032 00033 #include "syncAction.h" 00034 00035 class QString; 00036 00037 class KroupwareSync : public SyncAction 00038 { 00039 public: 00040 // Creates a pre- or post-sync action 00041 // depending on @p pre (pre==true makes 00042 // it a pre-sync action, pre==false makes 00043 // it a post-sync action). 00044 // 00045 // Which things it syncs is based on 00046 // @p parts, which is a bitwise OR of 00047 // values from the KroupwareParts enum. 00048 // 00049 KroupwareSync(bool pre,int parts,KPilotDeviceLink *p); 00050 00051 enum KroupwareParts 00052 { 00053 Cal=1, 00054 Todo=2, 00055 Notes=4, 00056 Address=8 00057 } ; 00058 00059 protected: 00060 virtual bool exec(); 00061 00062 void preSync(); // Functions to collect all the actions 00063 void postSync(); // together. Call {start,end}*(). 00064 00065 protected: 00066 bool fPre; 00067 int fParts; 00068 00069 private: 00070 bool _syncWithKMail; 00071 00072 void cleanupConfig(); 00073 void start_syncCal_TodosWithKMail( bool cal, bool todos); 00074 void start_syncAddWithKMail(); 00075 void start_syncNotesWithKMail(); 00076 void end_syncCal_TodosWithKMail( bool cal, bool todos); 00077 void end_syncAddWithKMail(); 00078 void end_syncNotesWithKMail(); 00079 00080 00081 public: 00082 /* Try to start KMail. Returns true on success. */ 00083 static bool startKMail(QString *errormessage); 00084 } ; 00085 00086 #endif 00087