knotes Library API Documentation

knotesapp.h

00001 /******************************************************************* 00002 KNotes -- Notes for the KDE project 00003 00004 Copyright (c) 1997-2004, The KNotes Developers 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public License 00008 as published by the Free Software Foundation; either version 2 00009 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 00014 GNU 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; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 *******************************************************************/ 00020 00021 #ifndef KNOTESAPP_H 00022 #define KNOTESAPP_H 00023 00024 #include <qstring.h> 00025 #include <qdict.h> 00026 #include <qptrlist.h> 00027 #include <qlabel.h> 00028 00029 #include <kapplication.h> 00030 #include <kxmlguiclient.h> 00031 #include <kxmlguibuilder.h> 00032 00033 #include "KNotesIface.h" 00034 00035 class KNote; 00036 class KPopupMenu; 00037 class KAction; 00038 class KActionMenu; 00039 class KGlobalAccel; 00040 class KXMLGUIFactory; 00041 class KExtendedSocket; 00042 class KNotesResourceManager; 00043 00044 namespace KCal { 00045 class Journal; 00046 } 00047 00048 00049 class KNotesApp : public QLabel, virtual public KNotesIface, public KSessionManaged, 00050 public KXMLGUIBuilder, virtual public KXMLGUIClient 00051 { 00052 Q_OBJECT 00053 public: 00054 KNotesApp(); 00055 ~KNotesApp(); 00056 00057 void showNote( const QString& id ) const; 00058 void hideNote( const QString& id ) const; 00059 00060 void killNote( const QString& id ); 00061 void killNote( const QString& id, bool force ); 00062 00063 QString name( const QString& id ) const; 00064 QString text( const QString& id ) const; 00065 00066 void setName( const QString& id, const QString& newName ); 00067 void setText( const QString& id, const QString& newText ); 00068 00069 QMap<QString,QString> notes() const; 00070 00071 void sync( const QString& app ); 00072 bool isNew( const QString& app, const QString& id ) const; 00073 bool isModified( const QString& app, const QString& id ) const; 00074 00075 bool commitData( QSessionManager& ); 00076 00077 public slots: 00078 QString newNote( const QString& name = QString::null, 00079 const QString& text = QString::null ); 00080 QString newNoteFromClipboard( const QString& name = QString::null ); 00081 00082 protected: 00083 void mousePressEvent( QMouseEvent* ); 00084 bool eventFilter( QObject*, QEvent* ); 00085 00086 protected slots: 00087 void slotShowNote(); 00088 00089 void slotPreferences(); 00090 void slotConfigureAccels(); 00091 00092 void slotNoteKilled( KCal::Journal *journal ); 00093 00094 void slotQuit(); 00095 00096 private: 00097 void showNote( KNote *note ) const; 00098 void saveConfigs(); 00099 00100 private slots: 00101 void acceptConnection(); 00102 void saveNotes(); 00103 void updateNoteActions(); 00104 void updateGlobalAccels(); 00105 void updateNetworkListener(); 00106 00107 void createNote( KCal::Journal *journal ); 00108 void killNote( KCal::Journal *journal ); 00109 00110 private: 00111 class KNoteActionList : public QPtrList<KAction> 00112 { 00113 public: 00114 virtual int compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 ); 00115 }; 00116 00117 KNotesResourceManager *m_manager; 00118 00119 KExtendedSocket *m_listener; 00120 00121 QDict<KNote> m_noteList; 00122 KNoteActionList m_noteActions; 00123 00124 KPopupMenu *m_note_menu; 00125 KPopupMenu *m_context_menu; 00126 00127 KGlobalAccel *m_globalAccel; 00128 KXMLGUIFactory *m_guiFactory; 00129 }; 00130 00131 #endif
KDE Logo
This file is part of the documentation for knotes Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 21 19:46:28 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003