# class KSelectionOwner

###

Module | kdeui
Namespace |
Class | KSelectionOwner
Inherits | QObject

This class implements claiming and owning manager selections, as described in the ICCCM, section 2.8. The selection atom is passed to the constructor, claim() attemps to claim ownership of the selection, release() gives up the selection ownership. Signal lostOwnership() is emitted when the selection is claimed by another owner. ICCCM manager selection owner

### methods

- KSelectionOwner (selection, screen, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  selection | Atom |
  screen | int | -1
  parent | QObject | NULL

  This constructor initializes the object, but doesn't perform any operation on the selection.

  selection - atom representing the manager selection

  screen - X screen, or -1 for default

  parent - parent object, or NULL if there is none

- KSelectionOwner (selection, screen, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  selection | char |
  screen | int | -1
  parent | QObject | NULL

  This constructor accepts the selection name and creates the appropriate atom for it automatically.

  selection - name of the manager selection

  screen - X screen, or -1 for default

  parent - parent object, or NULL if there is none

- KSelectionOwner (a0, a1, a2)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | Atom |
  a1 | int | -1
  a2 | QObject | NULL

- KSelectionOwner (a0, a1, a2)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | char |
  a1 | int | -1
  a2 | QObject | NULL

- claim (force, force_kill)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  force | bool |
  force_kill | bool | 1

  This function attemps to claim ownership of the manager selection, using the current X timestamp. If force is false, and the selection is already owned, the selection is not claimed, and false is returned. If claiming is forced and the selection is owned by another client, it is waited for up to 1 second for the previous owner to disown the selection, if force_kill is true, and the previous owner fails to disown the selection in time, it will be forcibly killed. True is returned after successfully claiming ownership of the selection.

- filterEvent (ev_P)

  returns bool
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  ev_P | XEvent |

  Internal

- genericReply (target, property, requestor)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  target | Atom |
  property | Atom |
  requestor | Window |

  Called when a SelectionRequest event is received. A reply should be sent using the selection handling mechanism described in the ICCCM section 2.

  target - requested target type

  property - property to use for the reply data

  requestor - requestor window

- getAtoms ( )

  returns Nothing

  Called to create atoms needed for claiming the selection and communication using the selection handling mechanism. The default implementation must be called if reimplemented. This method may be called repeatedly.

- handleMessage (ev)

  returns bool
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  ev | XEvent |

  Called for every X event received on the window used for owning the selection. If true is returned, the event is filtered out.

- lostOwnership ( )

  returns Nothing
  SIGNAL ("lostOwnership ()")

  This signal is emitted if the selection was owned and the ownership has been lost due to another client claiming it, this signal is emitted. IMPORTANT: It's not safe to delete the instance in a slot connected to this signal.

- ownerWindow ( )

  returns Window

  If the selection is owned, returns the window used internally for owning the selection.

- release ( )

  returns Nothing

  If the selection is owned, the ownership is given up.

- replyTargets (property, requestor)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  property | Atom |
  requestor | Window |

  Called to announce the supported targets, as described in the ICCCM section 2.6. The default implementation announces the required targets MULTIPLE, TIMESTAMP and TARGETS.

- setData (extra1, extra2)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  extra1 | long |
  extra2 | long |

  Sets extra data to be sent in the message sent to root window after successfully claiming a selection. These extra data are in data.l[3] and data.l[4] fields of the XClientMessage.