kontact
knotes_part.h
Go to the documentation of this file.00001 /* 00002 This file is part of the KDE project 00003 00004 Copyright (C) 2002 Daniel Molkentin <molkentin@kde.org> 00005 Copyright (C) 2004 Michael Brade <brade@kde.org> 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; see the file COPYING. If not, write to 00019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef KNOTES_PART_H 00024 #define KNOTES_PART_H 00025 00026 #include <kcal/journal.h> 00027 00028 #include <kparts/part.h> 00029 00030 #include <q3dict.h> 00031 00032 class K3IconView; 00033 class Q3IconViewItem; 00034 class KNotesIconViewItem; 00035 class KNoteTip; 00036 class KNoteEditDlg; 00037 class KNotesResourceManager; 00038 00039 namespace KCal { 00040 class Journal; 00041 } 00042 00043 class KNotesPart : public KParts::ReadOnlyPart 00044 { 00045 Q_OBJECT 00046 00047 public: 00048 KNotesPart( QObject *parent = 0 ); 00049 ~KNotesPart(); 00050 00051 bool openFile(); 00052 00053 public slots: 00054 QString newNote( const QString &name = QString(), 00055 const QString &text = QString() ); 00056 QString newNoteFromClipboard( const QString &name = QString() ); 00057 00058 public: 00059 void killNote( const QString &id ); 00060 void killNote( const QString &id, bool force ); 00061 00062 QString name( const QString &id ) const; 00063 QString text( const QString &id ) const; 00064 00065 void setName( const QString &id, const QString &newName ); 00066 void setText( const QString &id, const QString &newText ); 00067 00068 QMap<QString, QString> notes() const; 00069 00070 private slots: 00071 void createNote( KCal::Journal *journal ); 00072 void killNote( KCal::Journal *journal ); 00073 00074 void editNote( Q3IconViewItem *item ); 00075 00076 void renameNote(); 00077 void renamedNote( Q3IconViewItem *item ); 00078 00079 void slotOnItem( Q3IconViewItem *item ); 00080 void slotOnViewport(); 00081 void slotOnCurrentChanged( Q3IconViewItem *item ); 00082 00083 void popupRMB( Q3IconViewItem *item, const QPoint &pos ); 00084 void killSelectedNotes(); 00085 00086 void printSelectedNotes(); 00087 00088 private: 00089 K3IconView *mNotesView; 00090 KNoteTip *mNoteTip; 00091 KNoteEditDlg *mNoteEditDlg; 00092 00093 KNotesResourceManager *mManager; 00094 Q3Dict<KNotesIconViewItem> mNoteList; 00095 }; 00096 00097 #endif
KDE 4.2 API Reference