• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdefile
 

tdeio/tdefile

  • tdeio
  • tdefile
knotifydialog.h
1/*
2 Copyright (C) 2000,2002 Carsten Pfeiffer <pfeiffer@kde.org>
3 Copyright (C) 2002 Neil Stevens <neil@qualityassistant.com>
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation;
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library, If not, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17*/
18
19#ifndef KNOTIFYDIALOG_H
20#define KNOTIFYDIALOG_H
21
22#include <tdelistview.h>
23#include <kdialogbase.h>
24#include <kinstance.h>
25#include <tdeglobal.h>
26
27#include "knotifywidgetbase.h"
28
29class TQShowEvent;
30
31namespace KNotify
32{
33 class KNotifyWidget;
34}
35
52class TDEIO_EXPORT KNotifyDialog : public KDialogBase
53{
54 TQ_OBJECT
55
56public:
71 KNotifyDialog( TQWidget *parent = 0, const char *name = 0,
72 bool modal = true,
73 const TDEAboutData *aboutData =
74 TDEGlobal::instance()->aboutData() );
78 virtual ~KNotifyDialog();
79
90 static int configure( TQWidget *parent = 0, const char *name = 0,
91 const TDEAboutData *aboutData = TDEGlobal::instance()->aboutData() );
92
102 virtual void addApplicationEvents( const char *appName );
103
113 virtual void addApplicationEvents( const TQString& path );
114
119 virtual void clearApplicationEvents();
120
121private slots:
122 void slotDefault();
123
124private:
125 enum
126 {
127 COL_FILENAME = 1
128 };
129
130 void updateView();
131
132 KNotify::KNotifyWidget * m_notifyWidget;
133
134 class Private;
135 Private *d;
136};
137
138
139namespace KNotify
140{
141 class Application;
142 class Event;
143 class ListViewItem;
144 typedef TQPtrList<Event> EventList;
145 typedef TQPtrListIterator<Application> ApplicationListIterator;
146 typedef TQPtrListIterator<Event> EventListIterator;
147
151 class TDEIO_EXPORT Application
152 {
153 public:
154 Application( const TQString &path );
155 ~Application();
156
157 TQString text() const { return m_description; }
158 TQString icon() const { return m_icon; }
159 const EventList& eventList();
160 void reloadEvents( bool revertToDefaults = false );
161 void save();
162
163 TQString appName() const { return m_appname; }
164
165 private:
166 TQString m_icon;
167 TQString m_description;
168 TQString m_appname;
169 EventList *m_events;
170
171 TDEConfig *kc; // The file that defines the events.
172 TDEConfig *config; // The file that contains the settings for the events
173 };
174
175
176 class TDEIO_EXPORT ApplicationList : public TQPtrList<Application>
177 {
178 virtual int compareItems ( TQPtrCollection::Item item1,
179 TQPtrCollection::Item item2 )
180 {
181 return (static_cast<Application*>( item1 )->text() >=
182 static_cast<Application*>( item2 )->text()) ? 1 : -1;
183 }
184 };
185
189 class TDEIO_EXPORT KNotifyWidget : public KNotifyWidgetBase
190 {
191 TQ_OBJECT
192
193 public:
194 KNotifyWidget( TQWidget* parent = 0, const char* name = 0,
195 bool handleAllApps = false );
196 ~KNotifyWidget();
197
198 TDEListView * eventsView() {
199 return m_listview;
200 }
201
202 void addVisibleApp( Application *app );
203 ApplicationList& visibleApps() { return m_visibleApps; }
204 ApplicationList& allApps() { return m_allApps; }
205
211 Application * addApplicationEvents( const TQString& path );
212
213 void resetDefaults( bool ask );
214 void sort( bool ascending = true );
215
216 public slots:
220 virtual void clear();
226 virtual void clearVisible();
227 virtual void save();
228 virtual void showAdvanced( bool show );
229 void toggleAdvanced();
230
231
232 signals:
233 void changed( bool hasChanges );
234
235 protected:
239 Event * currentEvent();
240 virtual void showEvent( TQShowEvent * );
241 virtual void enableAll( int what, bool enable );
242
243 void reload( bool revertToDefaults = false );
244
245 protected slots:
246 void playSound();
247
248 private slots:
249 void slotItemClicked( TQListViewItem *item, const TQPoint& point,
250 int col );
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 );
258
259 void soundFileChanged( const TQString& text );
260 void logfileChanged( const TQString& text );
261 void commandlineChanged( const TQString& text );
262
263 void openSoundDialog( KURLRequester * );
264 void openLogDialog( KURLRequester * );
265 void openExecDialog( KURLRequester * );
266
267 void enableAll();
268
269 private:
270 void updateWidgets( ListViewItem *item );
271 void updatePixmaps( ListViewItem *item );
272
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 );
278
279 ApplicationList m_visibleApps;
280 ApplicationList m_allApps;
281
282 class Private;
283 Private *d;
284
285 };
286
287
290
291
295 class Event
296 {
297 friend class Application;
298
299 public:
300 TQString text() const { return description; }
301
302 int presentation;
303 int dontShow;
304 TQString logfile;
305 TQString soundfile;
306 TQString commandline;
307
308 const Application *application() const { return m_app; }
309
310 private:
311 Event( const Application *app ) {
312 presentation = 0;
313 dontShow = 0;
314 m_app = app;
315 }
316 TQString name;
317 TQString description;
318 TQString configGroup;
319
320 const Application *m_app;
321 };
322
326 class ListViewItem : public TQListViewItem
327 {
328 public:
329 ListViewItem( TQListView *view, Event *event );
330
331 Event& event() { return *m_event; }
332 virtual int compare (TQListViewItem * i, int col, bool ascending) const;
333
334 private:
335 Event * m_event;
336 };
337
338}
339
340
341#endif
KNotifyDialog
KNotifyDialog presents an interface for configuring an application's KNotify events.
Definition: knotifydialog.h:53
KURLRequester
This class is a widget showing a lineedit and a button, which invokes a filedialog.
Definition: kurlrequester.h:57

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeio/tdefile

Skip menu "tdeio/tdefile"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdefile by doxygen 1.9.4
This website is maintained by Timothy Pearson.