io.qt.core.QStringConverterBase Maven / Gradle / Ivy
Show all versions of qtjambi Show documentation
package io.qt.core;
import io.qt.*;
/**
* Java wrapper for Qt class QStringConverterBase
*/
public class QStringConverterBase extends QtObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Java wrapper for Qt enum QStringConverterBase::Flag
*
* @see Flags
*/
public enum Flag implements QtFlagEnumerator {
/**
* Representing QStringConverterBase:: Flag:: Default
*/
Default(0),
/**
* Representing QStringConverterBase:: Flag:: Stateless
*/
Stateless(1),
/**
* Representing QStringConverterBase:: Flag:: ConvertInvalidToNull
*/
ConvertInvalidToNull(2),
/**
* Representing QStringConverterBase:: Flag:: WriteBom
*/
WriteBom(4),
/**
* Representing QStringConverterBase:: Flag:: ConvertInitialBom
*/
ConvertInitialBom(8),
/**
* Representing QStringConverterBase:: Flag:: UsesIcu
*/
UsesIcu(16);
static {
QtJambi_LibraryUtilities.initialize();
}
private Flag(int value) {
this.value = value;
}
/**
* {@inheritDoc}
*/
@Override
public int value() {
return value;
}
/**
* Create a QFlags of the enum entry.
* @return QFlags
*/
@Override
public @NonNull Flags asFlags() {
return new Flags(value);
}
/**
* Combines this entry with other enum entry.
* @param e enum entry
* @return new flag
*/
public @NonNull Flags combined(@NonNull Flag 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 Flags cleared(@NonNull Flag e) {
return asFlags().setFlag(e, false);
}
/**
* Creates a new {@link Flags} from the entries.
* @param values entries
* @return new flag
*/
public static @NonNull Flags flags(@Nullable Flag @NonNull... values) {
return new Flags(values);
}
/**
* Returns the corresponding enum entry for the given value.
* @param value
* @return enum entry
*/
public static @NonNull Flag resolve(int value) {
switch (value) {
case 0: return Default;
case 1: return Stateless;
case 2: return ConvertInvalidToNull;
case 4: return WriteBom;
case 8: return ConvertInitialBom;
case 16: return UsesIcu;
default: throw new QNoSuchEnumValueException(value);
}
}
private final int value;
}
/**
* {@link QFlags} type for enum {@link Flag}
*/
public static final class Flags extends QFlags implements Comparable {
private static final long serialVersionUID = 0x92d9bce6c929c1c6L;
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* Creates a new Flags where the flags in args
are set.
* @param args enum entries
*/
public Flags(@Nullable Flag @NonNull... args){
super(args);
}
/**
* Creates a new Flags with given value
.
* @param value
*/
public Flags(int value) {
super(value);
}
/**
* Combines this flags with enum entry.
* @param e enum entry
* @return new Flags
*/
@Override
public final @NonNull Flags combined(@StrictNonNull Flag e){
return new Flags(value() | e.value());
}
/**
* Sets the flag e
* @param e enum entry
* @return this
*/
@Override
public final @NonNull Flags setFlag(@Nullable Flag 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 Flags setFlag(@Nullable Flag 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 Flags.
* @return array of enum entries
*/
@Override
public final @NonNull Flag @NonNull[] flags(){
return super.flags(Flag.values());
}
/**
* {@inheritDoc}
*/
@Override
public final @NonNull Flags clone(){
return new Flags(value());
}
/**
* {@inheritDoc}
*/
@Override
public final int compareTo(@StrictNonNull Flags other){
return Integer.compare(value(), other.value());
}
}
/**
* Java wrapper for Qt class QStringConverterBase::State
*/
public static class State extends QtObject
{
static {
QtJambi_LibraryUtilities.initialize();
}
/**
* See QStringConverterBase::State:: State(QStringConverterBase::Flags)
* @param f
*/
public State(io.qt.core.QStringConverterBase.@NonNull Flags f){
super((QPrivateConstructor)null);
initialize_native(this, f);
}
private native static void initialize_native(State instance, io.qt.core.QStringConverterBase.Flags f);
/**
* See QStringConverterBase::State:: clear()
*/
@QtUninvokable
public final void clear(){
clear_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void clear_native(long __this__nativeId);
/**
* See QStringConverterBase::State:: reset()
*/
@QtUninvokable
public final void reset(){
reset_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native void reset_native(long __this__nativeId);
/**
* See QStringConverterBase::State:: flags
* @return
*/
@QtUninvokable
public final io.qt.core.QStringConverterBase.@NonNull Flags flags(){
return new io.qt.core.QStringConverterBase.Flags(flags_native(QtJambi_LibraryUtilities.internal.nativeId(this)));
}
@QtUninvokable
private native int flags_native(long __this__nativeId);
/**
* See QStringConverterBase::State:: internalState
* @param internalState
*/
@QtUninvokable
public final void setInternalState(int internalState){
setInternalState_native_int(QtJambi_LibraryUtilities.internal.nativeId(this), internalState);
}
@QtUninvokable
private native void setInternalState_native_int(long __this__nativeId, int internalState);
/**
* See QStringConverterBase::State:: internalState
* @return
*/
@QtUninvokable
public final int internalState(){
return internalState_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native int internalState_native(long __this__nativeId);
/**
* See QStringConverterBase::State:: invalidChars
* @param invalidChars
*/
@QtUninvokable
public final void setInvalidChars(long invalidChars){
setInvalidChars_native_qsizetype(QtJambi_LibraryUtilities.internal.nativeId(this), invalidChars);
}
@QtUninvokable
private native void setInvalidChars_native_qsizetype(long __this__nativeId, long invalidChars);
/**
* See QStringConverterBase::State:: invalidChars
* @return
*/
@QtUninvokable
public final long invalidChars(){
return invalidChars_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long invalidChars_native(long __this__nativeId);
/**
* See QStringConverterBase::State:: remainingChars
* @param remainingChars
*/
@QtUninvokable
public final void setRemainingChars(long remainingChars){
setRemainingChars_native_qsizetype(QtJambi_LibraryUtilities.internal.nativeId(this), remainingChars);
}
@QtUninvokable
private native void setRemainingChars_native_qsizetype(long __this__nativeId, long remainingChars);
/**
* See QStringConverterBase::State:: remainingChars
* @return
*/
@QtUninvokable
public final long remainingChars(){
return remainingChars_native(QtJambi_LibraryUtilities.internal.nativeId(this));
}
@QtUninvokable
private native long remainingChars_native(long __this__nativeId);
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected State(QPrivateConstructor p) { super(p); }
/**
* Overloaded constructor for {@link #State(io.qt.core.QStringConverterBase.Flags)}
* with f = new io.qt.core.QStringConverterBase.Flags(0)
.
*/
public State() {
this(new io.qt.core.QStringConverterBase.Flags(0));
}
/**
* Overloaded constructor for {@link #State(io.qt.core.QStringConverterBase.Flags)}.
*/
public State(io.qt.core.QStringConverterBase.@NonNull Flag @NonNull... f) {
this(new io.qt.core.QStringConverterBase.Flags(f));
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #flags()} instead.
*/
@QtUninvokable
public final io.qt.core.QStringConverterBase.@NonNull Flags getFlags() {
return flags();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #internalState()} instead.
*/
@QtUninvokable
public final int getInternalState() {
return internalState();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #invalidChars()} instead.
*/
@QtUninvokable
public final long getInvalidChars() {
return invalidChars();
}
/**
* @hidden
* Kotlin property getter. In Java use {@link #remainingChars()} instead.
*/
@QtUninvokable
public final long getRemainingChars() {
return remainingChars();
}
}
/**
* Constructor for internal use only.
* @param p expected to be null
.
* @hidden
*/
@NativeAccess
protected QStringConverterBase(QPrivateConstructor p) { super(p); }
}