• 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 TQ_WS_X11 // FIXME(E): Redo in a less X11-specific way
32 
33 #include <tqcstring.h>
34 #include <tqstring.h>
35 #include <tqvaluelist.h>
36 #include "tdelibs_export.h"
37 
38 class TDEStartupInfoId;
39 class TDEStartupInfoData;
40 
41 class TDEStartupInfoPrivate;
42 
63 class TDECORE_EXPORT TDEStartupInfo
64  : public TQObject
65  {
66  TQ_OBJECT
67 
68  public:
77  static void disableAutoAppStartedSending( bool disable = true );
78 
86  static void appStarted();
87 
93  static void appStarted( const TQCString& startup_id );
94 
104  static void setNewStartupId( TQWidget* window, const TQCString& startup_id );
105 
115  static void silenceStartup( bool silence );
116 
122  static TQCString createNewStartupId();
126  enum {
127  CleanOnCantDetect = 1 << 0,
128  DisableKWinModule = 1 << 1,
129  AnnounceSilenceChanges = 1 << 2
130  };
131 
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 );
177 
186  static bool sendStartupX( Display* dpy, const TDEStartupInfoId& id,
187  const TDEStartupInfoData& data );
188 
199  static bool sendChange( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
200 
208  static bool sendChangeX( Display* dpy, const TDEStartupInfoId& id,
209  const TDEStartupInfoData& data );
210 
216  static bool sendFinish( const TDEStartupInfoId& id );
217 
224  static bool sendFinishX( Display* dpy, const TDEStartupInfoId& id );
225 
233  static bool sendFinish( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
234 
242  static bool sendFinishX( Display* dpy, const TDEStartupInfoId& id,
243  const TDEStartupInfoData& data );
244 
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();
318  class Data;
319  signals:
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 );
340  protected:
344  virtual void customEvent( TQCustomEvent* e_P );
345  private slots:
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 );
351  private:
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_; // KDE4 remove unused
374  unsigned int timeout;
375  TDEStartupInfoPrivate* d;
376  };
377 
378 class TDEStartupInfoIdPrivate;
379 
391 class TDECORE_EXPORT TDEStartupInfoId
392  {
393  public:
398  bool operator==( const TDEStartupInfoId& id ) const;
403  bool operator!=( const TDEStartupInfoId& id ) const;
408  bool none() const;
416  void initId( const TQCString& id = "" );
421  const TQCString& id() const;
427  unsigned long timestamp() const;
432  bool setupStartupEnv() const;
436  TDEStartupInfoId();
440  TDEStartupInfoId( const TDEStartupInfoId& data );
441  ~TDEStartupInfoId();
442  TDEStartupInfoId& operator=( const TDEStartupInfoId& data );
443  bool operator<( const TDEStartupInfoId& id ) const;
444  private:
445  TDEStartupInfoId( const TQString& txt );
446  TQString to_text() const;
447  friend class TDEStartupInfo;
448  TDEStartupInfoIdPrivate* d;
449  };
450 
451 class TDEStartupInfoDataPrivate;
452 
464 class TDECORE_EXPORT TDEStartupInfoData
465  {
466  public:
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;
513  const TQString& description() const;
518  void setIcon( const TQString& icon );
525  const TQString& findIcon() const;
530  const TQString& icon() const;
536  void setDesktop( int desktop );
541  int desktop() const;
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;
592 
596  enum TriState { Yes, No, Unknown };
597 
603  void setSilent( TriState state );
604 
610  TriState silent() const;
611 
620  void setTimestamp( unsigned long time );
621 
627  unsigned long timestamp() const;
628 
632  int screen() const;
633 
638  void setScreen( int screen );
639 
643  int xinerama() const;
644 
650  void setXinerama( int xinerama );
651 
656  WId launchedBy() const;
657 
662  void setLaunchedBy( WId window );
663 
669  void update( const TDEStartupInfoData& data );
670 
674  TDEStartupInfoData();
675 
679  TDEStartupInfoData( const TDEStartupInfoData& data );
680  ~TDEStartupInfoData();
681  TDEStartupInfoData& operator=( const TDEStartupInfoData& data );
682  private:
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;
689  };
690 
691 #endif //TQ_WS_X11
692 
693 #endif
KStdAction::name
const char * name(StdAction id)
TDEStdAccel::description
TQString description(StdAccel id)
Definition: tdestdaccel.cpp:381

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
  • 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 tdecore by doxygen 1.9.1
This website is maintained by Timothy Pearson.