30 #include <tdeconfig.h>
31 #include <kxmlguiclient.h>
44 class TDEToggleAction;
51 class KNote :
public TQFrame,
virtual public KXMLGUIClient
56 KNote( TQDomDocument buildDoc, KCal::Journal *journal, TQWidget *parent = 0,
57 const char *name = 0 );
60 void changeJournal(KCal::Journal *);
61 void saveData(
bool update =
true);
62 void saveConfig()
const;
64 TQString noteId()
const;
66 TQString name()
const;
67 TQString text()
const;
68 TQString plainText()
const;
70 void setName(
const TQString& name );
71 void setText(
const TQString& text );
73 TQColor fgColor()
const;
74 TQColor bgColor()
const;
75 void setColor(
const TQColor& fg,
const TQColor& bg );
77 void find(
const TQString& pattern,
long options );
79 bool isModified()
const;
80 TQDateTime getLastModified()
const;
82 void sync(
const TQString& app );
83 bool isNew(
const TQString& app )
const;
84 bool isModified(
const TQString& app )
const;
86 static void setStyle(
int style );
88 void deleteWhenIdle();
89 void blockEmitDataChanged(
bool _b ) { m_blockEmitDataChanged = _b;}
91 void slotKill(
bool force =
false );
94 void sigRequestNewNote();
95 void sigShowNextNote();
96 void sigNameChanged();
97 void sigDataChanged(
const TQString &);
98 void sigColorChanged();
99 void sigKillNote( KCal::Journal* );
101 void sigFindFinished();
104 virtual void drawFrame( TQPainter* );
105 virtual void showEvent( TQShowEvent* );
106 virtual void resizeEvent( TQResizeEvent* );
107 virtual void closeEvent( TQCloseEvent* );
108 virtual void dropEvent( TQDropEvent* );
109 virtual void dragEnterEvent( TQDragEnterEvent* );
111 virtual bool event( TQEvent* );
112 virtual bool eventFilter( TQObject*, TQEvent* );
114 virtual bool focusNextPrevChild(
bool );
117 void aboutToEnterEventLoop();
118 void eventLoopLeft();
122 void slotUpdateReadOnly();
133 void slotPreferences();
134 void slotPopupActionToDesktop(
int id );
137 void slotHighlight(
const TQString& txt,
int idx,
int len );
139 void slotApplyConfig();
140 void slotUpdateKeepAboveBelow();
141 void slotUpdateShowInTaskbar();
142 void slotUpdateDesktopActions();
144 void slotUpdateViewport(
int,
int );
145 void slotRequestNewNote();
151 void updateLabelAlignment();
152 void updateBackground(
int offset = -1 );
156 void toDesktop(
int desktop );
158 TQString toPlainText(
const TQString& );
161 TQLabel *m_label, *m_pushpin, *m_fold;
162 KNoteButton *m_button;
166 KNoteConfig *m_config;
167 KCal::Journal *m_journal;
171 TDEPopupMenu *m_menu;
172 TDEPopupMenu *m_edit_menu;
174 TDEToggleAction *m_readOnly;
176 TDEListAction *m_toDesktop;
177 TDEToggleAction *m_keepAbove;
178 TDEToggleAction *m_keepBelow;
180 TDESharedConfig::Ptr m_twinConf;
182 static int s_ppOffset;
185 bool m_deleteWhenIdle;
186 bool m_blockEmitDataChanged;