kpilot Library API Documentation

todoWidget.h

00001 /* todoWidget.h KPilot 00002 ** 00003 ** Copyright (C) 2003 by Dan Pilone 00004 ** Written 2003 by Reinhold Kainhofer 00005 ** 00006 00007 ** This file defines the todo-viewing widget used in KPilot 00008 ** to display the Pilot's todo records. 00009 */ 00010 00011 /* 00012 ** This program is free software; you can redistribute it and/or modify 00013 ** it under the terms of the GNU General Public License as published by 00014 ** the Free Software Foundation; either version 2 of the License, or 00015 ** (at your option) any later version. 00016 ** 00017 ** This program is distributed in the hope that it will be useful, 00018 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 ** GNU General Public License for more details. 00021 ** 00022 ** You should have received a copy of the GNU General Public License 00023 ** along with this program in a file called COPYING; if not, write to 00024 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00025 ** MA 02111-1307, USA. 00026 */ 00027 00028 /* 00029 ** Bug reports and questions can be sent to kde-pim@kde.org 00030 */ 00031 #ifndef _KPILOT_TODOWIDGET_H 00032 #define _KPILOT_TODOWIDGET_H 00033 00034 class TodoListView; 00035 class QComboBox; 00036 class QPushButton; 00037 class QTextView; 00038 00039 class PilotDatabase; 00040 00041 #include "pi-todo.h" 00042 00043 #include "pilotComponent.h" 00044 #include "pilotTodoEntry.h" 00045 #include "listItems.h" 00046 00047 class TodoListView : public KListView 00048 { 00049 Q_OBJECT 00050 public: 00051 TodoListView(QWidget * parent = 0, const char * name = 0 ):KListView(parent, name){}; 00052 ~TodoListView() {}; 00053 signals: 00054 void itemChecked(QCheckListItem*item); 00055 void itemChecked(QCheckListItem*item, bool on); 00056 //protected: 00057 public: 00058 void itemWasChecked(QCheckListItem*item, bool on) { 00059 emit itemChecked(item); 00060 emit itemChecked(item, on); 00061 } 00062 }; 00063 00064 class TodoCheckListItem : public PilotCheckListItem 00065 { 00066 public: 00067 TodoCheckListItem(QListView*parent, const QString&text, recordid_t pilotid, void*r); 00068 ~TodoCheckListItem() {}; 00069 virtual void stateChange(bool state); 00070 }; 00071 00072 class TodoWidget : public PilotComponent 00073 { 00074 Q_OBJECT 00075 00076 public: 00077 TodoWidget(QWidget* parent,const QString& dbpath); 00078 ~TodoWidget(); 00079 00080 // Pilot Component Methods: 00081 virtual bool preHotSync(QString &); 00082 virtual void postHotSync(); 00083 virtual void showComponent(); 00084 virtual void hideComponent(); 00085 00086 public slots: 00091 void slotShowTodo(QListViewItem*); 00092 void slotEditRecord(QListViewItem*item); 00093 void slotEditRecord(); 00094 void slotCreateNewRecord(); 00095 void slotDeleteRecord(); 00096 void slotEditCancelled(); 00097 00098 void slotUpdateButtons(); // Enable/disable buttons 00099 00100 signals: 00101 void recordChanged(PilotTodoEntry *); 00102 00103 protected slots: 00108 void slotUpdateRecord(PilotTodoEntry*); 00109 00113 void slotAddRecord(PilotTodoEntry*); 00114 00119 void slotSetCategory(int); 00120 00121 00122 void slotItemChecked(QCheckListItem*item, bool on); 00123 void slotItemRenamed(QListViewItem*item, const QString &txt, int nr); 00124 private: 00125 void setupWidget(); 00126 void updateWidget(); // Called with the lists have changed.. 00127 void writeTodo(PilotTodoEntry* which,PilotDatabase *db=0L); 00128 00135 int getAllTodos(PilotDatabase *todoDB); 00136 00141 QString createTitle(PilotTodoEntry *,int displayMode); 00142 00157 QComboBox *fCatList; 00158 QTextView *fTodoInfo; 00159 struct ToDoAppInfo fTodoAppInfo; 00160 QPtrList<PilotTodoEntry> fTodoList; 00161 TodoListView *fListBox; 00162 QPushButton *fEditButton,*fDeleteButton; 00163 PilotDatabase *fTodoDB; 00164 protected: 00169 int fPendingTodos; 00170 00171 }; 00172 00173 #else 00174 #ifdef DEBUG 00175 #warning "File doubly included" 00176 #endif 00177 #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 Wed Jul 28 23:57:49 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003