kpilot Library API Documentation

memoWidget.h

00001 #ifndef _KPILOT_MEMOWIDGET_H
00002 #define _KPILOT_MEMOWIDGET_H
00003 /* memoWidget.h         KPilot
00004 **
00005 ** Copyright (C) 1998-2001 by Dan Pilone
00006 **
00007 ** This is the memo viewer widget.
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., 59 Temple Place, Suite 330, Boston, 
00024 ** MA 02111-1307, USA.
00025 */
00026 
00027 /*
00028 ** Bug reports and questions can be sent to kde-pim@kde.org
00029 */
00030 
00031 #include <time.h>
00032 
00033 #ifndef _PILOT_MEMO_H_
00034 #include <pi-memo.h>
00035 #endif
00036 
00037 #ifndef KDE_VERSION
00038 #include <kdeversion.h>
00039 #endif
00040 
00041 #if KDE_VERSION >= 0x30100
00042 #include <ktextedit.h>
00043 #else
00044 #define KTextEdit QTextEdit
00045 #include <qtextedit.h>
00046 #endif
00047 
00048 #include <qptrlist.h>
00049 
00050 class KPilotInstaller;
00051 class QListBox;
00052 class QComboBox;
00053 class QPushButton;
00054 
00055 class PilotMemo;
00056 class PilotListItem;
00057 
00058 #ifndef _KPILOT_PILOTCOMPONENT_H
00059 #include "pilotComponent.h"
00060 #endif
00061 
00062 class MemoWidget : public PilotComponent
00063 {
00064 Q_OBJECT
00065   
00066 public:
00067     MemoWidget(QWidget* parent, const QString& dbpath);
00068     virtual ~MemoWidget();
00069   
00070     // Pilot Component Methods:
00071     /* virtual */ void showComponent();
00072     /* virtual */ void hideComponent();
00073     /* virtual */ bool preHotSync(QString &);
00074     /* virtual */ void postHotSync();
00075 
00076     // Added by David Bishop, please move to correct location!
00077     bool saveAsXML(const QString &fileName,const QPtrList<PilotListItem> &menu_item );
00078     bool saveAsText(const QString &fileName,const QPtrList<PilotListItem> &menu_item );
00079     
00080     typedef enum { 
00081         MAX_MEMO_LEN = 8192 
00082         } Constants ;
00083 
00084 protected:
00085     void initializeCategories(PilotDatabase *);
00086     void initializeMemos(PilotDatabase *);
00087 
00088     // TODO: Ugh, I have no idea if this fix is in BRANCH as well.
00089     void saveChangedMemo();
00090   
00091 public slots:
00099     void slotShowMemo(int);
00100     void slotUpdateButtons();
00101     // void slotTextChanged();
00102     void slotImportMemo();
00103     void slotExportMemo();
00104     void slotDeleteMemo(); // Delets the currently selected memo(s)
00105     void slotSetCategory(int);
00106 
00107 private:
00108     void setupWidget();
00109     void updateWidget(); // Called with the lists have changed..
00110     void writeMemo(PilotMemo* which);
00111     QComboBox* fCatList;
00112   
00113     KTextEdit*      fTextWidget;
00114     struct MemoAppInfo  fMemoAppInfo;
00115     QPtrList<PilotMemo> fMemoList;
00116     QListBox*       fListBox;
00117 
00118     QPushButton *fExportButton,*fDeleteButton;
00119     
00120     int lastSelectedMemo;
00121 };
00122 
00123 
00124 #endif
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:48 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003