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

tdecore

  • tdecore
tdestartupinfo.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 __TDESTARTUPINFO_H
26 #define __TDESTARTUPINFO_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 "tdelibs_export.h"
41 
42 class TDEStartupInfoId;
43 class TDEStartupInfoData;
44 
45 class TDEStartupInfoPrivate;
46 
67 class TDECORE_EXPORT TDEStartupInfo
68  : public TQObject
69  {
70  Q_OBJECT
71 
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  TDEStartupInfo( int flags, TQObject* parent = NULL, const char* name = NULL );
166  TDEStartupInfo( bool clean_on_cantdetect, TQObject* parent = 0, const char* name = 0 );
167  virtual ~TDEStartupInfo();
180  static bool sendStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
181 
190  static bool sendStartupX( Display* dpy, const TDEStartupInfoId& id,
191  const TDEStartupInfoData& data );
192 
203  static bool sendChange( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
204 
212  static bool sendChangeX( Display* dpy, const TDEStartupInfoId& id,
213  const TDEStartupInfoData& data );
214 
220  static bool sendFinish( const TDEStartupInfoId& id );
221 
228  static bool sendFinishX( Display* dpy, const TDEStartupInfoId& id );
229 
237  static bool sendFinish( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
238 
246  static bool sendFinishX( Display* dpy, const TDEStartupInfoId& id,
247  const TDEStartupInfoData& data );
248 
255  static TDEStartupInfoId currentStartupIdEnv();
259  static void resetStartupEnv();
266  enum startup_t { NoMatch, Match, CantDetect };
272  startup_t checkStartup( WId w );
280  startup_t checkStartup( WId w, TDEStartupInfoId& id );
288  startup_t checkStartup( WId w, TDEStartupInfoData& data );
297  startup_t checkStartup( WId w, TDEStartupInfoId& id, TDEStartupInfoData& 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 TDEStartupInfoId& id, const TDEStartupInfoData& data );
336  void gotStartupChange( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
343  void gotRemoveStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& 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 TDEStartupInfoPrivate;
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 TDEStartupInfoId& id_P,
361  Data& data_P, bool update_only_P );
362  void remove_startup_info_internal( const TDEStartupInfoId& id_P );
363  void remove_startup_pids( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
364  void remove_startup_pids( const TDEStartupInfoData& data );
365  startup_t check_startup_internal( WId w, TDEStartupInfoId* id, TDEStartupInfoData* data );
366  bool find_id( const TQCString& id_P, TDEStartupInfoId* id_O,
367  TDEStartupInfoData* data_O );
368  bool find_pid( pid_t pid_P, const TQCString& hostname, TDEStartupInfoId* id_O,
369  TDEStartupInfoData* data_O );
370  bool find_wclass( TQCString res_name_P, TQCString res_class_P,
371  TDEStartupInfoId* id_O, TDEStartupInfoData* 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 TDEStartupInfoData& data, int screen );
377  bool clean_on_cantdetect_; // KDE4 remove unused
378  unsigned int timeout;
379  TDEStartupInfoPrivate* d;
380  };
381 
382 class TDEStartupInfoIdPrivate;
383 
395 class TDECORE_EXPORT TDEStartupInfoId
396  {
397  public:
402  bool operator==( const TDEStartupInfoId& id ) const;
407  bool operator!=( const TDEStartupInfoId& 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  TDEStartupInfoId();
444  TDEStartupInfoId( const TDEStartupInfoId& data );
445  ~TDEStartupInfoId();
446  TDEStartupInfoId& operator=( const TDEStartupInfoId& data );
447  bool operator<( const TDEStartupInfoId& id ) const;
448  private:
449  TDEStartupInfoId( const TQString& txt );
450  TQString to_text() const;
451  friend class TDEStartupInfo;
452  TDEStartupInfoIdPrivate* d;
453  };
454 
455 class TDEStartupInfoDataPrivate;
456 
468 class TDECORE_EXPORT TDEStartupInfoData
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 TDEStartupInfoData& data );
674 
678  TDEStartupInfoData();
679 
683  TDEStartupInfoData( const TDEStartupInfoData& data );
684  ~TDEStartupInfoData();
685  TDEStartupInfoData& operator=( const TDEStartupInfoData& data );
686  private:
687  TDEStartupInfoData( const TQString& txt );
688  TQString to_text() const;
689  void remove_pid( pid_t pid );
690  friend class TDEStartupInfo;
691  friend class TDEStartupInfo::Data;
692  TDEStartupInfoDataPrivate* d;
693  };
694 
695 #endif //Q_WS_X11
696 
697 #endif
TDEStdAccel::description
TQString description(StdAccel id)
Definition: tdestdaccel.cpp:381
KStdAction::name
const char * name(StdAction id)

tdecore

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

tdecore

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