kpilot

knotes-action.h

Go to the documentation of this file.
00001 #ifndef _KPILOT_KNOTES_ACTION_H
00002 #define _KPILOT_KNOTES_ACTION_H
00003 /* knotes-action.h                      KPilot
00004 **
00005 ** Copyright (C) 2001,2003 by Dan Pilone
00006 **
00007 ** This file defines the SyncAction that the KNotes conduit performs.
00008 */
00009 
00010 /*
00011 ** This program is free software; you can redistribute it and/or modify
00012 ** it under the terms of the GNU General Public License as published by
00013 ** the Free Software Foundation; either version 2 of the License, or
00014 ** (at your option) any later version.
00015 **
00016 ** This program is distributed in the hope that it will be useful,
00017 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 ** GNU General Public License for more details.
00020 **
00021 ** You should have received a copy of the GNU General Public License
00022 ** along with this program in a file called COPYING; if not, write to
00023 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00024 ** MA 02110-1301, USA.
00025 */
00026 
00027 /*
00028 ** Bug reports and questions can be sent to kde-pim@kde.org
00029 */
00030 
00031 #include <plugin.h>
00032 
00033 
00034 class NoteAndMemo;
00035 class PilotMemo;
00036 
00037 class KNotesAction : public ConduitAction
00038 {
00039 Q_OBJECT
00040 public:
00041     KNotesAction(
00042         KPilotLink *o,
00043         const char *n = 0L,
00044         const QStringList &a = QStringList() );
00045     virtual ~KNotesAction();
00046 
00047     enum Status { Init,
00048         ModifiedNotesToPilot,
00049         DeleteNotesOnPilot,
00050         NewNotesToPilot,
00051         MemosToKNotes,
00052         Cleanup,
00053         Done } ;
00054     virtual QString statusString() const;
00055 
00056 protected:
00057     virtual bool exec();
00058 
00059 protected:
00063     void listNotes();
00064 
00066     void test();
00067 
00073     bool openKNotesResource();
00074 
00082     void getAppInfo();
00083     void getConfigInfo();
00084     bool modifyNoteOnPilot();
00085     bool deleteNoteOnPilot();
00086     bool addNewNoteToPilot();
00087     bool syncMemoToKNotes();
00088     void cleanupMemos();
00089 
00090     void updateNote(const NoteAndMemo &,const PilotMemo *);
00091 
00095     void addMemoToKNotes(const PilotMemo *);
00100     int addNoteToPilot();
00101 
00102 
00103     void resetIndexes();
00104 
00105 protected slots:
00106     void process();
00107 
00108 private:
00109     class KNotesActionPrivate;
00110     KNotesActionPrivate *fP;
00111 } ;
00112 
00113 #endif