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

tdeio/tdeio

  • tdeio
  • tdeio
kservicetype.h
1 /* This file is part of the KDE project
2  Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3  1999 Waldo Bastian <bastian@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __kservicetype_h__
22 #define __kservicetype_h__
23 
24 #include "tdesycocaentry.h"
25 #include "kservice.h"
26 
27 #include <tqstring.h>
28 #include <tqstringlist.h>
29 #include <tqptrlist.h>
30 #include <tqmap.h>
31 #include <tqshared.h>
32 #include <tqdatastream.h>
33 #include <tqvariant.h>
34 
35 #include <ksimpleconfig.h>
36 
45 class TDEIO_EXPORT KServiceType : public KSycocaEntry
46 {
47  K_SYCOCATYPE( KST_KServiceType, KSycocaEntry )
48 
49 public:
50  typedef TDESharedPtr<KServiceType> Ptr;
51  typedef TQValueList<Ptr> List;
52 public:
53 
62  KServiceType( const TQString & _fullpath, const TQString& _name,
63  const TQString& _icon, const TQString& _comment);
64 
70  KServiceType( const TQString & _fullpath );
71 
76  KServiceType( KDesktopFile *config);
77 
82  KServiceType( TQDataStream& _str, int offset );
83 
84  virtual ~KServiceType();
85 
94  TQString icon() const { return m_strIcon; }
95 
100  TQString comment() const { return m_strComment; }
101 
106  TQString name() const { return m_strName; }
107 
114  TQString desktopEntryPath() const { return entryPath(); }
115 
121  bool isDerived() const { return m_bDerived; }
122 
129  TQString parentServiceType() const;
130 
136  bool inherits( const TQString& servTypeName ) const;
137 
146  virtual TQVariant property( const TQString& _name ) const;
147 
152  virtual TQStringList propertyNames() const;
153 
158  bool isValid() const { return m_bValid; }
159 
166  virtual TQVariant::Type propertyDef( const TQString& _name ) const;
167 
168  virtual TQStringList propertyDefNames() const;
169  virtual const TQMap<TQString,TQVariant::Type>& propertyDefs() const { return m_mapPropDefs; }
170 
175  virtual void save( TQDataStream& );
176 
181  virtual void load( TQDataStream& );
182 
187  // gcc 2.95.x doesn't understand KServiceType::Ptr here
188  /* KServiceType:: */ Ptr parentType();
193  void addService(KService::Ptr service);
198  KService::List services();
199 
207  static Ptr serviceType( const TQString& _name );
208 
217  static KService::List offers( const TQString& _servicetype );
218 
227  static List allServiceTypes();
228 
229 protected:
230  void init( KDesktopFile *config );
231 
232 protected:
233  TQString m_strName;
234  TQString m_strIcon;
235  TQString m_strComment;
236  TQStringVariantMap m_mapProps;
237  TQMap<TQString,TQVariant::Type> m_mapPropDefs;
238 
239  bool m_bValid:1;
240  bool m_bDerived:1;
241 protected:
242  virtual void virtual_hook( int id, void* data );
243 private:
244  class KServiceTypePrivate;
245  KServiceTypePrivate* d;
246 };
247 
248 //TQDataStream& operator>>( TQDataStream& _str, KServiceType& s );
249 //TQDataStream& operator<<( TQDataStream& _str, KServiceType& s );
250 
251 #endif
KServiceType
A service type is the generic notion for a mimetype, a type of service instead of a type of file.
Definition: kservicetype.h:46
KServiceType::isDerived
bool isDerived() const
Checks whether this service type inherits another one.
Definition: kservicetype.h:121
KServiceType::desktopEntryPath
TQString desktopEntryPath() const
Returns the relative path to the desktop entry file responsible for this servicetype.
Definition: kservicetype.h:114
KServiceType::isValid
bool isValid() const
Checks whether the service type is valid.
Definition: kservicetype.h:158
KServiceType::comment
TQString comment() const
Returns the descriptive comment associated, if any.
Definition: kservicetype.h:100
KServiceType::icon
TQString icon() const
Returns the icon associated with this service type.
Definition: kservicetype.h:94
KServiceType::name
TQString name() const
Returns the name of this service type.
Definition: kservicetype.h:106

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.1
This website is maintained by Timothy Pearson.