org.kde.koala

Class Observer

public class Observer extends QObject implements DCOPObjectInterface

Observer for KIO.Job progress information. This class, of which there is always only one instance, "observes" what jobs do and forwards this information to the progress-info server. It is a DCOP object so that the UI server can call the kill method when the user presses Cancel. Usually jobs are automatically registered by the KIO.Scheduler, so you do not have to care about that.

Author: David Faure

UNKNOWN: Observer for KIO.Job progress information.

Constructor Summary
protected Observer(Class dummy)
Observer()
Method Summary
DCOPClientcallingDcopClient()
Returns the DCOPClient responsible for making the call.
StringclassName()
booleanconnectDCOPSignal(String sender, String senderObj, String signal, String slot, boolean Volatile)
Connects to a DCOP signal.
booleandisconnectDCOPSignal(String sender, String senderObj, String signal, String slot)
Disconnects a DCOP signal.
voidemitDCOPSignal(String signal, byte[] data)
Emit signal as DCOP signal from this object with data as arguments
static DCOPObjectInterfacefind(String objId)
Try to find a dcop object with the given id.
ArrayListfunctions()
Returns the list of functions understood by the object.
ArrayListfunctionsDynamic()
This function is of interest when you used an IDL compiler to generate the implementation for functions() but you still want to list some functions dynamically.
static booleanhasObject(String objId)
Checks whether an object with the given id is known in this process.
ArrayListinterfaces()
Returns the names of the interfaces, specific ones last.
ArrayListinterfacesDynamic()
This function is of interest when you used an IDL compiler to generate the implementation for interfaces() but you still want to list some interfaces dynamically.
voidjobFinished(int progressId)
Called by the job destructor, to tell the UI Server that the job ended.
static intmessageBox(int progressId, int type, String text, String caption, String buttonYes, String buttonNo)
Popup a message box.
static intmessageBox(int progressId, int type, String text, String caption, String buttonYes, String buttonNo, String dontAskAgainName)
Popup a message box.
QMetaObjectmetaObject()
voidmounting(Job arg1, String dev, String point)
intnewJob(Job job, boolean showProgress)
Called by the job constructor, to signal its presence to the UI Server.
static StringobjectName(QObject arg1)
Creates an object id for the QObject obj. This is done using the QObject.name() function.
StringobjId()
Returns the object id of the DCOPObject.
booleanopenPassDlg(AuthInfo info)
Opens a password dialog.
intopen_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest, int ctimeSrc, int ctimeDest, int mtimeSrc, int mtimeDest)
See renamedlg.h
intopen_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest, int ctimeSrc, int ctimeDest, int mtimeSrc)
intopen_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest, int ctimeSrc, int ctimeDest)
intopen_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest, int ctimeSrc)
intopen_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest)
intopen_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc)
intopen_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest)
intopen_SkipDlg(Job job, boolean multi, String error_text)
See skipdlg.h
booleanprocess(String fun, byte[] data, StringBuffer replyType, byte[] replyData)
Dispatches a message.
booleanprocessDynamic(String fun, byte[] data, StringBuffer replyType, byte[] replyData)
This function is of interest when you used an IDL compiler to generate the implementation for process() but you still want to dispatch some functions dynamically.
static Observerself()
Returns the unique observer object.
voidsetCallingDcopClient(DCOPClient arg1)
booleansetObjId(String objId)
Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected
voidslotCanResume(Job arg1, long offset)
voidslotCopying(Job arg1, KURL from, KURL to)
voidslotCreatingDir(Job arg1, KURL dir)
voidslotDeleting(Job arg1, KURL url)
voidslotInfoMessage(Job arg1, String msg)
voidslotMoving(Job arg1, KURL from, KURL to)
voidslotPercent(Job arg1, long percent)
voidslotProcessedDirs(Job arg1, long dirs)
voidslotProcessedFiles(Job arg1, long files)
voidslotProcessedSize(Job arg1, long size)
voidslotSpeed(Job arg1, long speed)
voidslotTotalDirs(Job arg1, long dirs)
voidslotTotalFiles(Job arg1, long files)
voidslotTotalSize(Job arg1, long size)
voidslotTransferring(Job arg1, KURL url)
voidstating(Job arg1, KURL url)
voidunmounting(Job arg1, String point)

Constructor Detail

Observer

protected Observer(Class dummy)

Observer

public Observer()

Method Detail

callingDcopClient

public DCOPClient callingDcopClient()
Returns the DCOPClient responsible for making the call. Only call this function while you are handling a DCOP call.

Returns: the DCOPClient responsible for making the call. This information is only guaranteed to be correct when entering your DCOP function.

UNKNOWN: Returns the DCOPClient responsible for making the call.

className

public String className()

connectDCOPSignal

public boolean connectDCOPSignal(String sender, String senderObj, String signal, String slot, boolean Volatile)
Connects to a DCOP signal.

Parameters: sender the name of the client that emits the signal. When empty the signal will be passed from any client. senderObj the name of the sending object that emits the signal. signal the name of the signal. The arguments should match with slot. slot The name of the slot to call. Its arguments should match with signal. Volatile If true, the connection will not be reestablished when sender unregisters and reregisters with DCOP. In this case the sender must be registered when the connection is made. If false, the connection will be reestablished when sender reregisters. In this case the connection can be made even if sender is not registered at that time.

  • Volatile is true and sender does not exist.
  • signal and slot do not have matching arguments.
  • @return false if a connection could not be established. This will be the case when

    UNKNOWN: Connects to a DCOP signal.

    disconnectDCOPSignal

    public boolean disconnectDCOPSignal(String sender, String senderObj, String signal, String slot)
    Disconnects a DCOP signal. A special case is when both sender & signal are empty. In this case all connections related to this object in the current client are disconnected. (Both connections from as well as to this object!)

    Parameters: sender the name of the client that emits the signal. senderObj the name of the object that emits the signal. If empty all objects will be disconnected. signal the name of the signal. The arguments should match with slot. If empty all objects will be disconnected. slot The name of the slot the signal is connected to. If empty all slots will be disconnected.

    Returns: false if no connection(s) where removed.

    UNKNOWN: Disconnects a DCOP signal.

    emitDCOPSignal

    public void emitDCOPSignal(String signal, byte[] data)
    Emit signal as DCOP signal from this object with data as arguments

    Parameters: signal the signal to emit data the data to send

    UNKNOWN: Emit signal as DCOP signal from this object with data as arguments

    find

    public static DCOPObjectInterface find(String objId)
    Try to find a dcop object with the given id. This function does not query the DCOPObjectProxy.

    Parameters: objId the object id to search

    Returns: the DCOPObject for the id objId.

    UNKNOWN: Try to find a dcop object with the given id.

    functions

    public ArrayList functions()
    Returns the list of functions understood by the object. It gets reimplemented by the IDL compiler. If you don't use the IDL compiler, consider implementing this function manually if you want your object to be easily scriptable. Rationale: functions() allows an interpreter to do client-side type-casting properly. Note to implementators: remember to call the baseclasses implementation.

    Returns: a list of functions

    See Also: Observer Observer Observer DCOPClient

    UNKNOWN: Returns the list of functions understood by the object.

    functionsDynamic

    public ArrayList functionsDynamic()
    This function is of interest when you used an IDL compiler to generate the implementation for functions() but you still want to list some functions dynamically. Dynamically means that the methods may appear and vanish during runtime.

    Returns: A list of the additional functions, default is an empty list.

    See Also: Observer

    UNKNOWN: This function is of interest when you used an IDL compiler to generate the implementation for functions() but you still want to list some functions dynamically.

    hasObject

    public static boolean hasObject(String objId)
    Checks whether an object with the given id is known in this process. DCOPObjectProxy

    Returns: true if an object with the questionable objId is known in this process. This query does not ask proxies.

    UNKNOWN: Checks whether an object with the given id is known in this process.

    interfaces

    public ArrayList interfaces()
    Returns the names of the interfaces, specific ones last. The functions gets reimplemented by the IDL compiler. If you don't use the IDL compiler, consider implementing this function manually if you want your object to be easily explorable.

    Returns: a list of interfaces

    See Also: Observer

    UNKNOWN: Returns the names of the interfaces, specific ones last.

    interfacesDynamic

    public ArrayList interfacesDynamic()
    This function is of interest when you used an IDL compiler to generate the implementation for interfaces() but you still want to list some interfaces dynamically. Dynamically means that they may appear and vanish during runtime.

    Returns: A list of the additional interfaces, default is an empty list.

    See Also: Observer

    UNKNOWN: This function is of interest when you used an IDL compiler to generate the implementation for interfaces() but you still want to list some interfaces dynamically.

    jobFinished

    public void jobFinished(int progressId)
    Called by the job destructor, to tell the UI Server that the job ended.

    Parameters: progressId the progress ID of the job, as returned by newJob()

    UNKNOWN: Called by the job destructor, to tell the UI Server that the job ended.

    messageBox

    public static int messageBox(int progressId, int type, String text, String caption, String buttonYes, String buttonNo)
    Popup a message box. See KIO.SlaveBase. This doesn't use DCOP anymore, it shows the dialog in the application's process. Otherwise, other apps would block when trying to communicate with UIServer.

    Parameters: progressId the progress ID of the job, as returned by newJob() type the type of the message box text the text to show caption the window caption buttonYes the text of the "Yes" button buttonNo the text of the "No button

    UNKNOWN: Popup a message box.

    messageBox

    public static int messageBox(int progressId, int type, String text, String caption, String buttonYes, String buttonNo, String dontAskAgainName)
    Popup a message box. See KIO.SlaveBase. This doesn't use DCOP anymore, it shows the dialog in the application's process. Otherwise, other apps would block when trying to communicate with UIServer.

    Parameters: progressId the progress ID of the job, as returned by newJob() type the type of the message box text the text to show caption the window caption buttonYes the text of the "Yes" button buttonNo the text of the "No button dontAskAgainName A checkbox is added with which further confirmation can be turned off. The string is used to lookup and store the setting in kioslaverc.

    UNKNOWN: Popup a message box.

    metaObject

    public QMetaObject metaObject()

    mounting

    public void mounting(Job arg1, String dev, String point)

    newJob

    public int newJob(Job job, boolean showProgress)
    Called by the job constructor, to signal its presence to the UI Server.

    Parameters: job the new job showProgress true to show progress, false otherwise

    Returns: the progress ID assigned by the UI Server to the Job.

    UNKNOWN: Called by the job constructor, to signal its presence to the UI Server.

    objectName

    public static String objectName(QObject arg1)
    Creates an object id for the QObject obj. This is done using the QObject.name() function.

    Parameters: obj the object whose name will be used

    Returns: the created object id

    UNKNOWN: Creates an object id for the QObject obj.

    objId

    public String objId()
    Returns the object id of the DCOPObject.

    Returns: the object's id

    UNKNOWN: Returns the object id of the DCOPObject.

    openPassDlg

    public boolean openPassDlg(AuthInfo info)
    Opens a password dialog.

    Parameters: info the authentication information

    Returns: true if successful ("ok" clicked), false otherwise

    UNKNOWN: Opens a password dialog.

    open_RenameDlg

    public int open_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest, int ctimeSrc, int ctimeDest, int mtimeSrc, int mtimeDest)
    See renamedlg.h

    UNKNOWN:

    open_RenameDlg

    public int open_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest, int ctimeSrc, int ctimeDest, int mtimeSrc)

    open_RenameDlg

    public int open_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest, int ctimeSrc, int ctimeDest)

    open_RenameDlg

    public int open_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest, int ctimeSrc)

    open_RenameDlg

    public int open_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc, long sizeDest)

    open_RenameDlg

    public int open_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest, long sizeSrc)

    open_RenameDlg

    public int open_RenameDlg(Job job, String caption, String src, String dest, int mode, StringBuffer newDest)

    open_SkipDlg

    public int open_SkipDlg(Job job, boolean multi, String error_text)
    See skipdlg.h

    UNKNOWN:

    process

    public boolean process(String fun, byte[] data, StringBuffer replyType, byte[] replyData)
    Dispatches a message. Usually you want to use an IDL compiler to automatically generate an implementation for this function. If this function returns false, then processDynamic() is called. Note to implementators: remember to call the baseclasses implementation. It handles the functions "functions()" and "interfaces()" which return the lists of supported functions and interfaces, respectively.

    Parameters: fun is the normalized function signature. Such a signature usually looks like foobar(String,int). The return type, qualifiers like "const" etc. are not part of the signature. data the received data replyType write the reply type in this string replyData write the reply data in this array

    Returns: true if successful, false otherwise. The default implementation returns false for all fun except "functions()" and "interfaces()".

    See Also: DCOPClient Observer DCOPClient

    UNKNOWN: Dispatches a message.

    processDynamic

    public boolean processDynamic(String fun, byte[] data, StringBuffer replyType, byte[] replyData)
    This function is of interest when you used an IDL compiler to generate the implementation for process() but you still want to dispatch some functions dynamically. Dynamically means that methods may appear and vanish during runtime.

    Parameters: fun is the normalized function signature. Such a signature usually looks like foobar(String,int). The return type, qualifiers like "const" etc. are not part of the signature. data the received data replyType write the reply type in this string replyData write the reply data in this array

    Returns: true if successful, false otherwise. The default implementation returns always false.

    See Also: Observer DCOPClient Observer DCOPClient

    UNKNOWN: This function is of interest when you used an IDL compiler to generate the implementation for process() but you still want to dispatch some functions dynamically.

    self

    public static Observer self()
    Returns the unique observer object.

    Returns: the observer object

    UNKNOWN: Returns the unique observer object.

    setCallingDcopClient

    public void setCallingDcopClient(DCOPClient arg1)

    UNKNOWN:

    setObjId

    public boolean setObjId(String objId)
    Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected

    Parameters: objId the new object id

    UNKNOWN: Renames a dcop object, if no other with the same name exists Use with care, all dcop signals are disconnected

    slotCanResume

    public void slotCanResume(Job arg1, long offset)

    slotCopying

    public void slotCopying(Job arg1, KURL from, KURL to)

    slotCreatingDir

    public void slotCreatingDir(Job arg1, KURL dir)

    slotDeleting

    public void slotDeleting(Job arg1, KURL url)

    slotInfoMessage

    public void slotInfoMessage(Job arg1, String msg)

    slotMoving

    public void slotMoving(Job arg1, KURL from, KURL to)

    slotPercent

    public void slotPercent(Job arg1, long percent)

    slotProcessedDirs

    public void slotProcessedDirs(Job arg1, long dirs)

    slotProcessedFiles

    public void slotProcessedFiles(Job arg1, long files)

    slotProcessedSize

    public void slotProcessedSize(Job arg1, long size)

    slotSpeed

    public void slotSpeed(Job arg1, long speed)

    slotTotalDirs

    public void slotTotalDirs(Job arg1, long dirs)

    slotTotalFiles

    public void slotTotalFiles(Job arg1, long files)

    slotTotalSize

    public void slotTotalSize(Job arg1, long size)

    slotTransferring

    public void slotTransferring(Job arg1, KURL url)

    stating

    public void stating(Job arg1, KURL url)

    unmounting

    public void unmounting(Job arg1, String point)