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

libplasma

Plasma::Layout

Plasma::Layout Class Reference

#include <layout.h>

Inheritance diagram for Plasma::Layout:

Inheritance graph
[legend]

List of all members.


Detailed Description

Base class for Plasma Layout managers.

Author:
Matias Valdenegro T. <mvaldenegro@informatica.utem.cl>
All layout managers must implement this class. Normal users should use the specific layouts, like Plasma::VBoxLayout, Plasma::HBoxLayout and Plasma::GridLayout.

Definition at line 45 of file layout.h.


Public Member Functions

 Layout (LayoutItem *parent)
virtual ~Layout ()
qreal margin (Plasma::MarginEdge edge) const
void setMargin (Plasma::MarginEdge edge, qreal m)
void setMargin (qreal m)
qreal spacing () const
void setSpacing (qreal s)
LayoutItem * parent () const
void setParent (LayoutItem *parent)
virtual int count () const =0
bool isEmpty () const
virtual void addItem (LayoutItem *l)=0
virtual void removeItem (LayoutItem *l)=0
virtual int indexOf (LayoutItem *l) const =0
virtual LayoutItem * itemAt (int i) const =0
virtual LayoutItem * takeAt (int i)=0
virtual LayoutAnimator * animator () const
virtual void setAnimator (LayoutAnimator *animator)
virtual QRectF geometry () const
void setGeometry (const QRectF &geometry)
void updateGeometry ()
virtual QSizeF minimumSize () const
virtual QSizeF maximumSize () const
void invalidate ()

Protected Member Functions

virtual void relayout ()=0
void startAnimation ()

Constructor & Destructor Documentation

Plasma::Layout::Layout ( LayoutItem *  parent  )  [explicit]

Constructor.

Definition at line 67 of file layout.cpp.

Plasma::Layout::~Layout (  )  [virtual]

Virtual Destructor.

Definition at line 80 of file layout.cpp.


Member Function Documentation

qreal Plasma::Layout::margin ( Plasma::MarginEdge  edge  )  const

Returns the margin of this Layout.

Definition at line 152 of file layout.cpp.

void Plasma::Layout::setMargin ( Plasma::MarginEdge  edge,
qreal  m 
)

Sets the margin of this Layout.

Definition at line 172 of file layout.cpp.

void Plasma::Layout::setMargin ( qreal  m  ) 

Sets all the margins of this Layout.

Definition at line 190 of file layout.cpp.

qreal Plasma::Layout::spacing (  )  const

Returns the spacing between Layout elements of this Layout.

Definition at line 198 of file layout.cpp.

void Plasma::Layout::setSpacing ( qreal  s  ) 

Sets the spacing of this Layout.

Definition at line 203 of file layout.cpp.

LayoutItem * Plasma::Layout::parent (  )  const

Returns the parent of this Layout.

Definition at line 208 of file layout.cpp.

void Plasma::Layout::setParent ( LayoutItem *  parent  ) 

Sets the parent of this layout.

Definition at line 76 of file layout.cpp.

virtual int Plasma::Layout::count (  )  const [pure virtual]

Returns the number of elements of this Layout.

Implemented in Plasma::BorderLayout, Plasma::BoxLayout, Plasma::FlowLayout, Plasma::FreeLayout, and Plasma::NodeLayout.

bool Plasma::Layout::isEmpty (  )  const

Returns true if this Layout contains no elements, false otherwise.

Definition at line 85 of file layout.cpp.

virtual void Plasma::Layout::addItem ( LayoutItem *  l  )  [pure virtual]

Adds a Item to this Layout.

Parameters:
l Pointer to the Item to be added.

Implemented in Plasma::BorderLayout, Plasma::BoxLayout, Plasma::FlowLayout, Plasma::FreeLayout, and Plasma::NodeLayout.

virtual void Plasma::Layout::removeItem ( LayoutItem *  l  )  [pure virtual]

Removes a Item from this Layout.

Parameters:
l Pointer to the Item to be removed.

Implemented in Plasma::BorderLayout, Plasma::BoxLayout, Plasma::FlowLayout, Plasma::FreeLayout, and Plasma::NodeLayout.

virtual int Plasma::Layout::indexOf ( LayoutItem *  l  )  const [pure virtual]

Returns the index of a Item in this Layout.

Parameters:
l Pointer to an Item to be queryed.

Implemented in Plasma::BorderLayout, Plasma::BoxLayout, Plasma::FlowLayout, Plasma::FreeLayout, and Plasma::NodeLayout.

virtual LayoutItem* Plasma::Layout::itemAt ( int  i  )  const [pure virtual]

Returns a Pointer to an Item in this Layout.

Parameters:
i Index of the desired Item.

Implemented in Plasma::BorderLayout, Plasma::BoxLayout, Plasma::FlowLayout, Plasma::FreeLayout, and Plasma::NodeLayout.

virtual LayoutItem* Plasma::Layout::takeAt ( int  i  )  [pure virtual]

Takes the Pointer of an Item in this Layout.

Parameters:
i Index of the desired Item.

Implemented in Plasma::BorderLayout, Plasma::BoxLayout, Plasma::FlowLayout, Plasma::FreeLayout, and Plasma::NodeLayout.

LayoutAnimator * Plasma::Layout::animator (  )  const [virtual]

Returns the object controlling animation of changes in this layout or 0 if no animator has been set.

Definition at line 142 of file layout.cpp.

void Plasma::Layout::setAnimator ( LayoutAnimator *  animator  )  [virtual]

Sets the object controlling animation of changes in this layout.

Reimplemented in Plasma::BoxLayout.

Definition at line 147 of file layout.cpp.

QRectF Plasma::Layout::geometry (  )  const [virtual]

Returns the current geometry for this layout.

Implements Plasma::LayoutItem.

Reimplemented in Plasma::FreeLayout.

Definition at line 101 of file layout.cpp.

void Plasma::Layout::setGeometry ( const QRectF &  geometry  )  [virtual]

Changes the geometry of this layout.

Implements Plasma::LayoutItem.

Definition at line 106 of file layout.cpp.

void Plasma::Layout::updateGeometry (  )  [virtual]

Triggers an update of the layout.

Implements Plasma::LayoutItem.

Definition at line 90 of file layout.cpp.

QSizeF Plasma::Layout::minimumSize (  )  const [virtual]

Returns the minimum size of this layout.

The default implementation allows unlimited resizing.

Implements Plasma::LayoutItem.

Reimplemented in Plasma::BoxLayout.

Definition at line 213 of file layout.cpp.

QSizeF Plasma::Layout::maximumSize (  )  const [virtual]

Returns the maximum size of this layout.

The default implementation allows unlimited resizing.

Implements Plasma::LayoutItem.

Reimplemented in Plasma::BoxLayout.

Definition at line 217 of file layout.cpp.

void Plasma::Layout::invalidate (  ) 

TODO Document me.

Definition at line 116 of file layout.cpp.

virtual void Plasma::Layout::relayout (  )  [protected, pure virtual]

Triggers a layout, usually after a change in geometry.

Implemented in Plasma::BorderLayout, Plasma::BoxLayout, Plasma::FlowLayout, Plasma::FreeLayout, and Plasma::NodeLayout.

void Plasma::Layout::startAnimation (  )  [protected]

Starts a layout animation.

Subclasses may call this at the end of their relayout() implementation to start the timeline associated with the layout's animator() if there is one. If an animation is already in progress then the timeline is reset to 0ms and the animation continues.

Definition at line 222 of file layout.cpp.


The documentation for this class was generated from the following files:
  • layout.h
  • layout.cpp

libplasma

Skip menu "libplasma"
  • 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
  • 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