• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KDECore

Public Member Functions
KServiceOffer Class Reference

#include <kserviceoffer.h>

List of all members.

Public Member Functions

 KServiceOffer ()
 KServiceOffer (const KServiceOffer &)
 KServiceOffer (const KService::Ptr &service, int pref, int mimeTypeInheritanceLevel, bool allowedAsDefault)
 ~KServiceOffer ()
bool allowAsDefault () const
bool isValid () const
int mimeTypeInheritanceLevel () const
bool operator< (const KServiceOffer &) const
KServiceOffer & operator= (const KServiceOffer &other)
int preference () const
KService::Ptr service () const
void setMimeTypeInheritanceLevel (int level)
void setPreference (int p)

Detailed Description

Holds the user's preference of a service.

This class holds the user-specific preferences of a service (whether it can be a default offer or not, how big is the preference for this offer, ...). Basically it is a reference to a KService, a number that represents the user's preference (bigger is better) and a flag whether the KService can be used as default.

See also:
KService

Definition at line 38 of file kserviceoffer.h.


Constructor & Destructor Documentation

KServiceOffer::KServiceOffer ( )

Create an invalid service offer.

Definition at line 39 of file kserviceoffer.cpp.

KServiceOffer::KServiceOffer ( const KServiceOffer &  _o)

Copy constructor.

Shallow copy (the KService will not be copied).

Definition at line 44 of file kserviceoffer.cpp.

KServiceOffer::KServiceOffer ( const KService::Ptr &  service,
int  pref,
int  mimeTypeInheritanceLevel,
bool  allowedAsDefault 
)

Creates a new KServiceOffer.

Parameters:
servicea pointer to the KService
prefthe user's preference value, must be positive, bigger is better
mimeTypeInheritanceLevellevel of mimetype inheritance which allows this service to handling the mimetype. 0 if no inheritance involved, 1 for parent mimetype, etc.
allowedAsDefaulttrue if the service should be used as default

Definition at line 50 of file kserviceoffer.cpp.

KServiceOffer::~KServiceOffer ( )

Definition at line 59 of file kserviceoffer.cpp.


Member Function Documentation

bool KServiceOffer::allowAsDefault ( ) const

Is it allowed to use this service for default actions (e.g.

Left Click in a file manager, or KRun in general).

Returns:
true if the service is a allowed as default

Definition at line 94 of file kserviceoffer.cpp.

bool KServiceOffer::isValid ( ) const

Check whether the entry is valid.

A service is valid if its preference value is positive.

Returns:
true if the service offer is valid

Definition at line 114 of file kserviceoffer.cpp.

int KServiceOffer::mimeTypeInheritanceLevel ( ) const

Mimetype inheritance level.

Definition at line 124 of file kserviceoffer.cpp.

bool KServiceOffer::operator< ( const KServiceOffer &  _o) const

A service is bigger that the other when it can be default (and the other is not) and its preference value it higher.

Definition at line 74 of file kserviceoffer.cpp.

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

Assignment operator.

Definition at line 64 of file kserviceoffer.cpp.

int KServiceOffer::preference ( ) const

The bigger this number is, the better is this service.

Returns:
the preference number (negative numbers will be returned by invalid service offers)

Definition at line 99 of file kserviceoffer.cpp.

KService::Ptr KServiceOffer::service ( ) const

The service which this offer is about.

Returns:
the service this offer is about, can be 0 in valid offers or when not set

Definition at line 109 of file kserviceoffer.cpp.

void KServiceOffer::setMimeTypeInheritanceLevel ( int  level)

When copying an offer from a parent mimetype, remember that it's an inherited capability (for sorting purposes; we prefer a handler for postscript over any text/plain handler)

Definition at line 119 of file kserviceoffer.cpp.

void KServiceOffer::setPreference ( int  p)

The bigger this number is, the better is this service.

Set the preference number

- only for KMimeTypeTrader

Definition at line 104 of file kserviceoffer.cpp.


The documentation for this class was generated from the following files:
  • kserviceoffer.h
  • kserviceoffer.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 20:28:13 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs-4.10.5 API Reference

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