KDECore
ksycocaentry_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 * 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., 51 Franklin Street, Fifth Floor, 00016 * Boston, MA 02110-1301, USA. 00017 **/ 00018 00019 #ifndef KSYCOCAENTRYPRIVATE_H 00020 #define KSYCOCAENTRYPRIVATE_H 00021 00022 #include "ksycocaentry.h" 00023 00024 #define K_SYCOCATYPE( type, baseclass ) \ 00025 virtual bool isType(KSycocaType t) const { if (t == type) return true; return baseclass::isType(t);} \ 00026 virtual KSycocaType sycocaType() const { return type; } 00027 00028 00029 class KSycocaEntryPrivate 00030 { 00031 public: 00032 KSycocaEntryPrivate(const QString &path_) 00033 : offset( 0 ), 00034 deleted( false ), path(path_) 00035 {} 00036 00037 KSycocaEntryPrivate(QDataStream &_str, int iOffset); 00038 00039 virtual ~KSycocaEntryPrivate() {} 00040 00041 // Don't forget to call the parent class 00042 // first if you override this function. 00043 virtual void save(QDataStream &s); 00044 00045 virtual bool isType(KSycocaType t) const 00046 { 00047 return (t == KST_KSycocaEntry); 00048 } 00049 00050 virtual KSycocaType sycocaType() const 00051 { 00052 return KST_KSycocaEntry; 00053 } 00054 00055 virtual bool isValid() const 00056 { 00057 return !name().isEmpty(); 00058 } 00059 00060 virtual QVariant property(const QString &name) const 00061 { 00062 Q_UNUSED(name) 00063 return QVariant(); 00064 } 00065 00066 virtual QStringList propertyNames() const 00067 { 00068 return QStringList(); 00069 } 00070 00071 virtual QString name() const = 0; 00072 00073 virtual QString storageId() const { return name(); } 00074 00075 int offset; 00076 bool deleted; 00077 QString path; 00078 }; 00079 00080 00081 00082 #endif
KDE 4.6 API Reference