• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libtaskmanager

task.h

Go to the documentation of this file.
00001 /*****************************************************************
00002 
00003 Copyright (c) 2000-2001 Matthias Elter <elter@kde.org>
00004 Copyright (c) 2001 Richard Moore <rich@kde.org>
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining a copy
00007 of this software and associated documentation files (the "Software"), to deal
00008 in the Software without restriction, including without limitation the rights
00009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00010 copies of the Software, and to permit persons to whom the Software is
00011 furnished to do so, subject to the following conditions:
00012 
00013 The above copyright notice and this permission notice shall be included in
00014 all copies or substantial portions of the Software.
00015 
00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00019 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00022 
00023 ******************************************************************/
00024 
00025 #ifndef TASK_H
00026 #define TASK_H
00027 
00028 // Qt
00029 #include <QtGui/QDrag>
00030 #include <QtGui/QPixmap>
00031 #include <QtGui/QWidget>
00032 
00033 // KDE
00034 #include <ksharedptr.h>
00035 #include <kwindowsystem.h>
00036 #include <netwm.h>
00037 
00038 namespace TaskManager
00039 {
00040 
00041 typedef QList<WId> WindowList;
00042 
00043 class Task;
00044 typedef KSharedPtr<Task> TaskPtr;
00045 typedef QVector<TaskPtr> TaskList;
00046 typedef QMap<WId, TaskPtr> TaskDict;
00047 
00053 class KDE_EXPORT Task: public QObject, public KShared
00054 {
00055     Q_OBJECT
00056     Q_PROPERTY( QString visibleName READ visibleName )
00057     Q_PROPERTY( QString name READ name )
00058     Q_PROPERTY( QString className READ className )
00059     Q_PROPERTY( QString visibleNameWithState READ visibleNameWithState )
00060     Q_PROPERTY( QPixmap pixmap READ pixmap )
00061     Q_PROPERTY( bool maximized READ isMaximized )
00062     Q_PROPERTY( bool minimized READ isMinimized )
00063     // KDE4 deprecated
00064     Q_PROPERTY( bool iconified READ isIconified )
00065     Q_PROPERTY( bool shaded READ isShaded WRITE setShaded )
00066     Q_PROPERTY( bool active READ isActive )
00067     Q_PROPERTY( bool onCurrentDesktop READ isOnCurrentDesktop )
00068     Q_PROPERTY( bool onAllDesktops READ isOnAllDesktops )
00069     Q_PROPERTY( bool alwaysOnTop READ isAlwaysOnTop WRITE setAlwaysOnTop )
00070     Q_PROPERTY( bool modified READ isModified )
00071     Q_PROPERTY( bool demandsAttention READ demandsAttention )
00072     Q_PROPERTY( int desktop READ desktop )
00073     Q_PROPERTY( double thumbnailSize READ thumbnailSize WRITE setThumbnailSize )
00074     Q_PROPERTY( bool hasThumbnail READ hasThumbnail )
00075     Q_PROPERTY( QPixmap thumbnail READ thumbnail )
00076 
00077 public:
00078     Task(WId win, QObject *parent, const char *name = 0);
00079     virtual ~Task();
00080 
00081     WId window() const;
00082     KWindowInfo info() const;
00083 
00084     QString visibleName() const;
00085     QString visibleNameWithState() const;
00086     QString name() const;
00087     QString className();
00088     QString classClass();
00089 
00094     WindowList transients() const;
00095 
00101     QPixmap pixmap() const;
00102 
00116     QPixmap bestIcon( int size, bool &isStaticIcon );
00117 
00127     QPixmap icon( int width, int height, bool allowResize = false );
00128 
00133     static bool idMatch(const QString &, const QString &);
00134 
00135     // state
00136 
00140     bool isMaximized() const;
00141 
00145     bool isMinimized() const;
00146 
00151     bool isIconified() const;
00152 
00156     bool isShaded() const;
00157 
00161     bool isActive() const;
00162 
00167     bool isOnTop() const;
00168 
00172     bool isOnCurrentDesktop() const;
00173 
00177     bool isOnAllDesktops() const;
00178 
00183     bool isAlwaysOnTop() const;
00184 
00189     bool isKeptBelowOthers() const;
00190 
00194     bool isFullScreen() const;
00195 
00202     bool isModified() const ;
00203 
00207     int desktop() const;
00208 
00212     bool demandsAttention() const;
00213 
00214 
00218     bool isOnScreen( int screen ) const;
00219 
00223     bool showInTaskbar() const;
00224 
00228     bool showInPager() const;
00229 
00233     QRect geometry() const;
00234 
00235     // internal
00236 
00237     //* @internal
00238     void refresh(unsigned int dirty);
00239     //* @internal
00240     void refreshIcon();
00241     //* @internal
00242     void addTransient( WId w, const NETWinInfo& info );
00243     //* @internal
00244     void removeTransient( WId w );
00245     //* @internal
00246     bool hasTransient(WId w) const;
00247     //* @internal
00248     void updateDemandsAttentionState( WId w );
00249     //* @internal
00250     void setActive(bool a);
00251 
00252     // For thumbnails
00253 
00257     double thumbnailSize() const;
00258 
00264     void setThumbnailSize( double size );
00265 
00270     bool hasThumbnail() const;
00271 
00276     QPixmap thumbnail() const;
00277 
00278     QPixmap thumbnail(int maxDimension);
00279 
00280     void updateWindowPixmap();
00281 
00282 public Q_SLOTS:
00283     // actions
00284 
00288     void setMaximized(bool);
00289     void toggleMaximized();
00290 
00294     void restore();
00295 
00299     void move();
00300 
00304     void resize();
00305 
00309     void setIconified(bool);
00310     void toggleIconified();
00311 
00315     void close();
00316 
00320     void raise();
00321 
00325     void lower();
00326 
00330     void activate();
00331 
00337     void activateRaiseOrIconify();
00338 
00342     void setAlwaysOnTop(bool);
00343     void toggleAlwaysOnTop();
00344 
00348     void setKeptBelowOthers(bool);
00349     void toggleKeptBelowOthers();
00350 
00354     void setFullScreen(bool);
00355     void toggleFullScreen();
00356 
00361     void setShaded(bool);
00362     void toggleShaded();
00363 
00367     void toDesktop(int);
00368 
00372     void toCurrentDesktop();
00373 
00379     void publishIconGeometry(QRect);
00380 
00385     void updateThumbnail();
00386 
00387 Q_SIGNALS:
00391     void changed();
00392 
00396     void iconChanged();
00397 
00401     void activated();
00402 
00406     void deactivated();
00407 
00411     void thumbnailChanged();
00412 
00413 protected Q_SLOTS:
00414     //* @internal
00415     void generateThumbnail();
00416 
00417 protected:
00418     void findWindowFrameId();
00419 
00420 private:
00421     class Private;
00422     Private * const d;
00423 };
00424 
00425 
00431 class KDE_EXPORT TaskDrag : public QDrag
00432 {
00433 public:
00437     explicit TaskDrag(const TaskList& tasks, QWidget* source = 0);
00438     ~TaskDrag();
00439 
00443     static bool canDecode( const QMimeData* e );
00444 
00449     static TaskList decode( const QMimeData* e );
00450 
00451 private:
00452     class Private;
00453     Private * const d;
00454 };
00455 
00456 } // TaskManager namespace
00457 
00458 
00459 #endif

libtaskmanager

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal