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

KDECore

KServiceAction Class Reference

Represents an action in a .desktop file Actions are defined with the config key Actions in the [Desktop Entry] group, followed by one group per action, as per the desktop entry standard. More...

#include <kserviceaction.h>

List of all members.


Public Member Functions

QVariant data () const
QString exec () const
QString icon () const
bool isSeparator () const
 KServiceAction (const KServiceAction &other)
 KServiceAction ()
 KServiceAction (const QString &name, const QString &text, const QString &icon, const QString &exec, bool noDisplay=false)
QString name () const
bool noDisplay () const
KServiceAction & operator= (const KServiceAction &other)
void setData (const QVariant &userData)
QString text () const
 ~KServiceAction ()

Friends

QDataStream & operator<< (QDataStream &str, const KServiceAction &act)
QDataStream & operator>> (QDataStream &str, KServiceAction &act)

Detailed Description

Represents an action in a .desktop file Actions are defined with the config key Actions in the [Desktop Entry] group, followed by one group per action, as per the desktop entry standard.

See also:
KService::actions

Definition at line 34 of file kserviceaction.h.


Constructor & Destructor Documentation

KServiceAction::KServiceAction ( const QString &  name,
const QString &  text,
const QString &  icon,
const QString &  exec,
bool  noDisplay = false 
)

Creates a KServiceAction.

Normally you don't have to do this, KService creates the actions when parsing the .desktop file.

Definition at line 43 of file kserviceaction.cpp.

KServiceAction::KServiceAction (  ) 

For internal use only.

Needed for operator>>

Definition at line 38 of file kserviceaction.cpp.

KServiceAction::~KServiceAction (  ) 

Destroys a KServiceAction.

Definition at line 50 of file kserviceaction.cpp.

KServiceAction::KServiceAction ( const KServiceAction &  other  ) 

Copy constructor.

Definition at line 54 of file kserviceaction.cpp.


Member Function Documentation

QVariant KServiceAction::data (  )  const

Returns:
the action's internal data.

Definition at line 65 of file kserviceaction.cpp.

QString KServiceAction::exec (  )  const

Returns:
the action's exec command, as defined by the Exec key in the desktop action group

Definition at line 90 of file kserviceaction.cpp.

QString KServiceAction::icon (  )  const

Returns:
the action's icon, as defined by the Icon key in the desktop action group

Definition at line 85 of file kserviceaction.cpp.

bool KServiceAction::isSeparator (  )  const

Returns whether the action is a separator.

This is true when the Actions key contains "_SEPARATOR_".

Definition at line 100 of file kserviceaction.cpp.

QString KServiceAction::name (  )  const

Returns:
the action's internal name For instance Actions=Setup;... and the group [Desktop Action Setup] define an action with the name "Setup".

Definition at line 75 of file kserviceaction.cpp.

bool KServiceAction::noDisplay (  )  const

Returns whether the action should be suppressed in menus.

This is useful for having actions with a known name that the code looks for explicitly, like Setup and Root for kscreensaver actions, and which should not appear in popup menus.

Returns:
true to suppress this service

Definition at line 95 of file kserviceaction.cpp.

KServiceAction & KServiceAction::operator= ( const KServiceAction &  other  ) 

Assignment operator.

Definition at line 59 of file kserviceaction.cpp.

void KServiceAction::setData ( const QVariant &  userData  ) 

Sets the action's internal data to the given userData.

Definition at line 70 of file kserviceaction.cpp.

QString KServiceAction::text (  )  const

Returns:
the action's text, as defined by the Name key in the desktop action group

Definition at line 80 of file kserviceaction.cpp.


Friends And Related Function Documentation

QDataStream& operator<< ( QDataStream &  str,
const KServiceAction &  act 
) [friend]

Definition at line 117 of file kserviceaction.cpp.

QDataStream& operator>> ( QDataStream &  str,
KServiceAction &  act 
) [friend]

Definition at line 105 of file kserviceaction.cpp.


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

KDECore

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs 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