kpilot

memofile-conduit.h

Go to the documentation of this file.
00001 #ifndef _MEMOFILE_MEMOFILE_CONDUIT_H
00002 #define _MEMOFILE_MEMOFILE_CONDUIT_H
00003 /* memofile-conduit.h           KPilot
00004 **
00005 ** Copyright (C) 2004-2007 by Jason 'vanRijn' Kasper
00006 */
00007 
00008 /*
00009 ** This program is free software; you can redistribute it and/or modify
00010 ** it under the terms of the GNU Lesser General Public License as published by
00011 ** the Free Software Foundation; either version 2.1 of the License, or
00012 ** (at your option) any later version.
00013 **
00014 ** This program is distributed in the hope that it will be useful,
00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017 ** GNU Lesser General Public License for more details.
00018 **
00019 ** You should have received a copy of the GNU Lesser General Public License
00020 ** along with this program in a file called COPYING; if not, write to
00021 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00022 ** MA 02110-1301, USA.
00023 */
00024 
00025 /*
00026 ** Bug reports and questions can be sent to kde-pim@kde.org
00027 */
00028 
00029 #include <pi-memo.h>
00030 
00031 #include "plugin.h"
00032 
00033 #include "memofiles.h"
00034 
00035 class PilotMemo;
00036 
00037 class MemofileConduit : public ConduitAction
00038 {
00039 Q_OBJECT
00040 public:
00041     MemofileConduit(KPilotLink *,
00042         const char *name=0L,
00043         const QStringList &args = QStringList());
00044     virtual ~MemofileConduit();
00045 
00046 protected:
00047     virtual bool exec();
00048 
00049 
00050 protected slots:
00051     void process();
00052 
00053 private:
00054     // configuration settings...
00055     QString _DEFAULT_MEMODIR;
00056     QString _memo_directory;
00057     bool    _sync_private;
00058 
00059     PilotMemoInfo   *fMemoAppInfo;
00060     QPtrList<PilotMemo> fMemoList;
00061 
00062     // our categories
00063     MemoCategoryMap fCategories;
00064 
00065     Memofiles * _memofiles;
00066 
00067 
00068     bool    readConfig();
00069     bool    getAppInfo();
00070     bool    setAppInfo();
00071 
00072     bool    initializeFromPilot();
00073     bool    loadPilotCategories();
00074 
00075     void    listPilotMemos();
00076 
00077     void    getAllFromPilot();
00078     void    getModifiedFromPilot();
00079 
00080     bool    copyHHToPC();
00081     bool    copyPCToHH();
00082     void    deleteUnsyncedHHRecords();
00083     bool    sync();
00084 
00085     int     writeToPilot(Memofile * memofile);
00086     void    deleteFromPilot(PilotMemo* memo);
00087 
00088     void    cleanup();
00089 
00090 };
00091 
00092 #endif