00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KNOTES_PART_H
00023 #define KNOTES_PART_H
00024
00025 #include <tqdict.h>
00026
00027 #include <kiconview.h>
00028 #include <tdeglobal.h>
00029 #include <kiconloader.h>
00030
00031 #include <libkcal/journal.h>
00032 #include <tdeparts/part.h>
00033
00034 #include "knotes/KNotesIface.h"
00035
00036 class TDEIconView;
00037 class TQIconViewItem;
00038 class KNotesIconViewItem;
00039 class KNoteTip;
00040 class KNoteEditDlg;
00041 class KNotesResourceManager;
00042
00043 namespace KCal {
00044 class Journal;
00045 }
00046
00047 class KNotesPart : public KParts::ReadOnlyPart, virtual public KNotesIface
00048 {
00049 Q_OBJECT
00050
00051
00052 public:
00053 KNotesPart( TQObject *parent = 0, const char *name = 0 );
00054 ~KNotesPart();
00055
00056 bool openFile();
00057
00058 public slots:
00059 TQString newNote( const TQString& name = TQString(),
00060 const TQString& text = TQString() );
00061 TQString newNoteFromClipboard( const TQString& name = TQString() );
00062
00063 public:
00064 void killNote( const TQString& id );
00065 void killNote( const TQString& id, bool force );
00066
00067 TQString name( const TQString& id ) const;
00068 TQString text( const TQString& id ) const;
00069
00070 void setName( const TQString& id, const TQString& newName );
00071 void setText( const TQString& id, const TQString& newText );
00072
00073 TQMap<TQString, TQString> notes() const;
00074
00075 private slots:
00076 void createNote( KCal::Journal *journal );
00077 void killNote( KCal::Journal *journal );
00078
00079 void editNote( TQIconViewItem *item );
00080
00081 void renameNote();
00082 void renamedNote( TQIconViewItem *item );
00083
00084 void slotOnItem( TQIconViewItem *item );
00085 void slotOnViewport();
00086 void slotOnCurrentChanged( TQIconViewItem *item );
00087
00088 void popupRMB( TQIconViewItem *item, const TQPoint& pos );
00089 void killSelectedNotes();
00090
00091 void printSelectedNotes();
00092
00093 private:
00094 TDEIconView *mNotesView;
00095 KNoteTip *mNoteTip;
00096 KNoteEditDlg *mNoteEditDlg;
00097
00098 KNotesResourceManager *mManager;
00099 TQDict<KNotesIconViewItem> mNoteList;
00100 TQString mOldName;
00101 };
00102
00103 #endif