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

Plasma

desktoplayout.h

Go to the documentation of this file.
00001 /*
00002   Copyright (c) 2008 Ambroz Bizjak <ambro@b4ever.net>
00003 
00004   This program is free software; you can redistribute it and/or modify
00005   it under the terms of the GNU General Public License as published by
00006   the Free Software Foundation; either version 2 of the License, or
00007   (at your option) any later version.
00008 */
00009 
00010 #ifndef _DESKTOPLAYOUT_H
00011 #define _DESKTOPLAYOUT_H
00012 
00013 #include <QGraphicsLayout>
00014 #include <QHash>
00015 #include <QMap>
00016 #include <QList>
00017 #include <QObject>
00018 
00019 #include "itemspace.h"
00020 
00021 class QGraphicsItem;
00022 
00023 class DesktopLayout : public QObject, public QGraphicsLayout
00024 {
00025     Q_OBJECT
00026 
00027 public:
00028     DesktopLayout (QGraphicsLayoutItem *parent = 0);
00029 
00041     void addItem(QGraphicsLayoutItem *item, bool pushBack = true, const QSizeF &size = QSizeF());
00042 
00046     void addItem(QGraphicsLayoutItem *item, bool pushBack, const QRectF &preferredGeom, const QRectF &lastGeom = QRectF());
00047 
00048     bool getPushBack(int index);
00049     QRectF getPreferredGeometry(int index);
00050     QRectF getLastGeometry(int index);
00051 
00056     void setPlacementSpacing(qreal spacing);
00057 
00063     void setScreenSpacing(qreal spacing);
00064 
00068     void setShiftingSpacing(qreal spacing);
00069 
00074     void setVisibilityTolerance(qreal part);
00075 
00081     void setAutoWorkingArea(bool value);
00082 
00088     void setWorkingArea(QRectF area);
00089 
00097     void setAlignment(Qt::Alignment alignment);
00098 
00102     void setTemporaryPlacement(bool enabled);
00103 
00109     void itemGeometryChanged(QGraphicsLayoutItem *layoutItem);
00110 
00111     // inherited from QGraphicsLayout
00112     int count() const;
00113     QGraphicsLayoutItem *itemAt(int index) const;
00114     void removeAt(int index);
00115 
00116     // inherited from QGraphicsLayoutItem
00117     void setGeometry(const QRectF &rect);
00118     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
00119 
00120 private slots:
00121     void movementFinished(QGraphicsItem*);
00122 
00123 private:
00124 
00125     class DesktopLayoutItem
00126     {
00127       public:
00128         QGraphicsLayoutItem *item;
00129         QRectF temporaryGeometry;
00130     };
00131 
00132     int newItemKey();
00133 
00134     // layout status
00135 
00141     ItemSpace itemSpace;
00142 
00147     QMap<int, DesktopLayoutItem> items;
00148 
00149     QHash<QGraphicsItem*, int> m_animatingItems;
00150     QPointF workingStart;
00151 
00152     // layout configuration
00153 
00154     bool autoWorkingArea;
00155     bool temporaryPlacement;
00156 
00157     qreal visibilityTolerance;
00158 
00159     // item manipulation functions
00160     void performTemporaryPlacement(int group, int itemInGroup);
00161     void revertTemporaryPlacement(int group, int itemInGroup);
00162 
00163     bool m_activated;
00164 };
00165 
00166 #endif

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
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