kontact Library API Documentation

knotes_part.h

00001 /*
00002    This file is part of the KDE project
00003    Copyright (C) 2002 Daniel Molkentin <molkentin@kde.org>
00004    Copyright (C) 2004 Michael Brade <brade@kde.org>
00005 
00006    This program is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; see the file COPYING.  If not, write to
00018    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.
00020 */
00021 
00022 #ifndef KNOTES_PART_H
00023 #define KNOTES_PART_H
00024 
00025 #include <qdict.h>
00026 
00027 #include <kiconview.h>
00028 #include <kglobal.h>
00029 #include <kiconloader.h>
00030 
00031 #include <libkcal/journal.h>
00032 #include <kparts/part.h>
00033 
00034 #include "knotes/KNotesIface.h"
00035 
00036 class KIconView;
00037 class QIconViewItem;
00038 class KNotesIconViewItem;
00039 class KNoteTip;
00040 class KNoteEditDlg;
00041 class KNotesResourceManager;
00042 
00043 namespace KCal {
00044     class Journal;
00045 }
00046 
00047 
00048 class KNotesPart : public KParts::ReadOnlyPart, virtual public KNotesIface
00049 {
00050     Q_OBJECT
00051 public:
00052     KNotesPart( QObject *parent = 0, const char *name = 0 );
00053    ~KNotesPart();
00054 
00055     bool openFile();
00056 
00057 public slots:
00058     QString newNote( const QString& name = QString::null,
00059                      const QString& text = QString::null );
00060     QString newNoteFromClipboard( const QString& name = QString::null );
00061 
00062 public:
00063     void showNote( const QString& id ) const;
00064     void hideNote( const QString& id ) const;
00065 
00066     void killNote( const QString& id );
00067     void killNote( const QString& id, bool force );
00068 
00069     QString name( const QString& id ) const;
00070     QString text( const QString& id ) const;
00071 
00072     void setName( const QString& id, const QString& newName );
00073     void setText( const QString& id, const QString& newText );
00074 
00075     QMap<QString, QString> notes() const;
00076 
00077 // TODO: remove for KDE 4.0
00078     void sync( const QString& app );
00079     bool isNew( const QString& app, const QString& id ) const;
00080     bool isModified( const QString& app, const QString& id ) const;
00081 
00082 private slots:
00083     void createNote( KCal::Journal *journal );
00084     void killNote( KCal::Journal *journal );
00085 
00086     void editNote( QIconViewItem *item );
00087 
00088     void renameNote();
00089     void renamedNote( QIconViewItem *item );
00090 
00091     void slotOnItem( QIconViewItem *item );
00092     void slotOnViewport();
00093 
00094     void popupRMB( QIconViewItem *item, const QPoint& pos );
00095     void killSelectedNotes();
00096 
00097 private:
00098     KIconView *m_notesView;
00099     KNoteTip *m_noteTip;
00100     KNoteEditDlg *m_noteEditDlg;
00101 
00102     KNotesResourceManager *m_manager;
00103     QDict<KNotesIconViewItem> m_noteList;
00104 };
00105 
00106 
00107 #endif
KDE Logo
This file is part of the documentation for kontact Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 25 11:21:31 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003