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

kio/kio

kuserprofile.h
00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017    Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef __kuserprofile_h__
00021 #define __kuserprofile_h__
00022 
00023 #include <tqmap.h>
00024 #include <tqstring.h>
00025 #include <tqptrlist.h>
00026 #include <tqvaluelist.h>
00027 
00028 #include <kservice.h>
00029 
00040 class KIO_EXPORT KServiceOffer
00041 {
00042 public:
00046   KServiceOffer();
00047 
00052   KServiceOffer( const KServiceOffer& );
00053 
00062   KServiceOffer( KService::Ptr _service,
00063          int _pref, bool _default );
00064 
00069   bool operator< ( const KServiceOffer& ) const;
00075   bool allowAsDefault() const { return m_bAllowAsDefault; }
00081   int preference() const { return m_iPreference; }
00087   KService::Ptr service() const { return m_pService; }
00093   bool isValid() const { return m_iPreference >= 0; }
00094 
00095 private:
00096   int m_iPreference;
00097   bool m_bAllowAsDefault;
00098   KService::Ptr m_pService;
00099 private:
00100   class KServiceOfferPrivate;
00101 };
00102 
00117 class KIO_EXPORT KServiceTypeProfile
00118 {
00119 public:
00120   typedef TQValueList<KServiceOffer> OfferList;
00121 
00122   ~KServiceTypeProfile();
00123 
00131   int preference( const TQString& _service ) const;
00132 
00139   bool allowAsDefault( const TQString& _service ) const;
00140 
00146   OfferList offers() const;
00147 
00157   static KService::Ptr preferredService( const TQString & serviceType, const TQString & genericServiceType );
00158 
00167   static KServiceTypeProfile* serviceTypeProfile( const TQString& servicetype, const TQString & genericServiceType = TQString::null );
00168 
00188   static OfferList offers( const TQString& servicetype, const TQString& genericServiceType = TQString::null );
00189 
00194   static const TQPtrList<KServiceTypeProfile>& serviceTypeProfiles() { return *s_lstProfiles; }
00195 
00199   static void clear();
00200 
00207   static void setConfigurationMode() { s_configurationMode = true; }
00208 
00215   static void unsetConfigurationMode() { s_configurationMode = false; }
00216 
00220   static bool configurationMode() { return s_configurationMode; }
00221 
00222 protected:
00231   KServiceTypeProfile( const TQString& serviceType,
00232                        const TQString& genericServiceType = TQString::null );
00233 
00242   void addService( const TQString& _service, int _preference = 1, bool _allow_as_default = true );
00243 
00244 private:
00248   struct Service
00249   {
00253     int m_iPreference;
00257     bool m_bAllowAsDefault;
00258   };
00259 
00263   TQMap<TQString,Service> m_mapServices;
00264 
00268   TQString m_strServiceType;
00269 
00273   TQString m_strGenericServiceType;
00274 
00275   static void initStatic();
00276   static TQPtrList<KServiceTypeProfile>* s_lstProfiles;
00277   static bool s_configurationMode;
00278 private:
00279   class KServiceTypeProfilePrivate* d;
00280 };
00281 
00282 #endif

kio/kio

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

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |