• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
kuserprofile.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __kuserprofile_h__
21#define __kuserprofile_h__
22
23#include <tqmap.h>
24#include <tqstring.h>
25#include <tqptrlist.h>
26#include <tqvaluelist.h>
27
28#include <kservice.h>
29
40class TDEIO_EXPORT KServiceOffer
41{
42public:
46 KServiceOffer();
47
52 KServiceOffer( const KServiceOffer& );
53
62 KServiceOffer( KService::Ptr _service,
63 int _pref, bool _default );
64
69 bool operator< ( const KServiceOffer& ) const;
75 bool allowAsDefault() const { return m_bAllowAsDefault; }
81 int preference() const { return m_iPreference; }
87 KService::Ptr service() const { return m_pService; }
93 bool isValid() const { return m_iPreference >= 0; }
94
95private:
96 int m_iPreference;
97 bool m_bAllowAsDefault;
98 KService::Ptr m_pService;
99private:
100 class KServiceOfferPrivate;
101};
102
117class TDEIO_EXPORT KServiceTypeProfile
118{
119public:
120 typedef TQValueList<KServiceOffer> OfferList;
121
122 ~KServiceTypeProfile();
123
131 int preference( const TQString& _service ) const;
132
139 bool allowAsDefault( const TQString& _service ) const;
140
146 OfferList offers() const;
147
157 static KService::Ptr preferredService( const TQString & serviceType, const TQString & genericServiceType );
158
167 static KServiceTypeProfile* serviceTypeProfile( const TQString& servicetype, const TQString & genericServiceType = TQString::null );
168
188 static OfferList offers( const TQString& servicetype, const TQString& genericServiceType = TQString::null );
189
194 static const TQPtrList<KServiceTypeProfile>& serviceTypeProfiles() { return *s_lstProfiles; }
195
199 static void clear();
200
207 static void setConfigurationMode() { s_configurationMode = true; }
208
215 static void unsetConfigurationMode() { s_configurationMode = false; }
216
220 static bool configurationMode() { return s_configurationMode; }
221
222protected:
231 KServiceTypeProfile( const TQString& serviceType,
232 const TQString& genericServiceType = TQString::null );
233
242 void addService( const TQString& _service, int _preference = 1, bool _allow_as_default = true );
243
244private:
248 struct Service
249 {
253 int m_iPreference;
257 bool m_bAllowAsDefault;
258 };
259
263 TQMap<TQString,Service> m_mapServices;
264
268 TQString m_strServiceType;
269
273 TQString m_strGenericServiceType;
274
275 static void initStatic();
276 static TQPtrList<KServiceTypeProfile>* s_lstProfiles;
277 static bool s_configurationMode;
278private:
279 class KServiceTypeProfilePrivate* d;
280};
281
282#endif
KServiceOffer
This class holds the user-specific preferences of a service (whether it can be a default offer or not...
Definition: kuserprofile.h:41
KServiceOffer::allowAsDefault
bool allowAsDefault() const
Is it allowed to use this service for default actions (e.g.
Definition: kuserprofile.h:75
KServiceOffer::isValid
bool isValid() const
Check whether the entry is valid.
Definition: kuserprofile.h:93
KServiceOffer::preference
int preference() const
The bigger this number is, the better is this service.
Definition: kuserprofile.h:81
KServiceOffer::service
KService::Ptr service() const
The service which this offer is about.
Definition: kuserprofile.h:87
KServiceTypeProfile
KServiceTypeProfile represents the user's preferences for services of a service type.
Definition: kuserprofile.h:118
KServiceTypeProfile::setConfigurationMode
static void setConfigurationMode()
This method activates a special mode of KServiceTypeProfile, in which all/all and all/allfiles are ex...
Definition: kuserprofile.h:207
KServiceTypeProfile::serviceTypeProfiles
static const TQPtrList< KServiceTypeProfile > & serviceTypeProfiles()
Returns a list of all KServiceTypeProfiles.
Definition: kuserprofile.h:194
KServiceTypeProfile::unsetConfigurationMode
static void unsetConfigurationMode()
This method deactivates the special mode above of KServiceTypeProfile It is meant for the configurati...
Definition: kuserprofile.h:215

tdeio/tdeio

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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.4
This website is maintained by Timothy Pearson.