25 #ifndef __TDESTARTUPINFO_H
26 #define __TDESTARTUPINFO_H
28 #include <sys/types.h>
33 #include <tqcstring.h>
35 #include <tqvaluelist.h>
36 #include "tdelibs_export.h"
38 class TDEStartupInfoId;
39 class TDEStartupInfoData;
41 class TDEStartupInfoPrivate;
63 class TDECORE_EXPORT TDEStartupInfo
77 static void disableAutoAppStartedSending(
bool disable =
true );
86 static void appStarted();
93 static void appStarted(
const TQCString& startup_id );
104 static void setNewStartupId( TQWidget* window,
const TQCString& startup_id );
115 static void silenceStartup(
bool silence );
122 static TQCString createNewStartupId();
127 CleanOnCantDetect = 1 << 0,
128 DisableKWinModule = 1 << 1,
129 AnnounceSilenceChanges = 1 << 2
150 TDEStartupInfo(
int flags, TQObject* parent = NULL,
const char* name = NULL );
162 TDEStartupInfo(
bool clean_on_cantdetect, TQObject* parent = 0,
const char* name = 0 );
163 virtual ~TDEStartupInfo();
176 static bool sendStartup(
const TDEStartupInfoId&
id,
const TDEStartupInfoData& data );
186 static bool sendStartupX( Display* dpy,
const TDEStartupInfoId&
id,
187 const TDEStartupInfoData& data );
199 static bool sendChange(
const TDEStartupInfoId&
id,
const TDEStartupInfoData& data );
208 static bool sendChangeX( Display* dpy,
const TDEStartupInfoId&
id,
209 const TDEStartupInfoData& data );
216 static bool sendFinish(
const TDEStartupInfoId&
id );
224 static bool sendFinishX( Display* dpy,
const TDEStartupInfoId&
id );
233 static bool sendFinish(
const TDEStartupInfoId&
id,
const TDEStartupInfoData& data );
242 static bool sendFinishX( Display* dpy,
const TDEStartupInfoId&
id,
243 const TDEStartupInfoData& data );
251 static TDEStartupInfoId currentStartupIdEnv();
255 static void resetStartupEnv();
262 enum startup_t { NoMatch, Match, CantDetect };
268 startup_t checkStartup( WId w );
276 startup_t checkStartup( WId w, TDEStartupInfoId&
id );
284 startup_t checkStartup( WId w, TDEStartupInfoData& data );
293 startup_t checkStartup( WId w, TDEStartupInfoId&
id, TDEStartupInfoData& data );
298 void setTimeout(
unsigned int secs );
304 static void setWindowStartupId( WId window,
const TQCString&
id );
310 static TQCString windowStartupId( WId w );
314 static void handleAutoAppStartedSending();
326 void gotNewStartup(
const TDEStartupInfoId&
id,
const TDEStartupInfoData& data );
332 void gotStartupChange(
const TDEStartupInfoId&
id,
const TDEStartupInfoData& data );
339 void gotRemoveStartup(
const TDEStartupInfoId&
id,
const TDEStartupInfoData& data );
344 virtual void customEvent( TQCustomEvent* e_P );
346 void startups_cleanup();
347 void startups_cleanup_no_age();
348 void got_message(
const TQString& msg );
349 void window_added( WId w );
350 void slot_window_added( WId w );
352 void init(
int flags );
353 friend class TDEStartupInfoPrivate;
354 void got_startup_info(
const TQString& msg_P,
bool update_only_P );
355 void got_remove_startup_info(
const TQString& msg_P );
356 void new_startup_info_internal(
const TDEStartupInfoId& id_P,
357 Data& data_P,
bool update_only_P );
358 void remove_startup_info_internal(
const TDEStartupInfoId& id_P );
359 void remove_startup_pids(
const TDEStartupInfoId&
id,
const TDEStartupInfoData& data );
360 void remove_startup_pids(
const TDEStartupInfoData& data );
361 startup_t check_startup_internal( WId w, TDEStartupInfoId*
id, TDEStartupInfoData* data );
362 bool find_id(
const TQCString& id_P, TDEStartupInfoId* id_O,
363 TDEStartupInfoData* data_O );
364 bool find_pid( pid_t pid_P,
const TQCString& hostname, TDEStartupInfoId* id_O,
365 TDEStartupInfoData* data_O );
366 bool find_wclass( TQCString res_name_P, TQCString res_class_P,
367 TDEStartupInfoId* id_O, TDEStartupInfoData* data_O );
368 static TQCString get_window_hostname( WId w_P );
369 void startups_cleanup_internal(
bool age_P );
370 void clean_all_noncompliant();
371 static TQString check_required_startup_fields(
const TQString& msg,
372 const TDEStartupInfoData& data,
int screen );
373 bool clean_on_cantdetect_;
374 unsigned int timeout;
375 TDEStartupInfoPrivate* d;
378 class TDEStartupInfoIdPrivate;
391 class TDECORE_EXPORT TDEStartupInfoId
398 bool operator==(
const TDEStartupInfoId&
id )
const;
403 bool operator!=(
const TDEStartupInfoId&
id )
const;
416 void initId(
const TQCString&
id =
"" );
421 const TQCString& id()
const;
427 unsigned long timestamp()
const;
432 bool setupStartupEnv()
const;
440 TDEStartupInfoId(
const TDEStartupInfoId& data );
442 TDEStartupInfoId& operator=(
const TDEStartupInfoId& data );
443 bool operator<(
const TDEStartupInfoId&
id )
const;
445 TDEStartupInfoId(
const TQString& txt );
446 TQString to_text()
const;
447 friend class TDEStartupInfo;
448 TDEStartupInfoIdPrivate* d;
451 class TDEStartupInfoDataPrivate;
464 class TDECORE_EXPORT TDEStartupInfoData
471 void setBin(
const TQString& bin );
476 const TQString& bin()
const;
480 void setName(
const TQString& name );
486 const TQString& findName()
const;
492 const TQString&
name()
const;
499 void setDescription(
const TQString& descr );
506 const TQString& findDescription()
const;
518 void setIcon(
const TQString& icon );
525 const TQString& findIcon()
const;
530 const TQString& icon()
const;
536 void setDesktop(
int desktop );
548 void setWMClass(
const TQCString& wmclass );
555 const TQCString findWMClass()
const;
561 const TQCString& WMClass()
const;
569 void addPid( pid_t pid );
574 const TQValueList< pid_t >& pids()
const;
580 bool is_pid( pid_t pid )
const;
586 void setHostname(
const TQCString& hostname = TQCString());
591 const TQCString& hostname()
const;
596 enum TriState { Yes, No, Unknown };
603 void setSilent( TriState state );
610 TriState silent()
const;
620 void setTimestamp(
unsigned long time );
627 unsigned long timestamp()
const;
638 void setScreen(
int screen );
643 int xinerama()
const;
650 void setXinerama(
int xinerama );
656 WId launchedBy()
const;
662 void setLaunchedBy( WId window );
669 void update(
const TDEStartupInfoData& data );
674 TDEStartupInfoData();
679 TDEStartupInfoData(
const TDEStartupInfoData& data );
680 ~TDEStartupInfoData();
681 TDEStartupInfoData& operator=(
const TDEStartupInfoData& data );
683 TDEStartupInfoData(
const TQString& txt );
684 TQString to_text()
const;
685 void remove_pid( pid_t pid );
686 friend class TDEStartupInfo;
687 friend class TDEStartupInfo::Data;
688 TDEStartupInfoDataPrivate* d;
const char * name(StdAction id)
TQString description(StdAccel id)