io.qt.widgets.QTreeWidgetItemIterator Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.widgets;
import io.qt.*;
/**
* Way to iterate over the items in a QTreeWidget instance
* Java wrapper for Qt class QTreeWidgetItemIterator
*/
public class QTreeWidgetItemIterator extends QtObject
implements Iterable, java.util.Iterator
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QTreeWidgetItemIterator::IteratorFlag
*
* @see IteratorFlags
*/
public enum IteratorFlag implements QtFlagEnumerator {
/**
* Representing QTreeWidgetItemIterator:: All
*/
All(0),
/**
* Representing QTreeWidgetItemIterator:: Hidden
*/
Hidden(1),
/**
* Representing QTreeWidgetItemIterator:: NotHidden
*/
NotHidden(2),
/**
* Representing QTreeWidgetItemIterator:: Selected
*/
Selected(4),
/**
* Representing QTreeWidgetItemIterator:: Unselected
*/
Unselected(8),
/**
* Representing QTreeWidgetItemIterator:: Selectable
*/
Selectable(16),
/**
* Representing QTreeWidgetItemIterator:: NotSelectable
*/
NotSelectable(32),
/**
* Representing QTreeWidgetItemIterator:: DragEnabled
*/
DragEnabled(64),
/**
* Representing QTreeWidgetItemIterator:: DragDisabled
*/
DragDisabled(128),
/**
* Representing QTreeWidgetItemIterator:: DropEnabled
*/
DropEnabled(256),
/**
* Representing QTreeWidgetItemIterator:: DropDisabled
*/
DropDisabled(512),
/**
* Representing QTreeWidgetItemIterator:: HasChildren
*/
HasChildren(1024),
/**
* Representing QTreeWidgetItemIterator:: NoChildren
*/
NoChildren(2048),
/**
* Representing QTreeWidgetItemIterator:: Checked
*/
Checked(4096),
/**
* Representing QTreeWidgetItemIterator:: NotChecked
*/
NotChecked(8192),
/**
* Representing QTreeWidgetItemIterator:: Enabled
*/
Enabled(16384),
/**
* Representing QTreeWidgetItemIterator:: Disabled
*/
Disabled(32768),
/**
* Representing QTreeWidgetItemIterator:: Editable
*/
Editable(65536),
/**
* Representing QTreeWidgetItemIterator:: NotEditable
*/
NotEditable(131072),
/**
* Representing QTreeWidgetItemIterator:: UserFlag
*/
UserFlag(16777216);
static {
QtJambi_LibraryUtilities.initialize();
}
private IteratorFlag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
@Override
public @NonNull IteratorFlags asFlags() {
return new IteratorFlags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull IteratorFlags combined(@NonNull IteratorFlag 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 IteratorFlags cleared(@NonNull IteratorFlag e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link IteratorFlags} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull IteratorFlags flags(@Nullable IteratorFlag @NonNull... values) {
return new IteratorFlags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull IteratorFlag resolve(int value) {
switch (value) {
case 0: return All;
case 1: return Hidden;
case 2: return NotHidden;
case 4: return Selected;
case 8: return Unselected;
case 16: return Selectable;
case 32: return NotSelectable;
case 64: return DragEnabled;
case 128: return DragDisabled;
case 256: return DropEnabled;
case 512: return DropDisabled;
case 1024: return HasChildren;
case 2048: return NoChildren;
case 4096: return Checked;
case 8192: return NotChecked;
case 16384: return Enabled;
case 32768: return Disabled;
case 65536: return Editable;
case 131072: return NotEditable;
case 16777216: return UserFlag;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link IteratorFlag}
*/
public static final class IteratorFlags extends QFlags implements Comparable {
private static final long serialVersionUID = 0x865c6d2218f00d2fL;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new IteratorFlags where the flags in args
are set.
* @param args enum entries
*/
public IteratorFlags(@Nullable IteratorFlag @NonNull... args){
super(args);
}
/**
* Creates a new IteratorFlags with given value
.
* @param value
*/
public IteratorFlags(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new IteratorFlags
*/
@Override
public final @NonNull IteratorFlags combined(@StrictNonNull IteratorFlag e){
return new IteratorFlags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
@Override
public final @NonNull IteratorFlags setFlag(@Nullable IteratorFlag e){
return setFlag(e, true);
}
/**
* Sets or clears the flag flag
* @param e enum entry
* @param on set (true) or clear (false)
* @return this
*/
@Override
public final @NonNull IteratorFlags setFlag(@Nullable IteratorFlag 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 IteratorFlags.
* @return array of enum entries
*/
@Override
public final @NonNull IteratorFlag @NonNull[] flags(){
return super.flags(IteratorFlag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull IteratorFlags clone(){
return new IteratorFlags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull IteratorFlags other){
return Integer.compare(value(), other.value());
}
}
/**
*
* @param widget
* @param flags
*/
public QTreeWidgetItemIterator(io.qt.widgets.@StrictNonNull QTreeWidget widget, io.qt.widgets.QTreeWidgetItemIterator.@NonNull IteratorFlags flags){
super((QPrivateConstructor)null);
java.util.Objects.requireNonNull(widget, "Argument 'widget': null not expected.");
initialize_native(this, widget, flags);
QtJambi_LibraryUtilities.internal.registerDependentObject(this, widget);
}
private native static void initialize_native(QTreeWidgetItemIterator instance, io.qt.widgets.QTreeWidget widget, io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags flags);
/**
*
* @param item
* @param flags
*/
public QTreeWidgetItemIterator(io.qt.widgets.@Nullable QTreeWidgetItem item, io.qt.widgets.QTreeWidgetItemIterator.@NonNull IteratorFlags flags){
super((QPrivateConstructor)null);
if (item == null)
throw new NullPointerException("Argument 'item': null not expected.");
else if(item.treeWidget()==null)
throw new IllegalArgumentException("Item does not belong to a tree widget.");
initialize_native(this, item, flags);
QtJambi_LibraryUtilities.internal.registerDependentObject(this, item.treeWidget());
}
private native static void initialize_native(QTreeWidgetItemIterator instance, io.qt.widgets.QTreeWidgetItem item, io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags flags);
/**
* See QTreeWidgetItemIterator:: operator*()const
* @return
*/
@QtUninvokable
public final boolean hasNext(){
return hasNext_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native boolean hasNext_native_constfct(long __this__nativeId);
/**
* See QTreeWidgetItemIterator:: operator++()
* @return
*/
@QtUninvokable
public final io.qt.widgets.@Nullable QTreeWidgetItem next(){
return next_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native io.qt.widgets.@Nullable QTreeWidgetItem next_native(long __this__nativeId);
/**
* See QTreeWidgetItemIterator:: operator=(QTreeWidgetItemIterator)
* @param it
*/
@QtUninvokable
public final void assign(io.qt.widgets.@StrictNonNull QTreeWidgetItemIterator it){
java.util.Objects.requireNonNull(it, "Argument 'it': null not expected.");
assign_native_cref_QTreeWidgetItemIterator(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(it));
}
@QtUninvokable
private native void assign_native_cref_QTreeWidgetItemIterator(long __this__nativeId, long it);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QTreeWidgetItemIterator(QPrivateConstructor p) { super(p); }
// TEMPLATE - core.self_iterator - START
@Override
@QtUninvokable
public final java.util.@NonNull Iterator iterator() {
return this;
}
// TEMPLATE - core.self_iterator - END
/**
* Overloaded constructor for {@link #QTreeWidgetItemIterator(io.qt.widgets.QTreeWidget, io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags)}
* with flags = new io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags(0)
.
*/
public QTreeWidgetItemIterator(io.qt.widgets.@StrictNonNull QTreeWidget widget) {
this(widget, new io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags(0));
}
/**
* Overloaded constructor for {@link #QTreeWidgetItemIterator(io.qt.widgets.QTreeWidget, io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags)}.
*/
public QTreeWidgetItemIterator(io.qt.widgets.@StrictNonNull QTreeWidget widget, io.qt.widgets.QTreeWidgetItemIterator.@NonNull IteratorFlag @NonNull... flags) {
this(widget, new io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags(flags));
}
/**
* Overloaded constructor for {@link #QTreeWidgetItemIterator(io.qt.widgets.QTreeWidgetItem, io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags)}
* with flags = new io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags(0)
.
*/
public QTreeWidgetItemIterator(io.qt.widgets.@Nullable QTreeWidgetItem item) {
this(item, new io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags(0));
}
/**
* Overloaded constructor for {@link #QTreeWidgetItemIterator(io.qt.widgets.QTreeWidgetItem, io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags)}.
*/
public QTreeWidgetItemIterator(io.qt.widgets.@Nullable QTreeWidgetItem item, io.qt.widgets.QTreeWidgetItemIterator.@NonNull IteratorFlag @NonNull... flags) {
this(item, new io.qt.widgets.QTreeWidgetItemIterator.IteratorFlags(flags));
}
}