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
|
//Auto-generated by kalyptus. DO NOT EDIT.
package org.trinitydesktop.koala;
import org.trinitydesktop.qt.Qt;
import org.trinitydesktop.qt.TQMetaObject;
import org.trinitydesktop.qt.QtSupport;
import org.trinitydesktop.qt.TQObject;
/**
Base class for an "editor" part.
This class handles network transparency for you.
Anything that can open a URL, allow modifications, and save
(to the same URL or a different one).
A read-write part can be set to read-only mode, using setReadWrite().
Part writers :
Any part inheriting ReadWritePart should check isReadWrite()
before allowing any action that modifies the part.
The part probably wants to reimplement setReadWrite, disable those
actions. Don't forget to call the parent setReadWrite().
See {@link ReadWritePartSignals} for signals emitted by ReadWritePart
@short Base class for an "editor" part.
*/
public class ReadWritePart extends ReadOnlyPart {
protected ReadWritePart(Class dummy){super((Class) null);}
public native TQMetaObject metaObject();
public native String className();
/**
Constructor.
See parent constructor for instructions.
@short Constructor.
*/
/**
@return true if the part is in read-write mode
@short
*/
public native boolean isReadWrite();
/**
Changes the behavior of this part to readonly or readwrite.
@param readwrite set to true to enable readwrite mode
@short Changes the behavior of this part to readonly or readwrite.
*/
public native void setReadWrite(boolean readwrite);
public native void setReadWrite();
/**
@return true if the document has been modified.
@short
*/
public native boolean isModified();
/**
If the document has been modified, ask the user to save changes.
This method is meant to be called from TDEMainWindow.queryClose().
It will also be called from closeURL().
@return true if closeURL() can be called without the user losing
important data, false if the user chooses to cancel.
@short If the document has been modified, ask the user to save changes.
*/
public native boolean queryClose();
/**
Called when closing the current url (e.g. document), for instance
when switching to another url (note that openURL() calls it
automatically in this case).
If the current URL is not fully loaded yet, aborts loading.
If isModified(), queryClose() will be called.
@return false on cancel
@short Called when closing the current url (e.
*/
public native boolean closeURL();
/**
Call this method instead of the above if you need control if
the save prompt is shown. For example, if you call queryClose()
from TDEMainWindow.queryClose(), you would not want to prompt
again when closing the url.
Equivalent to promptToSave ? closeURL() : ReadOnlyPart.closeURL()
@short Call this method instead of the above if you need control if the save prompt is shown.
*/
public native boolean closeURL(boolean promptToSave);
/**
Save the file to a new location.
Calls save(), no need to reimplement
@short Save the file to a new location.
*/
public native boolean saveAs(KURL url);
/**
Sets the modified flag of the part.
@short Sets the modified flag of the part.
*/
public native void setModified(boolean modified);
/**
Call setModified() whenever the contents get modified.
This is a slot for convenience, so that you can connect it
to a signal, like textChanged().
@short Call setModified() whenever the contents get modified.
*/
public native void setModified();
/**
Save the file in the location from which it was opened.
You can connect this to the "save" action.
Calls saveFile() and saveToURL(), no need to reimplement.
@short Save the file in the location from which it was opened.
*/
public native boolean save();
/**
Waits for any pending upload job to finish and returns whether the
last save() action was successful.
@short Waits for any pending upload job to finish and returns whether the last save() action was successful.
*/
public native boolean waitSaveComplete();
}
|