summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KServiceType.java
blob: 72ed70eccadda1921422fda5117559e8aeb75810 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QtSupport;
import org.kde.qt.TQDataStream;
import java.util.ArrayList;
import org.kde.qt.TQVariant;

/**

 A service type is the generic notion for a mimetype, a type of service
 instead of a type of file.
 For instance, KOfficeFilter is a service type.
 It is associated to services according to the user profile (kuserprofile.h).
 Service types are stored as desktop files in $TDEHOME/share/servicetypes.
		@short    A service type is the generic notion for a mimetype, a type of service  instead of a type of file.
		@see KService

*/
public class KServiceType extends KSycocaEntry  {
	protected KServiceType(Class dummy){super((Class) null);}
	/**	
		 Constructor.  You may pass in arguments to create a servicetype with
		 specific properties.
			@param _fullpath the path of the service type's desktop file
			@param _name the name of the service type
			@param _icon the icon name of the service type (can be null)
			@param _comment a comment (can be null)
		   		@short    Constructor.
	*/
	public KServiceType(String _fullpath, String _name, String _icon, String _comment) {
		super((Class) null);
		newKServiceType(_fullpath,_name,_icon,_comment);
	}
	private native void newKServiceType(String _fullpath, String _name, String _icon, String _comment);
	/**	
		 Construct a service type and take all informations from a config file.
			@param _fullpath path of the desktop file, set to "" if calling from
		                  a inherited constructor.
		   		@short    Construct a service type and take all informations from a config file.
	*/
	public KServiceType(String _fullpath) {
		super((Class) null);
		newKServiceType(_fullpath);
	}
	private native void newKServiceType(String _fullpath);
	/**	
		 Construct a service type and take all informations from a deskop file.
			@param config the configuration file
		   		@short    Construct a service type and take all informations from a deskop file.
	*/
	public KServiceType(KDesktopFile config) {
		super((Class) null);
		newKServiceType(config);
	}
	private native void newKServiceType(KDesktopFile config);
	/**	
			 The stream must already be positionned at the correct offset
		   		@short
	*/
	public KServiceType(TQDataStream _str, int offset) {
		super((Class) null);
		newKServiceType(_str,offset);
	}
	private native void newKServiceType(TQDataStream _str, int offset);
	/**	
		 Returns the icon associated with this service type. Some
		         derived classes offer special functions which take for
		         example an URL and returns a special icon for this
		         URL. An example is KMimeType, KFolderType and
		         others.
				@return the name of the icon, can be null.
   
		@short    Returns the icon associated with this service type.
	*/
	public native String icon();
	/**	
		 Returns the descriptive comment associated, if any.
				@return the comment, or null
   
		@short    Returns the descriptive comment associated, if any.
	*/
	public native String comment();
	/**	
		 Returns the name of this service type.
				@return the name of the service type
   
		@short    Returns the name of this service type.
	*/
	public native String name();
	/**	
		 Returns the relative path to the desktop entry file responsible for
		         this servicetype.
		 For instance inode/directory.desktop, or kpart.desktop
				@return the path of the desktop file
   
		@short    Returns the relative path to the desktop entry file responsible for          this servicetype.
	*/
	public native String desktopEntryPath();
	/**	
		 Checks whether this service type inherits another one.
				@return true if this service type inherits another one

		@short    Checks whether this service type inherits another one.
		@see #parentServiceType
	*/
	public native boolean isDerived();
	/**	
		 If this service type inherits from another service type,
		 return the name of the parent.
				@return the parent service type, or String. null if not set

		@short    If this service type inherits from another service type,  return the name of the parent.
		@see #isDerived
	*/
	public native String parentServiceType();
	/**	
		 Checks whether this service type is or inherits from <code>servTypeName.</code>
				@return true if this servicetype is or inherits from <code>servTypeName</code>

		@short    Checks whether this service type is or inherits from <code>servTypeName.</code>
	*/
	public native boolean inherits(String servTypeName);
	/**	
		 Returns the requested property. Some often used properties
		 have convenience access functions like name(),
		 comment() etc.
			@param _name the name of the property
				@return the property, or invalid if not found
   
		@short    Returns the requested property.
	*/
	public native TQVariant property(String _name);
	/**	
		 Returns the list of all properties of this service type.
				@return the list of properties
   
		@short    Returns the list of all properties of this service type.
	*/
	public native ArrayList propertyNames();
	/**	
		 Checks whether the service type is valid.
				@return true if the service is valid (e.g. name is not empty)
   
		@short    Checks whether the service type is valid.
	*/
	public native boolean isValid();
	/**	
		 Returns the type of the property with the given <code>_name.</code>
			@param _name the name of the property
				@return the property type, or null if not found
   
		@short    Returns the type of the property with the given <code>_name.</code>
	*/
	public native int propertyDef(String _name);
	public native ArrayList propertyDefNames();
	// const TQMap<TQString, TQVariant::Type>& propertyDefs(); >>>> NOT CONVERTED
	/**	
			 Save ourselves to the data stream.
		   		@short
	*/
	public native void save(TQDataStream arg1);
	/**	
			 Load ourselves from the data stream.
		   		@short
	*/
	public native void load(TQDataStream arg1);
	/**	
			 Pointer to parent serice type
		   		@short
	*/
	// KServiceType::Ptr parentType(); >>>> NOT CONVERTED
	/**	
			 Register service that provides this service type
		   		@short
	*/
	// void addService(KService::Ptr arg1); >>>> NOT CONVERTED
	/**	
			 List serices that provide this service type
		   		@short
	*/
	// KService::List services(); >>>> NOT CONVERTED
	/**	
		 Returns a pointer to the servicetype '_name' or null if the
		         service type is unknown.
		 VERY IMPORTANT : don't store the result in a KServiceType  !
			@param _name the name of the service type to search
				@return the pointer to the service type, or 0
   
		@short    Returns a pointer to the servicetype '_name' or 0L if the          service type is unknown.
	*/
	// KServiceType::Ptr serviceType(const TQString& arg1); >>>> NOT CONVERTED
	/**	
		 Returns all services supporting the given servicetype name.
		 This doesn't take care of the user profile.
		 In fact it is used by KServiceTypeProfile,
		 which is used by TDETrader, and that's the one you should use.
			@param _servicetype the name of the service type to search
				@return the list of all services of the given type
   
		@short    Returns all services supporting the given servicetype name.
	*/
	// KService::List offers(const TQString& arg1); >>>> NOT CONVERTED
	/**	
		 Returns a list of all the supported servicetypes. Useful for
		         showing the list of available servicetypes in a listbox,
		         for example.
		 More memory consuming than the ones above, don't use unless
		 really necessary.
				@return the list of all services
   
		@short    Returns a list of all the supported servicetypes.
	*/
	// KServiceType::List allServiceTypes(); >>>> NOT CONVERTED
	protected native void init(KDesktopFile config);
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}