• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KDECore

kmimetype_p.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE libraries
00002  *  Copyright (C) 1999 Waldo Bastian <bastian@kde.org>
00003  *                     David Faure   <faure@kde.org>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License version 2 as published by the Free Software Foundation;
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 #ifndef __kmimetype_p_h__
00020 #define __kmimetype_p_h__
00021 
00022 #include "kservicetype_p.h"
00023 
00024 class KMimeTypePrivate: public KServiceTypePrivate
00025 {
00026 public:
00027   K_SYCOCATYPE( KST_KMimeType, KServiceTypePrivate )
00028 
00029   KMimeTypePrivate(const QString &path) : KServiceTypePrivate(path), m_xmlDataLoaded(false)
00030     {}
00031   KMimeTypePrivate(QDataStream &_str, int offset)
00032       : KServiceTypePrivate(_str, offset), m_xmlDataLoaded(false)
00033   {
00034   }
00035 
00036   virtual void save(QDataStream &s);
00037 
00038   virtual QVariant property(const QString &name ) const;
00039 
00040   virtual QStringList propertyNames() const;
00041 
00042     virtual QString comment(const KUrl & = KUrl()) const
00043     {
00044         ensureXmlDataLoaded();
00045         return m_strComment;
00046     }
00047 
00048     // virtual because reimplemented in KFolderMimeType
00049     virtual QString iconName(const KUrl &) const
00050     {
00051         if (!m_iconName.isEmpty())
00052             return m_iconName;
00053 
00054         // Make default icon name from the mimetype name
00055         // Don't store this in m_iconName, it would make the filetype editor
00056         // write out icon names in every local mimetype definition file.
00057         QString icon = name();
00058         const int slashindex = icon.indexOf(QLatin1Char('/'));
00059         if (slashindex != -1) {
00060             icon[slashindex] = QLatin1Char('-');
00061         }
00062         return icon;
00063     }
00064 
00065     bool inherits(const QString& mime) const;
00066     void ensureXmlDataLoaded() const;
00067     virtual int serviceOffersOffset() const;
00068 
00069     mutable QStringList m_lstPatterns;
00070     mutable QString m_iconName; // user-specified
00071     mutable bool m_xmlDataLoaded;
00072 };
00073 
00074 #endif // __kmimetype_p_h__

KDECore

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal