Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /* This file is part of the KDE libraries |
---|---|
2 | * Copyright (C) 1999 Waldo Bastian <bastian@kde.org> |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Library General Public |
6 | * License version 2 as published by the Free Software Foundation; |
7 | * |
8 | * This library is distributed in the hope that it will be useful, |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | * Library General Public License for more details. |
12 | * |
13 | * You should have received a copy of the GNU Library General Public License |
14 | * along with this library; see the file COPYING.LIB. If not, write to |
15 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
16 | * Boston, MA 02110-1301, USA. |
17 | **/ |
18 | |
19 | #ifndef KSYCOCAENTRY_H |
20 | #define KSYCOCAENTRY_H |
21 | |
22 | #include <kglobal.h> |
23 | #include <ksycocatype.h> |
24 | #include <ksharedptr.h> |
25 | |
26 | #include <QtCore/QDataStream> |
27 | #include <QtCore/QStringList> |
28 | #include <QtCore/QVariant> |
29 | |
30 | class KSycocaEntryPrivate; |
31 | |
32 | /** |
33 | * Base class for all Sycoca entries. |
34 | * |
35 | * You can't create an instance of KSycocaEntry, but it provides |
36 | * the common functionality for servicetypes and services. |
37 | * |
38 | * @internal |
39 | * @see http://techbase.kde.org/Development/Architecture/KDE3/System_Configuration_Cache |
40 | */ |
41 | class KDECORE_EXPORT KSycocaEntry : public KShared |
42 | { |
43 | |
44 | public: |
45 | /* |
46 | * constructs a invalid KSycocaEntry object |
47 | */ |
48 | KSycocaEntry(); |
49 | |
50 | virtual ~KSycocaEntry(); |
51 | |
52 | /** |
53 | * internal |
54 | */ |
55 | bool isType(KSycocaType t) const; |
56 | /** |
57 | * internal |
58 | */ |
59 | KSycocaType sycocaType() const; |
60 | |
61 | typedef KSharedPtr<KSycocaEntry> Ptr; |
62 | typedef QList<Ptr> List; |
63 | |
64 | /** |
65 | * Default constructor |
66 | */ |
67 | // explicit KSycocaEntry(const QString &path); |
68 | |
69 | /** |
70 | * Safe demarshalling functions. |
71 | */ |
72 | static void read( QDataStream &s, QString &str ); |
73 | static void read( QDataStream &s, QStringList &list ); |
74 | |
75 | |
76 | /** |
77 | * @return the name of this entry |
78 | */ |
79 | QString name() const; |
80 | |
81 | /** |
82 | * @return the path of this entry |
83 | * The path can be absolute or relative. |
84 | * The corresponding factory should know relative to what. |
85 | */ |
86 | QString entryPath() const; |
87 | |
88 | /** |
89 | * @return the unique ID for this entry |
90 | * In practice, this is storageId() for KService and name() for everything else. |
91 | * \since 4.2.1 |
92 | */ |
93 | QString storageId() const; |
94 | |
95 | /** |
96 | * @return true if valid |
97 | */ |
98 | bool isValid() const; |
99 | |
100 | /** |
101 | * @return true if deleted |
102 | */ |
103 | bool isDeleted() const; |
104 | |
105 | /** |
106 | * Returns the requested property. Some often used properties |
107 | * have convenience access functions like exec(), |
108 | * serviceTypes etc. |
109 | * |
110 | * @param name the name of the property |
111 | * @return the property, or invalid if not found |
112 | */ |
113 | QVariant property(const QString &name) const; |
114 | |
115 | /** |
116 | * Returns the list of all properties that this service can have. |
117 | * That means, that some of these properties may be empty. |
118 | * @return the list of supported properties |
119 | */ |
120 | QStringList propertyNames() const; |
121 | |
122 | /** |
123 | * Sets whether or not this service is deleted |
124 | */ |
125 | void setDeleted( bool deleted ); |
126 | |
127 | |
128 | /* |
129 | * @returns true, if this is a separator |
130 | */ |
131 | bool isSeparator() const; |
132 | |
133 | /** |
134 | * @internal |
135 | * @return the position of the entry in the sycoca file |
136 | */ |
137 | int offset() const; |
138 | |
139 | /** |
140 | * @internal |
141 | * Save ourselves to the database. |
142 | */ |
143 | void save(QDataStream &s); |
144 | |
145 | // KSycocaEntry(const KSycocaEntry ©); |
146 | // KSycocaEntry &operator=(const KSycocaEntry &right); |
147 | protected: |
148 | KSycocaEntry(KSycocaEntryPrivate &d); |
149 | KSycocaEntryPrivate *d_ptr; |
150 | |
151 | private: |
152 | Q_DISABLE_COPY(KSycocaEntry) |
153 | |
154 | Q_DECLARE_PRIVATE(KSycocaEntry) |
155 | }; |
156 | |
157 | #endif |
158 |
Warning: That file was not part of the compilation database. It may have many parsing errors.