• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • kdecore
kstartupinfo.h
1 /****************************************************************************
2 
3  Copyright (C) 2001-2003 Lubos Lunak <l.lunak@kde.org>
4 
5 Permission is hereby granted, free of charge, to any person obtaining a
6 copy of this software and associated documentation files (the "Software"),
7 to deal in the Software without restriction, including without limitation
8 the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 and/or sell copies of the Software, and to permit persons to whom the
10 Software is furnished to do so, subject to the following conditions:
11 
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14 
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 DEALINGS IN THE SOFTWARE.
22 
23 ****************************************************************************/
24 
25 #ifndef __KSTARTUPINFO_H
26 #define __KSTARTUPINFO_H
27 
28 #include <sys/types.h>
29 #include <tqobject.h>
30 
31 #ifdef Q_MOC_RUN
32 #define Q_WS_X11
33 #endif // Q_MOC_RUN
34 
35 #ifdef Q_WS_X11 // FIXME(E): Redo in a less X11-specific way
36 
37 #include <tqcstring.h>
38 #include <tqstring.h>
39 #include <tqvaluelist.h>
40 #include "kdelibs_export.h"
41 
42 class KStartupInfoId;
43 class KStartupInfoData;
44 
45 class KStartupInfoPrivate;
46 
67 class KDECORE_EXPORT KStartupInfo
68  : public TQObject
69  {
70  Q_OBJECT
71  TQ_OBJECT
72  public:
81  static void disableAutoAppStartedSending( bool disable = true );
82 
90  static void appStarted();
91 
97  static void appStarted( const TQCString& startup_id );
98 
108  static void setNewStartupId( TQWidget* window, const TQCString& startup_id );
109 
119  static void silenceStartup( bool silence );
120 
126  static TQCString createNewStartupId();
130  enum {
131  CleanOnCantDetect = 1 << 0,
132  DisableKWinModule = 1 << 1,
133  AnnounceSilenceChanges = 1 << 2
134  };
135 
154  KStartupInfo( int flags, TQObject* parent = NULL, const char* name = NULL );
166  KStartupInfo( bool clean_on_cantdetect, TQObject* parent = 0, const char* name = 0 );
167  virtual ~KStartupInfo();
180  static bool sendStartup( const KStartupInfoId& id, const KStartupInfoData& data );
181 
190  static bool sendStartupX( Display* dpy, const KStartupInfoId& id,
191  const KStartupInfoData& data );
192 
203  static bool sendChange( const KStartupInfoId& id, const KStartupInfoData& data );
204 
212  static bool sendChangeX( Display* dpy, const KStartupInfoId& id,
213  const KStartupInfoData& data );
214 
220  static bool sendFinish( const KStartupInfoId& id );
221 
228  static bool sendFinishX( Display* dpy, const KStartupInfoId& id );
229 
237  static bool sendFinish( const KStartupInfoId& id, const KStartupInfoData& data );
238 
246  static bool sendFinishX( Display* dpy, const KStartupInfoId& id,
247  const KStartupInfoData& data );
248 
255  static KStartupInfoId currentStartupIdEnv();
259  static void resetStartupEnv();
266  enum startup_t { NoMatch, Match, CantDetect };
272  startup_t checkStartup( WId w );
280  startup_t checkStartup( WId w, KStartupInfoId& id );
288  startup_t checkStartup( WId w, KStartupInfoData& data );
297  startup_t checkStartup( WId w, KStartupInfoId& id, KStartupInfoData& data );
302  void setTimeout( unsigned int secs );
308  static void setWindowStartupId( WId window, const TQCString& id );
314  static TQCString windowStartupId( WId w );
318  static void handleAutoAppStartedSending();
322  class Data;
323  signals:
330  void gotNewStartup( const KStartupInfoId& id, const KStartupInfoData& data );
336  void gotStartupChange( const KStartupInfoId& id, const KStartupInfoData& data );
343  void gotRemoveStartup( const KStartupInfoId& id, const KStartupInfoData& data );
344  protected:
348  virtual void customEvent( TQCustomEvent* e_P );
349  private slots:
350  void startups_cleanup();
351  void startups_cleanup_no_age();
352  void got_message( const TQString& msg );
353  void window_added( WId w );
354  void slot_window_added( WId w );
355  private:
356  void init( int flags );
357  friend class KStartupInfoPrivate;
358  void got_startup_info( const TQString& msg_P, bool update_only_P );
359  void got_remove_startup_info( const TQString& msg_P );
360  void new_startup_info_internal( const KStartupInfoId& id_P,
361  Data& data_P, bool update_only_P );
362  void remove_startup_info_internal( const KStartupInfoId& id_P );
363  void remove_startup_pids( const KStartupInfoId& id, const KStartupInfoData& data );
364  void remove_startup_pids( const KStartupInfoData& data );
365  startup_t check_startup_internal( WId w, KStartupInfoId* id, KStartupInfoData* data );
366  bool find_id( const TQCString& id_P, KStartupInfoId* id_O,
367  KStartupInfoData* data_O );
368  bool find_pid( pid_t pid_P, const TQCString& hostname, KStartupInfoId* id_O,
369  KStartupInfoData* data_O );
370  bool find_wclass( TQCString res_name_P, TQCString res_class_P,
371  KStartupInfoId* id_O, KStartupInfoData* data_O );
372  static TQCString get_window_hostname( WId w_P );
373  void startups_cleanup_internal( bool age_P );
374  void clean_all_noncompliant();
375  static TQString check_required_startup_fields( const TQString& msg,
376  const KStartupInfoData& data, int screen );
377  bool clean_on_cantdetect_; // KDE4 remove unused
378  unsigned int timeout;
379  KStartupInfoPrivate* d;
380  };
381 
382 class KStartupInfoIdPrivate;
383 
395 class KDECORE_EXPORT KStartupInfoId
396  {
397  public:
402  bool operator==( const KStartupInfoId& id ) const;
407  bool operator!=( const KStartupInfoId& id ) const;
412  bool none() const;
420  void initId( const TQCString& id = "" );
425  const TQCString& id() const;
431  unsigned long timestamp() const;
436  bool setupStartupEnv() const;
440  KStartupInfoId();
444  KStartupInfoId( const KStartupInfoId& data );
445  ~KStartupInfoId();
446  KStartupInfoId& operator=( const KStartupInfoId& data );
447  bool operator<( const KStartupInfoId& id ) const;
448  private:
449  KStartupInfoId( const TQString& txt );
450  TQString to_text() const;
451  friend class KStartupInfo;
452  KStartupInfoIdPrivate* d;
453  };
454 
455 class KStartupInfoDataPrivate;
456 
468 class KDECORE_EXPORT KStartupInfoData
469  {
470  public:
475  void setBin( const TQString& bin );
480  const TQString& bin() const;
484  void setName( const TQString& name );
490  const TQString& findName() const;
496  const TQString& name() const;
503  void setDescription( const TQString& descr );
510  const TQString& findDescription() const;
517  const TQString& description() const;
522  void setIcon( const TQString& icon );
529  const TQString& findIcon() const;
534  const TQString& icon() const;
540  void setDesktop( int desktop );
545  int desktop() const;
552  void setWMClass( const TQCString& wmclass );
559  const TQCString findWMClass() const;
565  const TQCString& WMClass() const;
573  void addPid( pid_t pid );
578  const TQValueList< pid_t >& pids() const;
584  bool is_pid( pid_t pid ) const;
590  void setHostname( const TQCString& hostname = TQCString());
595  const TQCString& hostname() const;
596 
600  enum TriState { Yes, No, Unknown };
601 
607  void setSilent( TriState state );
608 
614  TriState silent() const;
615 
624  void setTimestamp( unsigned long time );
625 
631  unsigned long timestamp() const;
632 
636  int screen() const;
637 
642  void setScreen( int screen );
643 
647  int xinerama() const;
648 
654  void setXinerama( int xinerama );
655 
660  WId launchedBy() const;
661 
666  void setLaunchedBy( WId window );
667 
673  void update( const KStartupInfoData& data );
674 
678  KStartupInfoData();
679 
683  KStartupInfoData( const KStartupInfoData& data );
684  ~KStartupInfoData();
685  KStartupInfoData& operator=( const KStartupInfoData& data );
686  private:
687  KStartupInfoData( const TQString& txt );
688  TQString to_text() const;
689  void remove_pid( pid_t pid );
690  friend class KStartupInfo;
691  friend class KStartupInfo::Data;
692  KStartupInfoDataPrivate* d;
693  };
694 
695 #endif //Q_WS_X11
696 
697 #endif
KStdAccel::description
TQString description(StdAccel id)
Definition: kstdaccel.cpp:381
KStdAction::name
const char * name(StdAction id)

kdecore

Skip menu "kdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.6
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |