kio Library API Documentation

kservicegroup.h

00001 /* This file is part of the KDE project 00002 Copyright (C) 2000 Waldo Bastian <bastian@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 version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef __kservicegroup_h__ 00020 #define __kservicegroup_h__ 00021 00022 #include <qptrlist.h> 00023 #include <qstring.h> 00024 #include <qshared.h> 00025 #include <qdatastream.h> 00026 #include <qvariant.h> 00027 00028 #include <kdesktopfile.h> 00029 00030 #include "ksycocaentry.h" 00031 #include "ksycocatype.h" 00032 #include "kservice.h" 00033 00034 class KBuildServiceGroupFactory; 00035 00067 class KIO_EXPORT KServiceGroup : public KSycocaEntry 00068 { 00069 friend class KBuildServiceGroupFactory; 00070 K_SYCOCATYPE( KST_KServiceGroup, KSycocaEntry ) 00071 00072 public: 00073 typedef KSharedPtr<KServiceGroup> Ptr; 00074 typedef KSharedPtr<KSycocaEntry> SPtr; 00075 typedef QValueList<SPtr> List; 00076 public: 00082 KServiceGroup( const QString & name ); 00083 00089 KServiceGroup( const QString & _fullpath, const QString & _relpath ); 00090 00095 KServiceGroup( QDataStream& _str, int offset, bool deep ); 00096 00097 virtual ~KServiceGroup(); 00098 00103 bool isValid() const { return true; } 00104 00109 virtual QString name() const { return entryPath(); } 00110 00115 virtual QString relPath() const { return entryPath(); } 00116 00121 QString caption() const { return m_strCaption; } 00122 00128 QString icon() const { return m_strIcon; } 00129 00135 QString comment() const { return m_strComment; } 00136 00142 int childCount(); 00143 00150 bool noDisplay() const; 00151 00157 bool showEmptyMenu() const; 00158 00159 void setShowEmptyMenu( bool b); 00160 00165 bool showInlineHeader() const; 00166 void setShowInlineHeader(bool _b); 00167 00168 00169 bool inlineAlias() const; 00170 void setInlineAlias(bool _b); 00171 00172 bool allowInline() const; 00173 void setAllowInline(bool _b); 00174 00175 int inlineValue() const; 00176 void setInlineValue(int _val); 00177 00178 00186 QStringList suppressGenericNames() const; 00187 00192 void setLayoutInfo(const QStringList &layout); 00193 00198 QStringList layoutInfo() const; 00199 00204 virtual void load( QDataStream& ); 00209 virtual void save( QDataStream& ); 00210 00221 List entries(bool sorted, bool excludeNoDisplay, bool allowSeparators, bool sortByGenericName=false); 00222 virtual List entries(bool sorted, bool excludeNoDisplay); 00223 00230 virtual List entries(bool sorted = false); 00231 00242 QString baseGroupName() const { return m_strBaseGroupName; } 00243 00249 QString directoryEntryPath() const; 00250 00256 static Ptr baseGroup( const QString &baseGroupName ); 00257 00262 static Ptr root(); 00263 00269 static Ptr group(const QString &relPath); 00270 00278 static Ptr childGroup(const QString &parent); 00279 00280 void parseAttribute( const QString &item , bool &showEmptyMenu, bool &showInline, bool &showInlineHeader, bool & showInlineAlias ,int &inlineValue ); 00281 00282 protected: 00287 void addEntry( KSycocaEntry *entry); 00288 00289 QString m_strCaption; 00290 QString m_strIcon; 00291 QString m_strComment; 00292 00293 List m_serviceList; 00294 bool m_bDeep; 00295 QString m_strBaseGroupName; 00296 int m_childCount; 00297 protected: 00298 virtual void virtual_hook( int id, void* data ); 00299 private: 00300 class Private; 00301 Private* d; 00302 }; 00303 00304 class KIO_EXPORT KServiceSeparator : public KSycocaEntry 00305 { 00306 K_SYCOCATYPE( KST_KServiceSeparator, KSycocaEntry ) 00307 00308 public: 00309 typedef KSharedPtr<KServiceSeparator> Ptr; 00310 public: 00315 KServiceSeparator(); 00316 00317 bool isValid() const { return true; } 00318 00319 // Dummy 00320 virtual QString name() const { return "separator"; } 00321 // Dummy 00322 virtual void load( QDataStream& ) { }; 00323 // Dummy 00324 virtual void save( QDataStream& ) { }; 00325 }; 00326 00327 #endif
KDE Logo
This file is part of the documentation for kio Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 14 00:20:29 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003