1 /*******************************************************************
2 KNotes -- Notes for the KDE project
4 Copyright (c) 1997-2006, The KNotes Developers
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 *******************************************************************/
24 #include <QDomDocument>
30 #include <kapplication.h>
31 #include <ksessionmanager.h>
32 #include <kxmlguiclient.h>
41 class KNotesResourceManager
;
44 class KNotificationItem
;
54 : public QWidget
, public KSessionManager
, virtual public KXMLGUIClient
61 void showNote( const QString
&id
) const;
62 void hideNote( const QString
&id
) const;
64 void killNote( const QString
&id
);
65 void killNote( const QString
&id
, bool force
);
67 QString
name( const QString
&id
) const;
68 QString
text( const QString
&id
) const;
70 void setName( const QString
&id
, const QString
&newName
);
71 void setText( const QString
&id
, const QString
&newText
);
73 QMap
<QString
,QString
> notes() const;
75 bool commitData( QSessionManager
& );
78 QString
newNote( const QString
&name
= QString(),
79 const QString
&text
= QString() );
80 QString
newNoteFromClipboard( const QString
&name
= QString() );
82 void hideAllNotes() const;
83 void showAllNotes() const;
86 void slotActivateRequested( bool, const QPoint
& pos
);
87 void slotSecondaryActivateRequested( const QPoint
& );
89 void slotWalkThroughNotes();
91 void slotOpenFindDialog();
94 void slotPreferences();
95 void slotConfigureAccels();
97 void slotNoteKilled( KCal::Journal
*journal
);
102 void showNote( KNote
*note
) const;
106 void acceptConnection();
108 void saveNotes( const QString
& uid
);
109 void updateNoteActions();
110 void updateNetworkListener();
113 void createNote( KCal::Journal
*journal
);
114 void killNote( KCal::Journal
*journal
);
117 QMap
<QString
, KNote
*> m_notes
;
118 QList
<QAction
*> m_noteActions
;
120 KNotesResourceManager
*m_manager
;
121 KNotesAlarm
*m_alarm
;
122 QTcpServer
*m_listener
;
123 DNSSD::PublicService
*m_publisher
;
126 QMap
<QString
, KNote
*>::iterator
*m_findPos
;
129 KMenu
*m_contextMenu
;
131 KXMLGUIFactory
*m_guiFactory
;
132 KXMLGUIBuilder
*m_guiBuilder
;
133 KNotificationItem
*m_tray
;
134 KAction
*m_findAction
;
136 QDomDocument m_noteGUI
;
137 QString m_noteUidModify
;