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

tdecore

tdestartupinfo.h
00001 /****************************************************************************
00002 
00003  Copyright (C) 2001-2003 Lubos Lunak        <l.lunak@kde.org>
00004 
00005 Permission is hereby granted, free of charge, to any person obtaining a
00006 copy of this software and associated documentation files (the "Software"),
00007 to deal in the Software without restriction, including without limitation
00008 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00009 and/or sell copies of the Software, and to permit persons to whom the
00010 Software is furnished to do so, subject to the following conditions:
00011 
00012 The above copyright notice and this permission notice shall be included in
00013 all copies or substantial portions of the Software.
00014 
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00018 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00020 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00021 DEALINGS IN THE SOFTWARE.
00022 
00023 ****************************************************************************/
00024 
00025 #ifndef __TDESTARTUPINFO_H
00026 #define __TDESTARTUPINFO_H
00027 
00028 #include <sys/types.h>
00029 #include <tqobject.h>
00030 
00031 #ifdef Q_MOC_RUN
00032 #define Q_WS_X11
00033 #endif // Q_MOC_RUN
00034 
00035 #ifdef Q_WS_X11 // FIXME(E): Redo in a less X11-specific way
00036 
00037 #include <tqcstring.h>
00038 #include <tqstring.h>
00039 #include <tqvaluelist.h>
00040 #include "tdelibs_export.h"
00041 
00042 class TDEStartupInfoId;
00043 class TDEStartupInfoData;
00044 
00045 class TDEStartupInfoPrivate;
00046 
00067 class TDECORE_EXPORT TDEStartupInfo
00068     : public TQObject
00069     {
00070     Q_OBJECT
00071     
00072     public:
00081         static void disableAutoAppStartedSending( bool disable = true );
00082 
00090         static void appStarted();
00091 
00097         static void appStarted( const TQCString& startup_id );
00098         
00108         static void setNewStartupId( TQWidget* window, const TQCString& startup_id );
00109 
00119         static void silenceStartup( bool silence );
00120 
00126         static TQCString createNewStartupId();
00130     enum {
00131         CleanOnCantDetect       = 1 << 0,
00132         DisableKWinModule       = 1 << 1,
00133         AnnounceSilenceChanges  = 1 << 2
00134         };
00135     
00154     TDEStartupInfo( int flags, TQObject* parent = NULL, const char* name = NULL );
00166         TDEStartupInfo( bool clean_on_cantdetect, TQObject* parent = 0, const char* name = 0 );
00167         virtual ~TDEStartupInfo();
00180         static bool sendStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
00181 
00190         static bool sendStartupX( Display* dpy, const TDEStartupInfoId& id,
00191             const TDEStartupInfoData& data );
00192 
00203         static bool sendChange( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
00204 
00212         static bool sendChangeX( Display* dpy, const TDEStartupInfoId& id,
00213             const TDEStartupInfoData& data );
00214 
00220         static bool sendFinish( const TDEStartupInfoId& id );
00221 
00228         static bool sendFinishX( Display* dpy, const TDEStartupInfoId& id );
00229 
00237         static bool sendFinish( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
00238 
00246         static bool sendFinishX( Display* dpy, const TDEStartupInfoId& id,
00247             const TDEStartupInfoData& data );
00248 
00255         static TDEStartupInfoId currentStartupIdEnv();
00259         static void resetStartupEnv();
00266         enum startup_t { NoMatch, Match, CantDetect };
00272         startup_t checkStartup( WId w );
00280         startup_t checkStartup( WId w, TDEStartupInfoId& id );
00288         startup_t checkStartup( WId w, TDEStartupInfoData& data );
00297         startup_t checkStartup( WId w, TDEStartupInfoId& id, TDEStartupInfoData& data );
00302         void setTimeout( unsigned int secs );
00308         static void setWindowStartupId( WId window, const TQCString& id );
00314         static TQCString windowStartupId( WId w );
00318         static void handleAutoAppStartedSending();
00322         class Data;
00323     signals:
00330         void gotNewStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
00336         void gotStartupChange( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
00343         void gotRemoveStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
00344     protected:
00348     virtual void customEvent( TQCustomEvent* e_P );
00349     private slots:
00350         void startups_cleanup();
00351         void startups_cleanup_no_age();
00352         void got_message( const TQString& msg );
00353         void window_added( WId w );
00354     void slot_window_added( WId w );
00355     private:
00356         void init( int flags );
00357         friend class TDEStartupInfoPrivate;
00358         void got_startup_info( const TQString& msg_P, bool update_only_P );
00359         void got_remove_startup_info( const TQString& msg_P );
00360         void new_startup_info_internal( const TDEStartupInfoId& id_P,
00361             Data& data_P, bool update_only_P );
00362         void remove_startup_info_internal( const TDEStartupInfoId& id_P );
00363         void remove_startup_pids( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
00364         void remove_startup_pids( const TDEStartupInfoData& data );
00365         startup_t check_startup_internal( WId w, TDEStartupInfoId* id, TDEStartupInfoData* data );
00366         bool find_id( const TQCString& id_P, TDEStartupInfoId* id_O,
00367             TDEStartupInfoData* data_O );
00368         bool find_pid( pid_t pid_P, const TQCString& hostname, TDEStartupInfoId* id_O,
00369             TDEStartupInfoData* data_O );
00370         bool find_wclass( TQCString res_name_P, TQCString res_class_P,
00371             TDEStartupInfoId* id_O, TDEStartupInfoData* data_O );
00372         static TQCString get_window_hostname( WId w_P );
00373         void startups_cleanup_internal( bool age_P );
00374         void clean_all_noncompliant();
00375         static TQString check_required_startup_fields( const TQString& msg,
00376             const TDEStartupInfoData& data, int screen );
00377         bool clean_on_cantdetect_; // KDE4 remove unused
00378         unsigned int timeout;
00379         TDEStartupInfoPrivate* d;
00380     };
00381 
00382 class TDEStartupInfoIdPrivate;
00383 
00395 class TDECORE_EXPORT TDEStartupInfoId
00396     {
00397     public:
00402         bool operator==( const TDEStartupInfoId& id ) const;
00407         bool operator!=( const TDEStartupInfoId& id ) const;
00412         bool none() const;
00420         void initId( const TQCString& id = "" );
00425         const TQCString& id() const;
00431         unsigned long timestamp() const;
00436         bool setupStartupEnv() const;
00440         TDEStartupInfoId();
00444         TDEStartupInfoId( const TDEStartupInfoId& data );
00445         ~TDEStartupInfoId();
00446         TDEStartupInfoId& operator=( const TDEStartupInfoId& data );
00447         bool operator<( const TDEStartupInfoId& id ) const;
00448     private:
00449         TDEStartupInfoId( const TQString& txt );
00450         TQString to_text() const;
00451         friend class TDEStartupInfo;
00452         TDEStartupInfoIdPrivate* d;
00453     };
00454 
00455 class TDEStartupInfoDataPrivate;
00456 
00468 class TDECORE_EXPORT TDEStartupInfoData
00469     {
00470     public:
00475         void setBin( const TQString& bin );
00480         const TQString& bin() const;
00484         void setName( const TQString& name );
00490         const TQString& findName() const;
00496         const TQString& name() const;
00503         void setDescription( const TQString& descr );
00510         const TQString& findDescription() const;
00517         const TQString& description() const;
00522         void setIcon( const TQString& icon );
00529         const TQString& findIcon() const;
00534         const TQString& icon() const;
00540         void setDesktop( int desktop );
00545         int desktop() const;
00552         void setWMClass( const TQCString& wmclass );
00559         const TQCString findWMClass() const;
00565         const TQCString& WMClass() const;
00573         void addPid( pid_t pid );
00578         const TQValueList< pid_t >& pids() const;
00584         bool is_pid( pid_t pid ) const;
00590         void setHostname( const TQCString& hostname = TQCString());
00595         const TQCString& hostname() const;
00596     
00600     enum TriState { Yes, No, Unknown };
00601     
00607     void setSilent( TriState state );
00608     
00614     TriState silent() const;
00615         
00624         void setTimestamp( unsigned long time );
00625         
00631         unsigned long timestamp() const;
00632         
00636         int screen() const;
00637         
00642         void setScreen( int screen );
00643         
00647         int xinerama() const;
00648 
00654         void setXinerama( int xinerama );
00655 
00660         WId launchedBy() const;
00661         
00666         void setLaunchedBy( WId window );
00667 
00673         void update( const TDEStartupInfoData& data );
00674 
00678         TDEStartupInfoData();
00679 
00683         TDEStartupInfoData( const TDEStartupInfoData& data );
00684         ~TDEStartupInfoData();
00685         TDEStartupInfoData& operator=( const TDEStartupInfoData& data );
00686     private:
00687         TDEStartupInfoData( const TQString& txt );
00688         TQString to_text() const;
00689         void remove_pid( pid_t pid );
00690         friend class TDEStartupInfo;
00691         friend class TDEStartupInfo::Data;
00692         TDEStartupInfoDataPrivate* d;
00693     };
00694 
00695 #endif //Q_WS_X11
00696 
00697 #endif

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.7.6.1
This website is maintained by Timothy Pearson.