io.qt.core.QItemSelectionModel Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Keeps track of a view's selected items
* Java wrapper for Qt class QItemSelectionModel
*/
public class QItemSelectionModel extends io.qt.core.QObject
{
/**
* This variable stores the meta-object for the class.
*/
public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QItemSelectionModel.class);
/**
* Java wrapper for Qt enum QItemSelectionModel::SelectionFlag
*
* @see SelectionFlags
*/
public enum SelectionFlag implements QtFlagEnumerator {
/**
* Representing QItemSelectionModel:: NoUpdate
*/
NoUpdate(0),
/**
* Representing QItemSelectionModel:: Clear
*/
Clear(1),
/**
* Representing QItemSelectionModel:: Select
*/
Select(2),
/**
* Representing QItemSelectionModel:: Deselect
*/
Deselect(4),
/**
* Representing QItemSelectionModel:: Toggle
*/
Toggle(8),
/**
* Representing QItemSelectionModel:: Current
*/
Current(16),
/**
* Representing QItemSelectionModel:: Rows
*/
Rows(32),
/**
* Representing QItemSelectionModel:: Columns
*/
Columns(64),
/**
* Representing QItemSelectionModel:: SelectCurrent
*/
SelectCurrent(18),
/**
* Representing QItemSelectionModel:: ToggleCurrent
*/
ToggleCurrent(24),
/**
* Representing QItemSelectionModel:: ClearAndSelect
*/
ClearAndSelect(3);
static {
QtJambi_LibraryUtilities.initialize();
}
private SelectionFlag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
public @NonNull SelectionFlags asFlags() {
return new SelectionFlags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull SelectionFlags combined(@NonNull SelectionFlag e) {
return asFlags().setFlag(e, true);
}
/**
* Excludes other enum entry from a flag of this entry.
* @param e enum entry
* @return new flag
*/
public @NonNull SelectionFlags cleared(@NonNull SelectionFlag e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link SelectionFlags} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull SelectionFlags flags(@Nullable SelectionFlag @NonNull... values) {
return new SelectionFlags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull SelectionFlag resolve(int value) {
switch (value) {
case 0: return NoUpdate;
case 1: return Clear;
case 2: return Select;
case 4: return Deselect;
case 8: return Toggle;
case 16: return Current;
case 32: return Rows;
case 64: return Columns;
case 18: return SelectCurrent;
case 24: return ToggleCurrent;
case 3: return ClearAndSelect;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link SelectionFlag}
*/
public static final class SelectionFlags extends QFlags implements Comparable {
private static final long serialVersionUID = 0x94dda626326e2012L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new SelectionFlags where the flags in args
are set.
* @param args enum entries
*/
public SelectionFlags(@Nullable SelectionFlag @NonNull... args){
super(args);
}
/**
* Creates a new SelectionFlags with given value
.
* @param value
*/
public SelectionFlags(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new SelectionFlags
*/
@Override
public final @NonNull SelectionFlags combined(@StrictNonNull SelectionFlag e){
return new SelectionFlags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
public final @NonNull SelectionFlags setFlag(@Nullable SelectionFlag e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
public final @NonNull SelectionFlags setFlag(@Nullable SelectionFlag e, boolean on){
if (on) {
setValue(value() | e.value());
}else {
setValue(value() & ~e.value());
}
return this;
}
/**
* Returns an array of flag objects represented by this SelectionFlags.
* @return array of enum entries
*/
@Override
public final @NonNull SelectionFlag @NonNull[] flags(){
return super.flags(SelectionFlag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull SelectionFlags clone(){
return new SelectionFlags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull SelectionFlags other){
return Integer.compare(value(), other.value());
}
}
/**
* See QItemSelectionModel:: currentChanged(QModelIndex, QModelIndex)
*/
@QtPropertyNotify(name="currentIndex")
public final @NonNull Signal2 currentChanged = new Signal2<>();
/**
* See QItemSelectionModel:: currentColumnChanged(QModelIndex, QModelIndex)
*/
public final @NonNull Signal2 currentColumnChanged = new Signal2<>();
/**
* See QItemSelectionModel:: currentRowChanged(QModelIndex, QModelIndex)
*/
public final @NonNull Signal2 currentRowChanged = new Signal2<>();
/**
* See QItemSelectionModel:: modelChanged(QAbstractItemModel*)
*/
@QtPropertyNotify(name="model")
public final @NonNull Signal1 modelChanged = new Signal1<>();
/**
* See QItemSelectionModel:: selectionChanged(QItemSelection, QItemSelection)
*/
@QtPropertyNotify(name="hasSelection")
public final @NonNull Signal2 selectionChanged = new Signal2<>();
/**
* See QItemSelectionModel:: QItemSelectionModel(QAbstractItemModel*)
*/
public QItemSelectionModel(io.qt.core.@Nullable QAbstractItemModel model){
super((QPrivateConstructor)null);
initialize_native(this, model);
}
private native static void initialize_native(QItemSelectionModel instance, io.qt.core.QAbstractItemModel model);
/**
* See QItemSelectionModel:: QItemSelectionModel(QAbstractItemModel*, QObject*)
*/
public QItemSelectionModel(io.qt.core.@Nullable QAbstractItemModel model, io.qt.core.@Nullable QObject parent){
super((QPrivateConstructor)null);
initialize_native(this, model, parent);
}
private native static void initialize_native(QItemSelectionModel instance, io.qt.core.QAbstractItemModel model, io.qt.core.QObject parent);
/**
* See QItemSelectionModel:: bindableModel()
*/
@QtPropertyBindable(name="model")
@QtUninvokable
public final io.qt.core.@NonNull QBindable bindableModel(){
return bindableModel_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QBindable bindableModel_native(long __this__nativeId);
/**
* See QItemSelectionModel:: clearSelection()
*/
public final void clearSelection(){
clearSelection_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native void clearSelection_native(long __this__nativeId);
/**
* See QItemSelectionModel:: columnIntersectsSelection(int, QModelIndex)const
*/
public final boolean columnIntersectsSelection(int column, io.qt.core.@NonNull QModelIndex parent){
return columnIntersectsSelection_native_int_cref_QModelIndex_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), column, QtJambi_LibraryUtilities.internal.checkedNativeId(parent));
}
private native boolean columnIntersectsSelection_native_int_cref_QModelIndex_constfct(long __this__nativeId, int column, long parent);
/**
* See QItemSelectionModel:: currentIndex()const
*/
@QtPropertyReader(name="currentIndex")
@QtPropertyDesignable("false")
@QtPropertyStored("false")
@QtUninvokable
public final io.qt.core.@NonNull QModelIndex currentIndex(){
return currentIndex_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QModelIndex currentIndex_native_constfct(long __this__nativeId);
/**
* See QItemSelectionModel:: emitSelectionChanged(QItemSelection, QItemSelection)
*/
@QtUninvokable
protected final void emitSelectionChanged(io.qt.core.@NonNull QItemSelection newSelection, io.qt.core.@NonNull QItemSelection oldSelection){
emitSelectionChanged_native_cref_QItemSelection_cref_QItemSelection(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(newSelection), QtJambi_LibraryUtilities.internal.checkedNativeId(oldSelection));
}
@QtUninvokable
private native void emitSelectionChanged_native_cref_QItemSelection_cref_QItemSelection(long __this__nativeId, long newSelection, long oldSelection);
/**
* See QItemSelectionModel:: hasSelection()const
*/
@QtPropertyReader(name="hasSelection")
@QtPropertyDesignable("false")
@QtPropertyStored("false")
@QtUninvokable
public final boolean hasSelection(){
return hasSelection_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean hasSelection_native_constfct(long __this__nativeId);
/**
* See QItemSelectionModel:: isColumnSelected(int, QModelIndex)const
*/
public final boolean isColumnSelected(int column, io.qt.core.@NonNull QModelIndex parent){
return isColumnSelected_native_int_cref_QModelIndex_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), column, QtJambi_LibraryUtilities.internal.checkedNativeId(parent));
}
private native boolean isColumnSelected_native_int_cref_QModelIndex_constfct(long __this__nativeId, int column, long parent);
/**
* See QItemSelectionModel:: isRowSelected(int, QModelIndex)const
*/
public final boolean isRowSelected(int row, io.qt.core.@NonNull QModelIndex parent){
return isRowSelected_native_int_cref_QModelIndex_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), row, QtJambi_LibraryUtilities.internal.checkedNativeId(parent));
}
private native boolean isRowSelected_native_int_cref_QModelIndex_constfct(long __this__nativeId, int row, long parent);
/**
* See QItemSelectionModel:: isSelected(QModelIndex)const
*/
public final boolean isSelected(io.qt.core.@NonNull QModelIndex index){
return isSelected_native_cref_QModelIndex_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(index));
}
private native boolean isSelected_native_cref_QModelIndex_constfct(long __this__nativeId, long index);
/**
* See QItemSelectionModel:: model()
*/
@QtPropertyReader(name="model")
@QtUninvokable
public final io.qt.core.@Nullable QAbstractItemModel model(){
return model_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QAbstractItemModel model_native(long __this__nativeId);
/**
* See QItemSelectionModel:: rowIntersectsSelection(int, QModelIndex)const
*/
public final boolean rowIntersectsSelection(int row, io.qt.core.@NonNull QModelIndex parent){
return rowIntersectsSelection_native_int_cref_QModelIndex_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), row, QtJambi_LibraryUtilities.internal.checkedNativeId(parent));
}
private native boolean rowIntersectsSelection_native_int_cref_QModelIndex_constfct(long __this__nativeId, int row, long parent);
/**
* See QItemSelectionModel:: selectedColumns(int)const
*/
public final io.qt.core.@NonNull QList selectedColumns(int row){
return selectedColumns_native_int_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), row);
}
private native io.qt.core.QList selectedColumns_native_int_constfct(long __this__nativeId, int row);
/**
* See QItemSelectionModel:: selectedIndexes()const
*/
@QtPropertyReader(name="selectedIndexes")
@QtPropertyDesignable("false")
@QtPropertyStored("false")
@QtUninvokable
public final io.qt.core.@NonNull QList selectedIndexes(){
return selectedIndexes_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QList selectedIndexes_native_constfct(long __this__nativeId);
/**
* See QItemSelectionModel:: selectedRows(int)const
*/
public final io.qt.core.@NonNull QList selectedRows(int column){
return selectedRows_native_int_constfct(QtJambi_LibraryUtilities.internal.nativeId(this), column);
}
private native io.qt.core.QList selectedRows_native_int_constfct(long __this__nativeId, int column);
/**
* See QItemSelectionModel:: selection()const
*/
@QtPropertyReader(name="selection")
@QtPropertyDesignable("false")
@QtPropertyStored("false")
@QtUninvokable
public final io.qt.core.@NonNull QItemSelection selection(){
return selection_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.core.QItemSelection selection_native_constfct(long __this__nativeId);
/**
* See QItemSelectionModel:: setModel(QAbstractItemModel*)
*/
@QtPropertyWriter(name="model")
@QtUninvokable
public final void setModel(io.qt.core.@Nullable QAbstractItemModel model){
setModel_native_QAbstractItemModel_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(model));
}
@QtUninvokable
private native void setModel_native_QAbstractItemModel_ptr(long __this__nativeId, long model);
/**
* See QItemSelectionModel:: clear()
*/
public void clear(){
clear_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native void clear_native(long __this__nativeId);
/**
* See QItemSelectionModel:: clearCurrentIndex()
*/
public void clearCurrentIndex(){
clearCurrentIndex_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native void clearCurrentIndex_native(long __this__nativeId);
/**
* See QItemSelectionModel:: reset()
*/
public void reset(){
reset_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
private native void reset_native(long __this__nativeId);
/**
* See QItemSelectionModel:: select(QItemSelection, QItemSelectionModel::SelectionFlags)
*/
public void select(io.qt.core.@NonNull QItemSelection selection, io.qt.core.QItemSelectionModel.@NonNull SelectionFlags command){
select_native_cref_QItemSelection_QItemSelectionModel_SelectionFlags(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(selection), command.value());
}
private native void select_native_cref_QItemSelection_QItemSelectionModel_SelectionFlags(long __this__nativeId, long selection, int command);
/**
* See QItemSelectionModel:: select(QModelIndex, QItemSelectionModel::SelectionFlags)
*/
public void select(io.qt.core.@NonNull QModelIndex index, io.qt.core.QItemSelectionModel.@NonNull SelectionFlags command){
select_native_cref_QModelIndex_QItemSelectionModel_SelectionFlags(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(index), command.value());
}
private native void select_native_cref_QModelIndex_QItemSelectionModel_SelectionFlags(long __this__nativeId, long index, int command);
/**
* See QItemSelectionModel:: setCurrentIndex(QModelIndex, QItemSelectionModel::SelectionFlags)
*/
public void setCurrentIndex(io.qt.core.@NonNull QModelIndex index, io.qt.core.QItemSelectionModel.@NonNull SelectionFlags command){
setCurrentIndex_native_cref_QModelIndex_QItemSelectionModel_SelectionFlags(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(index), command.value());
}
private native void setCurrentIndex_native_cref_QModelIndex_QItemSelectionModel_SelectionFlags(long __this__nativeId, long index, int command);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QItemSelectionModel(QPrivateConstructor p) { super(p); }
/**
* Constructor for internal use only.
* It is not allowed to call the declarative constructor from inside Java.
* @hidden
*/
@NativeAccess
protected QItemSelectionModel(QDeclarativeConstructor constructor) {
super((QPrivateConstructor)null);
initialize_native(this, constructor);
}
@QtUninvokable
private static native void initialize_native(QItemSelectionModel instance, QDeclarativeConstructor constructor);
/**
* Overloaded constructor for {@link #QItemSelectionModel(io.qt.core.QAbstractItemModel)}
* with model = null
.
*/
public QItemSelectionModel() {
this((io.qt.core.QAbstractItemModel)null);
}
/**
* Overloaded function for {@link #columnIntersectsSelection(int, io.qt.core.QModelIndex)}
* with parent = new io.qt.core.QModelIndex()
.
*/
public final boolean columnIntersectsSelection(int column) {
return columnIntersectsSelection(column, new io.qt.core.QModelIndex());
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #currentIndex()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.core.@NonNull QModelIndex getCurrentIndex() {
return currentIndex();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #hasSelection()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final boolean getHasSelection() {
return hasSelection();
}
/**
* Overloaded function for {@link #isColumnSelected(int, io.qt.core.QModelIndex)}
* with parent = new io.qt.core.QModelIndex()
.
*/
public final boolean isColumnSelected(int column) {
return isColumnSelected(column, new io.qt.core.QModelIndex());
}
/**
* Overloaded function for {@link #isRowSelected(int, io.qt.core.QModelIndex)}
* with parent = new io.qt.core.QModelIndex()
.
*/
public final boolean isRowSelected(int row) {
return isRowSelected(row, new io.qt.core.QModelIndex());
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #model()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.core.@Nullable QAbstractItemModel getModel() {
return model();
}
/**
* Overloaded function for {@link #rowIntersectsSelection(int, io.qt.core.QModelIndex)}
* with parent = new io.qt.core.QModelIndex()
.
*/
public final boolean rowIntersectsSelection(int row) {
return rowIntersectsSelection(row, new io.qt.core.QModelIndex());
}
/**
* Overloaded function for {@link #selectedColumns(int)}
* with row = 0
.
*/
public final io.qt.core.@NonNull QList selectedColumns() {
return selectedColumns((int)0);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #selectedIndexes()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.core.@NonNull QList getSelectedIndexes() {
return selectedIndexes();
}
/**
* Overloaded function for {@link #selectedRows(int)}
* with column = 0
.
*/
public final io.qt.core.@NonNull QList selectedRows() {
return selectedRows((int)0);
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #selection()} instead.
*/
@QtPropertyReader(enabled=false)
@QtUninvokable
public final io.qt.core.@NonNull QItemSelection getSelection() {
return selection();
}
/**
* Overloaded function for {@link #select(io.qt.core.QItemSelection, io.qt.core.QItemSelectionModel.SelectionFlags)}.
*/
public final void select(io.qt.core.@NonNull QItemSelection selection, io.qt.core.QItemSelectionModel.@NonNull SelectionFlag @NonNull... command) {
select(selection, new io.qt.core.QItemSelectionModel.SelectionFlags(command));
}
/**
* Overloaded function for {@link #select(io.qt.core.QModelIndex, io.qt.core.QItemSelectionModel.SelectionFlags)}.
*/
public final void select(io.qt.core.@NonNull QModelIndex index, io.qt.core.QItemSelectionModel.@NonNull SelectionFlag @NonNull... command) {
select(index, new io.qt.core.QItemSelectionModel.SelectionFlags(command));
}
/**
* Overloaded function for {@link #setCurrentIndex(io.qt.core.QModelIndex, io.qt.core.QItemSelectionModel.SelectionFlags)}.
*/
public final void setCurrentIndex(io.qt.core.@NonNull QModelIndex index, io.qt.core.QItemSelectionModel.@NonNull SelectionFlag @NonNull... command) {
setCurrentIndex(index, new io.qt.core.QItemSelectionModel.SelectionFlags(command));
}
}