• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeplasma-addons API Reference
  • KDE Home
  • Contact Us
 

GroupingDesktop

Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
AbstractGroup Class Referenceabstract

#include <abstractgroup.h>

Inheritance diagram for AbstractGroup:
Inheritance graph
[legend]

Public Types

enum  { Type = UserType + 2 }
 
enum  BackgroundHint { NoBackground = 0, StandardBackground = 1, PlainBackground = 2 }
 
enum  GroupType { ConstrainedGroup = 0, FreeGroup = 1 }
 

Public Slots

void setImmutability (Plasma::ImmutabilityType immutability)
 
virtual void showConfigurationInterface ()
 

Signals

void appletAddedInGroup (Plasma::Applet *applet, AbstractGroup *group)
 
void appletRemovedFromGroup (Plasma::Applet *applet, AbstractGroup *group)
 
void configNeedsSaving ()
 
void geometryChanged ()
 
void groupDestroyed (AbstractGroup *group)
 
void groupTransformedByUser ()
 
void immutabilityChanged (Plasma::ImmutabilityType immutability)
 
void subGroupAddedInGroup (AbstractGroup *subGroup, AbstractGroup *group)
 
void subGroupRemovedFromGroup (AbstractGroup *subGroup, AbstractGroup *group)
 

Public Member Functions

 AbstractGroup (QGraphicsItem *parent=0, Qt::WindowFlags wFlags=0)
 
virtual ~AbstractGroup ()
 
void addApplet (Plasma::Applet *applet, bool layoutApplet=true)
 
void addSubGroup (AbstractGroup *group, bool layoutGroup=true)
 
Plasma::Applet::List applets () const
 
BackgroundHints backgroundHints () const
 
QList< QGraphicsWidget * > children () const
 
KConfigGroup config () const
 
GroupingContainment * containment () const
 
virtual void createConfigurationInterface (KConfigDialog *parent)
 
virtual Handle * createHandleForChild (QGraphicsWidget *child)
 
void destroy ()
 
GroupType groupType () const
 
bool hasConfigurationInterface () const
 
uint id () const
 
Plasma::ImmutabilityType immutability () const
 
virtual void init ()
 
bool isMainGroup () const
 
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 
AbstractGroup * parentGroup () const
 
virtual QString pluginName () const =0
 
void raise ()
 
virtual void releaseChild (QGraphicsWidget *child)
 
void removeApplet (Plasma::Applet *applet, AbstractGroup *newGroup=0)
 
void removeSubGroup (AbstractGroup *group, AbstractGroup *newGroup=0)
 
virtual void restore (KConfigGroup &group)
 
virtual void restoreChildGroupInfo (QGraphicsWidget *child, const KConfigGroup &group)=0
 
virtual void restoreChildren ()
 
virtual void save (KConfigGroup &group) const
 
virtual void saveChildGroupInfo (QGraphicsWidget *child, KConfigGroup config) const =0
 
virtual void saveChildren () const
 
void setBackgroundHints (BackgroundHints hint)
 
void setIsMainGroup ()
 
virtual bool showDropZone (const QPointF &pos)
 
QList< AbstractGroup * > subGroups () const
 
virtual int type () const
 
void updateConstraints (Plasma::Constraints constraints=Plasma::AllConstraints)
 
bool useSimplerBackgroundForChildren () const
 
QGraphicsView * view () const
 

Static Public Member Functions

static QStringList availableGroups ()
 
static GroupInfo groupInfo (const QString &name)
 
static AbstractGroup * load (const QString &name, QGraphicsItem *parent=0)
 
static QString mimeType ()
 

Protected Member Functions

virtual void constraintsEvent (Plasma::Constraints constraints)
 
virtual void dragLeaveEvent (QGraphicsSceneDragDropEvent *event)
 
virtual QVariant itemChange (GraphicsItemChange change, const QVariant &value)
 
virtual void layoutChild (QGraphicsWidget *child, const QPointF &pos)=0
 
virtual void resizeEvent (QGraphicsSceneResizeEvent *event)
 
void setGroupType (GroupType type)
 
void setHasConfigurationInterface (bool hasInterface)
 
void setUseSimplerBackgroundForChildren (bool use)
 

Properties

GroupType groupType
 
bool hasInterface
 
uint id
 
bool isMainGroup
 

Detailed Description

The base Group class.

AbstractGroup is a base class for special widgets thoughts to contain Plasma::Applet

Definition at line 43 of file abstractgroup.h.

Member Enumeration Documentation

anonymous enum

Reimplemented from QGraphicsItem.

Enumerator
Type 

Definition at line 326 of file abstractgroup.h.

enum AbstractGroup::BackgroundHint

Description on how draw a background for the group.

Enumerator
NoBackground 

Don't draw anything.

StandardBackground 

Draw the translucent background from the theme.

PlainBackground 

Draw a plain, simpler background.

Definition at line 65 of file abstractgroup.h.

enum AbstractGroup::GroupType

Defines if the applets inside the group can be freely transformed or not by the user.

Enumerator
ConstrainedGroup 

The transformations of the applet are constrained by, e.g.

a layout

FreeGroup 

The applets can be freely transformed.

Definition at line 55 of file abstractgroup.h.

Constructor & Destructor Documentation

AbstractGroup::AbstractGroup ( QGraphicsItem *  parent = 0,
Qt::WindowFlags  wFlags = 0 
)
explicit

Constructor of the abstract class.

Definition at line 259 of file abstractgroup.cpp.

AbstractGroup::~AbstractGroup ( )
virtual

Default destructor.

Definition at line 272 of file abstractgroup.cpp.

Member Function Documentation

void AbstractGroup::addApplet ( Plasma::Applet *  applet,
bool  layoutApplet = true 
)

Adds an Applet to this Group.

Parameters
appletthe Applet to be managed by this
layoutAppletthe parameter that defines if layoutChild(applet) will be called
See also
applets
removeApplet

Definition at line 317 of file abstractgroup.cpp.

void AbstractGroup::addSubGroup ( AbstractGroup *  group,
bool  layoutGroup = true 
)

Adds a Group to this Group.

Parameters
group,theGroup to be managed by this
layoutGroupthe parameter that defines if layoutChild(applet) will be called
See also
subGroups
removeSubGroup

Definition at line 359 of file abstractgroup.cpp.

void AbstractGroup::appletAddedInGroup ( Plasma::Applet *  applet,
AbstractGroup *  group 
)
signal

Emitted when an Applet is assigned to this Group.

Parameters
appleta pointer to the Applet added
groupa pointer to this Group
See also
subGroupAddedInGroup
void AbstractGroup::appletRemovedFromGroup ( Plasma::Applet *  applet,
AbstractGroup *  group 
)
signal

Emitted when an Applet is removed from this Group.

Parameters
appleta pointer to the Applet removed
groupa pointer to this Group
See also
subGroupRemovedFromGroup
Plasma::Applet::List AbstractGroup::applets ( ) const

Returns a list of the applets managed by this Group.

See also
addApplet
removeApplet

Definition at line 402 of file abstractgroup.cpp.

QStringList AbstractGroup::availableGroups ( )
static

Returns a list of all identifiers of the available Groups.

Definition at line 844 of file abstractgroup.cpp.

AbstractGroup::BackgroundHints AbstractGroup::backgroundHints ( ) const

Returns the BackgroundHints set for this Group.

See also
setBackgroundHints
BackGroundHint

Definition at line 684 of file abstractgroup.cpp.

QList< QGraphicsWidget * > AbstractGroup::children ( ) const

Returns a list of all the children managed by this Group.

See also
applets
subGroups

Definition at line 412 of file abstractgroup.cpp.

KConfigGroup AbstractGroup::config ( ) const

Returns the KConfigGroup to access the Group configuration.

Definition at line 541 of file abstractgroup.cpp.

void AbstractGroup::configNeedsSaving ( )
signal

Emitted when a Group has changed values in its configuration and wishes for them to be saved at the next save point.

As this implies disk activity, this signal should be used with care.

void AbstractGroup::constraintsEvent ( Plasma::Constraints  constraints)
protectedvirtual

Called when any of the geometry constraints have been updated.

Parameters
constraintsthe type of constraints that were updated

Definition at line 727 of file abstractgroup.cpp.

GroupingContainment * AbstractGroup::containment ( ) const

Returns a pointer to the containment this Group is displayed in.

Definition at line 524 of file abstractgroup.cpp.

void AbstractGroup::createConfigurationInterface ( KConfigDialog *  parent)
virtual

Reimplement this method to provide a configuration interface, parented to the supplied widget.

Ownership of the widgets is passed to the parent widget.

Parameters
parentthe dialog which is the parent of the configuration widgets

Definition at line 800 of file abstractgroup.cpp.

Handle * AbstractGroup::createHandleForChild ( QGraphicsWidget *  child)
virtual

Returns an handle for a child of this Group.

Reimplement this if you want to provide a different handle than the default one.

Parameters
childthe child for which it must be created an handle
Returns
the handle just created

Definition at line 633 of file abstractgroup.cpp.

void AbstractGroup::destroy ( )

Destroy this Groups and its children, deleting the configurations too.

Definition at line 476 of file abstractgroup.cpp.

void AbstractGroup::dragLeaveEvent ( QGraphicsSceneDragDropEvent *  event)
protectedvirtual

Reimplemented from QGraphicsItem.

Definition at line 708 of file abstractgroup.cpp.

void AbstractGroup::geometryChanged ( )
signal

This signal is emitted when the Group's geometry changes.

void AbstractGroup::groupDestroyed ( AbstractGroup *  group)
signal

This signal is emitted when the Group's destructor is called.

Parameters
groupa pointer to this Group
GroupInfo AbstractGroup::groupInfo ( const QString &  name)
static

Definition at line 855 of file abstractgroup.cpp.

void AbstractGroup::groupTransformedByUser ( )
signal

This signal is emitted when the Group is transformed by the user.

GroupType AbstractGroup::groupType ( ) const

Returns the type of this Group.

See also
setGroupType
GroupType
bool AbstractGroup::hasConfigurationInterface ( ) const

Returns true if this Group provides a GUI configuration.

See also
setHasConfigurationInterface

Definition at line 805 of file abstractgroup.cpp.

uint AbstractGroup::id ( ) const

Returns the id of this Group.

Plasma::ImmutabilityType AbstractGroup::immutability ( ) const

Returns the type of immutability of this Group.

See also
setImmutability

Definition at line 302 of file abstractgroup.cpp.

void AbstractGroup::immutabilityChanged ( Plasma::ImmutabilityType  immutability)
signal

Emitted when the immutability changes.

Parameters
immutabilitythe new immutability
void AbstractGroup::init ( )
virtual

Method called a little after the constructor.

If you need methods like config() or containment() use them here, not in the constructor.

Definition at line 280 of file abstractgroup.cpp.

bool AbstractGroup::isMainGroup ( ) const

Returns true if this Group is a MainGroup.

See also
setIsMainGroup
GroupingContainment::useMainGroup
QVariant AbstractGroup::itemChange ( GraphicsItemChange  change,
const QVariant &  value 
)
protectedvirtual

Reimplemented from QGraphicsItem.

Definition at line 737 of file abstractgroup.cpp.

virtual void AbstractGroup::layoutChild ( QGraphicsWidget *  child,
const QPointF &  pos 
)
protectedpure virtual

Lays out a child inside the Group A sub class probably wants to reimplement this function.

Parameters
childthe child to be laid out
posthe position of the child mapped to the Group's coordinates
AbstractGroup * AbstractGroup::load ( const QString &  name,
QGraphicsItem *  parent = 0 
)
static

Creates a new Group.

Parameters
namethe identifier for the type of Group to be created
parentthe parent of the new Group

Definition at line 839 of file abstractgroup.cpp.

QString AbstractGroup::mimeType ( )
static

Definition at line 834 of file abstractgroup.cpp.

void AbstractGroup::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
)
virtual

Reimplemented from QGraphicsItem.

Definition at line 758 of file abstractgroup.cpp.

AbstractGroup * AbstractGroup::parentGroup ( ) const

Returns the Group that contains this one, 0 if there is no one.

Definition at line 312 of file abstractgroup.cpp.

virtual QString AbstractGroup::pluginName ( ) const
pure virtual

Returns the plugin name for the Group.

void AbstractGroup::raise ( )

Brings this Group on top of the other Groups and Applet.

Definition at line 628 of file abstractgroup.cpp.

void AbstractGroup::releaseChild ( QGraphicsWidget *  child)
virtual

Called when an Applet or a Group starts to be moved by the user.

A Group might want to reimplement this to free the widget from a layout or whatever, so to allow it to be moved.

Definition at line 829 of file abstractgroup.cpp.

void AbstractGroup::removeApplet ( Plasma::Applet *  applet,
AbstractGroup *  newGroup = 0 
)

Removes an Applet from this Group.

Parameters
appletthe applet to be removed
newGroupthe group in which the Applet must be added after it is removed from this
See also
addApplet
applets

Definition at line 425 of file abstractgroup.cpp.

void AbstractGroup::removeSubGroup ( AbstractGroup *  group,
AbstractGroup *  newGroup = 0 
)

Removes a Group from this Group.

Parameters
groupthe Group to be removed
newGroupthe Group in which the Group must be added after it is removed from this
See also
addSubGroup
subGroups

Definition at line 450 of file abstractgroup.cpp.

void AbstractGroup::resizeEvent ( QGraphicsSceneResizeEvent *  event)
protectedvirtual

Reimplemented from QGraphicsWidget.

Definition at line 713 of file abstractgroup.cpp.

void AbstractGroup::restore ( KConfigGroup &  group)
virtual

Restore the state information about this Group.

Normally you don't reimplement this to restore the configuration of the Group, but you restore it in init() using config().

See also
restoreChildren
save
config

Definition at line 588 of file abstractgroup.cpp.

virtual void AbstractGroup::restoreChildGroupInfo ( QGraphicsWidget *  child,
const KConfigGroup &  group 
)
pure virtual

Restores the group's specific configurations for a chils.

This function must be reimplemented by a sub class.

Parameters
childthe child whose info will be restored
groupthe config group for the configuration
See also
saveChildGroupInfo
void AbstractGroup::restoreChildren ( )
virtual

Calls restoreChildGroupInfo for every child.

When it is called applets(), subGroups() and children() are already available.

See also
restore
restoreChildGroupInfo

Definition at line 605 of file abstractgroup.cpp.

void AbstractGroup::save ( KConfigGroup &  group) const
virtual

Saves state information about this Group.

Normally you don't reimplement this to save the configuration of the Group, but you save it using config().

See also
saveChildren
restore
config

Definition at line 548 of file abstractgroup.cpp.

virtual void AbstractGroup::saveChildGroupInfo ( QGraphicsWidget *  child,
KConfigGroup  config 
) const
pure virtual

Saves the group's specific configurations for a child.

This function must be reimplemented by a sub class.

Parameters
childthe child whose info will be saved
configthe config group for the configuration
See also
restoreChildGroupInfo
void AbstractGroup::saveChildren ( ) const
virtual

Calls saveChildGroupInfo for every child.

See also
save
saveChildGroupInfo

Definition at line 572 of file abstractgroup.cpp.

void AbstractGroup::setBackgroundHints ( BackgroundHints  hint)

Sets the BackgroundHints for this Group.

See also
backgroundHints
BackgroundHint

Definition at line 671 of file abstractgroup.cpp.

void AbstractGroup::setGroupType ( AbstractGroup::GroupType  type)
protected

Sets the type of this Group.

See also
groupType
GroupType

Definition at line 647 of file abstractgroup.cpp.

void AbstractGroup::setHasConfigurationInterface ( bool  hasInterface)
protected

Sets whether or not this Group provides a user interface for configuring it.

It defaults to false, and if true is passed in you should also reimplement createConfigurationInterface()

Parameters
hasInterfacewhether or not there is a user interface available
See also
createConfigurationInterface

Definition at line 810 of file abstractgroup.cpp.

void AbstractGroup::setImmutability ( Plasma::ImmutabilityType  immutability)
slot

Sets the immutability type for this Group (not immutable, user immutable or system immutable)

Parameters
immutabilitythe new immutability type of this Group
See also
immutability
Plasma::ImmutabilityType

Definition at line 285 of file abstractgroup.cpp.

void AbstractGroup::setIsMainGroup ( )

Tells this Group it is a Main Group, causing it to: not paint a background; not be movable; not have contents margins.

See also
isMainGroup
GroupingContainment::useMainGroup

Definition at line 657 of file abstractgroup.cpp.

void AbstractGroup::setUseSimplerBackgroundForChildren ( bool  use)
protected

Sets whether or not this Group should make its children have a simpler background instead of the default one.

Default is false.

Parameters
usewhether or not it should use a simpler background
See also
useSimplerBackgroundForChildren

Definition at line 689 of file abstractgroup.cpp.

void AbstractGroup::showConfigurationInterface ( )
virtualslot

Lets the user interact with the Group options.

Called when the user selects the configure entry from the context menu.

Unless there is a good reason for overriding this method, AbstractGroup subclasses should actually override createConfigurationInterface instead.

See also
createConfigurationInterface
setHasConfigurationInterface

Definition at line 775 of file abstractgroup.cpp.

bool AbstractGroup::showDropZone ( const QPointF &  pos)
virtual

Shows a visual clue for drag and drop The default implementation does nothing, reimplement it in groups that need it.

Parameters
pospoint where to show the drop target; if an invalid point is passed in the drop zone should not be shown
Returns
true if it can accept a child at the passed position

Definition at line 619 of file abstractgroup.cpp.

void AbstractGroup::subGroupAddedInGroup ( AbstractGroup *  subGroup,
AbstractGroup *  group 
)
signal

Emitted when a Group is assigned to this Group.

Parameters
subGroupa pointer to the Group added
groupa pointer to this Group
See also
appletAddedInGroup
void AbstractGroup::subGroupRemovedFromGroup ( AbstractGroup *  subGroup,
AbstractGroup *  group 
)
signal

Emitted when a Group is removed from this Group.

Parameters
subGroupa pointer to the Group removed
groupa pointer to this Group
See also
appletRemovedFromGroup
QList< AbstractGroup * > AbstractGroup::subGroups ( ) const

Returns a list of the groups managed by this Group.

See also
addSubGroup
removeSubGroup

Definition at line 407 of file abstractgroup.cpp.

int AbstractGroup::type ( ) const
virtual

Definition at line 732 of file abstractgroup.cpp.

void AbstractGroup::updateConstraints ( Plasma::Constraints  constraints = Plasma::AllConstraints)

Called when any of the geometry constraints have been updated.

This method calls constraintsEvent, which may be reimplemented, once the Group has been prepared for updating the constraints.

Parameters
constraintsthe type of constraints that were updated
See also
constraintsEvent

Definition at line 815 of file abstractgroup.cpp.

bool AbstractGroup::useSimplerBackgroundForChildren ( ) const

Returns true if this Group uses a simpler background for its children.

See also
setUseSimplerBackgroundForChildren

Definition at line 703 of file abstractgroup.cpp.

QGraphicsView * AbstractGroup::view ( ) const

Returns the view this widget is visible on, or 0 if none can be found.

Warning
do NOT assume this will always return a view! a null view probably means that either plasma hasn't finished loading, or your group is on an activity that's not being shown anywhere.

Definition at line 495 of file abstractgroup.cpp.

Property Documentation

AbstractGroup::GroupType AbstractGroup::groupType
read

Definition at line 48 of file abstractgroup.h.

bool AbstractGroup::hasInterface
read

Definition at line 46 of file abstractgroup.h.

uint AbstractGroup::id
read

Definition at line 47 of file abstractgroup.h.

bool AbstractGroup::isMainGroup
read

Definition at line 49 of file abstractgroup.h.


The documentation for this class was generated from the following files:
  • abstractgroup.h
  • abstractgroup.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Mon Oct 13 2014 22:55:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GroupingDesktop

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

kdeplasma-addons API Reference

Skip menu "kdeplasma-addons API Reference"
  •     GroupingDesktop
  •   liblancelot

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal