summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KConfigGroupSaver.java
blob: 6cc7051d81d931b3717b15552f45e767df4918dd (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
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.QtSupport;

/**

 Helper class to facilitate working with TDEConfig / KSimpleConfig
 groups.
 Careful programmers always set the group of a
 TDEConfig KSimpleConfig object to the group they want to read from
 and set it back to the old one of afterwards. This is usually
 written as:
 <pre>
 String oldgroup config.group();
 config.setGroup( "TheGroupThatIWant" );
 ...
 config.writeEntry( "Blah", "Blubb" );
 config.setGroup( oldgroup );
 </pre>
 In order to facilitate this task, you can use
 TDEConfigGroupSaver. Simply construct such an object ON THE STACK
 when you want to switch to a new group. Then, when the object goes
 out of scope, the group will automatically be restored. If you
 want to use several different groups within a function or method,
 you can still use TDEConfigGroupSaver: Simply enclose all work with
 one group (including the creation of the TDEConfigGroupSaver object)
 in one block.
 TDEConfigGroup provides similar functionality in a more object oriented
 way.
		@author Matthias Kalle Dalheimer <kalle@kde.org>

		@short Helper class for easier use of TDEConfig/KSimpleConfig groups.
		@see TDEConfigBase
		@see TDEConfig
		@see KSimpleConfig
		@see TDEConfigGroup

*/
public class TDEConfigGroupSaver implements QtSupport {
	private long _qt;
	private boolean _allocatedInJavaWorld = true;
	protected TDEConfigGroupSaver(Class dummy){}

	/**	
		 Constructor. You pass a pointer to the TDEConfigBase-derived
		 object you want to work with and a string indicating the _new_
		 group.
			@param config The TDEConfigBase-derived object this
		               TDEConfigGroupSaver works on.
			@param group The new group that the config object should switch to.
		   		@short    Constructor.
	*/
	public TDEConfigGroupSaver(TDEConfigBase config, String group) {
		newTDEConfigGroupSaver(config,group);
	}
	private native void newTDEConfigGroupSaver(TDEConfigBase config, String group);
	public native TDEConfigBase 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();
}