19 #ifndef KNOTIFYDIALOG_H
20 #define KNOTIFYDIALOG_H
22 #include <tdelistview.h>
23 #include <kdialogbase.h>
24 #include <kinstance.h>
25 #include <tdeglobal.h>
27 #include "knotifywidgetbase.h"
73 const TDEAboutData *aboutData =
74 TDEGlobal::instance()->aboutData() );
90 static int configure( TQWidget *parent = 0,
const char *name = 0,
91 const TDEAboutData *aboutData = TDEGlobal::instance()->aboutData() );
102 virtual void addApplicationEvents(
const char *appName );
113 virtual void addApplicationEvents(
const TQString& path );
119 virtual void clearApplicationEvents();
132 KNotify::KNotifyWidget * m_notifyWidget;
144 typedef TQPtrList<Event> EventList;
145 typedef TQPtrListIterator<Application> ApplicationListIterator;
146 typedef TQPtrListIterator<Event> EventListIterator;
151 class TDEIO_EXPORT Application
154 Application(
const TQString &path );
157 TQString text()
const {
return m_description; }
158 TQString icon()
const {
return m_icon; }
159 const EventList& eventList();
160 void reloadEvents(
bool revertToDefaults =
false );
163 TQString appName()
const {
return m_appname; }
167 TQString m_description;
176 class TDEIO_EXPORT ApplicationList :
public TQPtrList<Application>
178 virtual int compareItems ( TQPtrCollection::Item item1,
179 TQPtrCollection::Item item2 )
181 return (
static_cast<Application*
>( item1 )->text() >=
182 static_cast<Application*
>( item2 )->text()) ? 1 : -1;
189 class TDEIO_EXPORT KNotifyWidget :
public KNotifyWidgetBase
194 KNotifyWidget( TQWidget* parent = 0,
const char* name = 0,
195 bool handleAllApps =
false );
198 TDEListView * eventsView() {
202 void addVisibleApp( Application *app );
203 ApplicationList& visibleApps() {
return m_visibleApps; }
204 ApplicationList& allApps() {
return m_allApps; }
211 Application * addApplicationEvents(
const TQString& path );
213 void resetDefaults(
bool ask );
214 void sort(
bool ascending =
true );
220 virtual void clear();
226 virtual void clearVisible();
228 virtual void showAdvanced(
bool show );
229 void toggleAdvanced();
233 void changed(
bool hasChanges );
239 Event * currentEvent();
240 virtual void showEvent( TQShowEvent * );
241 virtual void enableAll(
int what,
bool enable );
243 void reload(
bool revertToDefaults =
false );
249 void slotItemClicked( TQListViewItem *item,
const TQPoint& point,
251 void slotEventChanged( TQListViewItem * );
252 void soundToggled(
bool on );
253 void loggingToggled(
bool on );
254 void executeToggled(
bool on );
255 void messageBoxChanged();
256 void stderrToggled(
bool on );
257 void taskbarToggled(
bool on );
259 void soundFileChanged(
const TQString& text );
260 void logfileChanged(
const TQString& text );
261 void commandlineChanged(
const TQString& text );
270 void updateWidgets( ListViewItem *item );
271 void updatePixmaps( ListViewItem *item );
273 static TQString makeRelative(
const TQString& );
274 void addToView(
const EventList& events );
275 void widgetChanged( TQListViewItem *item,
276 int what,
bool on, TQWidget *buddy = 0L );
277 void selectItem( TQListViewItem *item );
279 ApplicationList m_visibleApps;
280 ApplicationList m_allApps;
297 friend class Application;
300 TQString text()
const {
return description; }
306 TQString commandline;
308 const Application *application()
const {
return m_app; }
311 Event(
const Application *app ) {
317 TQString description;
318 TQString configGroup;
320 const Application *m_app;
326 class ListViewItem :
public TQListViewItem
329 ListViewItem( TQListView *view, Event *event );
331 Event& event() {
return *m_event; }
332 virtual int compare (TQListViewItem * i,
int col,
bool ascending)
const;
KNotifyDialog presents an interface for configuring an application's KNotify events.
This class is a widget showing a lineedit and a button, which invokes a filedialog.