KDECore
#include <kserviceoffer.h>
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
-
service a pointer to the KService pref the user's preference value, must be positive, bigger is better mimeTypeInheritanceLevel level of mimetype inheritance which allows this service to handling the mimetype. 0 if no inheritance involved, 1 for parent mimetype, etc. allowedAsDefault true 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:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.