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 *******************************************************************/
25 #include <QDomDocument>
31 #include <kxmlguiclient.h>
32 #include <KSharedConfig>
53 : public QFrame
, virtual public KXMLGUIClient
57 KNote( const QDomDocument
& buildDoc
, KCal::Journal
*journal
, QWidget
*parent
= 0 );
60 void changeJournal(KCal::Journal
*);
61 void saveData( bool update
= true);
62 void saveConfig() const;
64 QString
noteId() const;
68 void setName( const QString
&name
);
69 void setText( const QString
&text
);
71 void find( KFind
* kfind
);
73 bool isModified() const;
74 void blockEmitDataChanged( bool _b
) { m_blockEmitDataChanged
= _b
;}
79 void slotKill( bool force
= false );
82 void sigRequestNewNote();
83 void sigShowNextNote();
84 void sigNameChanged(const QString
&);
85 void sigDataChanged(const QString
&);
86 void sigColorChanged();
87 void sigKillNote( KCal::Journal
* );
89 void sigFindFinished();
92 virtual void contextMenuEvent( QContextMenuEvent
* );
93 virtual void showEvent( QShowEvent
* );
94 virtual void resizeEvent( QResizeEvent
* );
95 virtual void closeEvent( QCloseEvent
* );
96 virtual void dropEvent( QDropEvent
* );
97 virtual void dragEnterEvent( QDragEnterEvent
* );
99 virtual bool event( QEvent
* );
100 virtual bool eventFilter( QObject
*, QEvent
* );
103 void slotUpdateReadOnly();
113 void slotPreferences();
114 void slotPopupActionToDesktop( int id
);
117 void slotHighlight( const QString
&txt
, int idx
, int len
);
119 void slotApplyConfig();
120 void slotUpdateKeepAboveBelow();
121 void slotUpdateShowInTaskbar();
122 void slotUpdateDesktopActions();
124 void slotKeepAbove();
125 void slotKeepBelow();
127 void slotRequestNewNote();
130 void createActions();
131 void createNoteEditor();
132 void createNoteFooter();
133 void createNoteHeader();
138 void updateLabelAlignment();
140 void setColor( const QColor
&, const QColor
& );
142 void toDesktop( int desktop
);
145 QLayout
*m_noteLayout
;
148 KNoteButton
*m_button
;
152 KNoteConfig
*m_config
;
153 KCal::Journal
*m_journal
;
158 KToggleAction
*m_readOnly
;
161 KSelectAction
*m_toDesktop
;
163 KToggleAction
*m_keepAbove
;
164 KToggleAction
*m_keepBelow
;
166 KSharedConfig::Ptr m_kwinConf
;
167 bool m_blockEmitDataChanged
;
168 bool mBlockWriteConfigDuringCommitData
;