All Downloads are FREE. Search and download functionalities are using the official Maven repository.

system.windows.documents.TextPointer Maven / Gradle / Ivy

/*
 *  MIT License
 *
 *  Copyright (c) 2024 MASES s.r.l.
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in all
 *  copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *  SOFTWARE.
 */

/**************************************************************************************
 * 
 *      This code was generated from a template using JCOReflector v. 1.14.0.0
 * 
 *      Manual changes to this file may cause unexpected behavior in your application.
 *      Manual changes to this file will be overwritten if the code is regenerated.
 * 
 *************************************************************************************/

package system.windows.documents;

import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;

// Import section
import system.windows.documents.ContentPosition;
import system.windows.documents.TextPointer;
import system.windows.documents.LogicalDirection;
import system.windows.DependencyObject;
import system.windows.documents.TextPointerContext;
import system.windows.Rect;
import system.windows.documents.Paragraph;


/**
 * The base .NET class managing System.Windows.Documents.TextPointer, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
 * 

* * .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Documents.TextPointer *

* * Powered by JCOBridge: more info at https://www.jcobridge.com * * @author MASES s.r.l https://masesgroup.com * @version 1.14.0.0 */ public class TextPointer extends ContentPosition { /** * Fully assembly qualified name: PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 */ public static final String assemblyFullName = "PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; /** * Assembly name: PresentationFramework */ public static final String assemblyShortName = "PresentationFramework"; /** * Qualified class name: System.Windows.Documents.TextPointer */ public static final String className = "System.Windows.Documents.TextPointer"; static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName); /** * The type managed from JCOBridge. See {@link JCType} */ public static JCType classType = createType(); static JCEnum enumInstance = null; JCObject classInstance = null; static JCType createType() { try { String classToCreate = className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); if (JCOReflector.getDebug()) JCOReflector.writeLog("Creating %s", classToCreate); JCType typeCreated = bridge.GetType(classToCreate); if (JCOReflector.getDebug()) JCOReflector.writeLog("Created: %s", (typeCreated != null) ? typeCreated.toString() : "Returned null value"); return typeCreated; } catch (JCException e) { JCOReflector.writeLog(e); return null; } } void addReference(String ref) throws Throwable { try { bridge.AddReference(ref); } catch (JCNativeException jcne) { throw translateException(jcne); } } /** * Internal constructor. Use with caution */ public TextPointer(java.lang.Object instance) throws Throwable { super(instance); if (instance instanceof JCObject) { classInstance = (JCObject) instance; } else throw new Exception("Cannot manage object, it is not a JCObject"); } public String getJCOAssemblyName() { return assemblyFullName; } public String getJCOClassName() { return className; } public String getJCOObjectName() { return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); } public java.lang.Object getJCOInstance() { return classInstance; } public void setJCOInstance(JCObject instance) { classInstance = instance; super.setJCOInstance(classInstance); } public JCType getJCOType() { return classType; } /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link TextPointer}, a cast assert is made to check if types are compatible. * @param from {@link IJCOBridgeReflected} instance to be casted * @return {@link TextPointer} instance * @throws java.lang.Throwable in case of error during cast operation */ public static TextPointer cast(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new TextPointer(from.getJCOInstance()); } // Constructors section public TextPointer() throws Throwable { } // Methods section public boolean IsInSameDocument(TextPointer textPosition) throws Throwable, system.ArgumentNullException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (boolean)classInstance.Invoke("IsInSameDocument", textPosition == null ? null : textPosition.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public int CompareTo(TextPointer position) throws Throwable, system.ArgumentNullException, system.FormatException, system.resources.MissingManifestResourceException, system.NotImplementedException, system.ArgumentException, system.ObjectDisposedException, system.InvalidOperationException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (int)classInstance.Invoke("CompareTo", position == null ? null : position.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public int DeleteTextInRun(int count) throws Throwable, system.ArgumentException, system.ArgumentNullException, system.NotSupportedException, system.security.SecurityException, system.ObjectDisposedException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.resources.MissingManifestResourceException, system.NotImplementedException, system.componentmodel.InvalidEnumArgumentException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (int)classInstance.Invoke("DeleteTextInRun", count); } catch (JCNativeException jcne) { throw translateException(jcne); } } public int GetOffsetToPosition(TextPointer position) throws Throwable, system.ArgumentNullException, system.FormatException, system.resources.MissingManifestResourceException, system.NotImplementedException, system.ArgumentException, system.ObjectDisposedException, system.InvalidOperationException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (int)classInstance.Invoke("GetOffsetToPosition", position == null ? null : position.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public int GetTextInRun(LogicalDirection direction, char[] textBuffer, int startIndex, int count) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException, system.componentmodel.InvalidEnumArgumentException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (int)classInstance.Invoke("GetTextInRun", direction == null ? null : direction.getJCOInstance(), textBuffer, startIndex, count); } catch (JCNativeException jcne) { throw translateException(jcne); } } public int GetTextInRun(LogicalDirection dupParam0, JCORefOut dupParam1, int dupParam2, int dupParam3) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException, system.componentmodel.InvalidEnumArgumentException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (int)classInstance.Invoke("GetTextInRun", dupParam0 == null ? null : dupParam0.getJCOInstance(), dupParam1.getJCRefOut(), dupParam2, dupParam3); } catch (JCNativeException jcne) { throw translateException(jcne); } } public int GetTextRunLength(LogicalDirection direction) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException, system.componentmodel.InvalidEnumArgumentException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (int)classInstance.Invoke("GetTextRunLength", direction == null ? null : direction.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public java.lang.String GetTextInRun(LogicalDirection direction) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException, system.componentmodel.InvalidEnumArgumentException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (java.lang.String)classInstance.Invoke("GetTextInRun", direction == null ? null : direction.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public DependencyObject GetAdjacentElement(LogicalDirection direction) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException, system.componentmodel.InvalidEnumArgumentException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetAdjacentElement = (JCObject)classInstance.Invoke("GetAdjacentElement", direction == null ? null : direction.getJCOInstance()); return new DependencyObject(objGetAdjacentElement); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer GetInsertionPosition(LogicalDirection direction) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetInsertionPosition = (JCObject)classInstance.Invoke("GetInsertionPosition", direction == null ? null : direction.getJCOInstance()); return new TextPointer(objGetInsertionPosition); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer GetLineStartPosition(int count) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.FormatException, system.componentmodel.InvalidEnumArgumentException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetLineStartPosition = (JCObject)classInstance.Invoke("GetLineStartPosition", count); return new TextPointer(objGetLineStartPosition); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer GetLineStartPosition(int count, JCORefOut actualCount) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.security.SecurityException, system.io.IOException, system.InvalidOperationException, system.resources.MissingManifestResourceException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.FormatException, system.componentmodel.InvalidEnumArgumentException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetLineStartPosition = (JCObject)classInstance.Invoke("GetLineStartPosition", count, actualCount.getJCRefOut()); return new TextPointer(objGetLineStartPosition); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer GetNextContextPosition(LogicalDirection direction) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetNextContextPosition = (JCObject)classInstance.Invoke("GetNextContextPosition", direction == null ? null : direction.getJCOInstance()); return new TextPointer(objGetNextContextPosition); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer GetNextInsertionPosition(LogicalDirection direction) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetNextInsertionPosition = (JCObject)classInstance.Invoke("GetNextInsertionPosition", direction == null ? null : direction.getJCOInstance()); return new TextPointer(objGetNextInsertionPosition); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer GetPositionAtOffset(int offset) throws Throwable, system.ArgumentException, system.InvalidOperationException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetPositionAtOffset = (JCObject)classInstance.Invoke("GetPositionAtOffset", offset); return new TextPointer(objGetPositionAtOffset); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer GetPositionAtOffset(int offset, LogicalDirection direction) throws Throwable, system.ArgumentException, system.security.SecurityException, system.io.IOException, system.InvalidOperationException, system.ArgumentNullException, system.resources.MissingManifestResourceException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetPositionAtOffset = (JCObject)classInstance.Invoke("GetPositionAtOffset", offset, direction == null ? null : direction.getJCOInstance()); return new TextPointer(objGetPositionAtOffset); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer InsertLineBreak() throws Throwable, system.ArgumentException, system.ArgumentNullException, system.NotSupportedException, system.security.SecurityException, system.ObjectDisposedException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.resources.MissingManifestResourceException, system.componentmodel.InvalidEnumArgumentException, system.MissingMethodException, system.reflection.TargetInvocationException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objInsertLineBreak = (JCObject)classInstance.Invoke("InsertLineBreak"); return new TextPointer(objInsertLineBreak); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer InsertParagraphBreak() throws Throwable, system.ArgumentException, system.ArgumentNullException, system.NotSupportedException, system.security.SecurityException, system.ObjectDisposedException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.resources.MissingManifestResourceException, system.FormatException, system.reflection.AmbiguousMatchException, system.componentmodel.InvalidEnumArgumentException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objInsertParagraphBreak = (JCObject)classInstance.Invoke("InsertParagraphBreak"); return new TextPointer(objInsertParagraphBreak); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointerContext GetPointerContext(LogicalDirection direction) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException, system.componentmodel.InvalidEnumArgumentException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetPointerContext = (JCObject)classInstance.Invoke("GetPointerContext", direction == null ? null : direction.getJCOInstance()); return new TextPointerContext(objGetPointerContext); } catch (JCNativeException jcne) { throw translateException(jcne); } } public Rect GetCharacterRect(LogicalDirection direction) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.NotImplementedException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException, system.componentmodel.InvalidEnumArgumentException, system.NotSupportedException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetCharacterRect = (JCObject)classInstance.Invoke("GetCharacterRect", direction == null ? null : direction.getJCOInstance()); return new Rect(objGetCharacterRect); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void InsertTextInRun(java.lang.String textData) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.NotSupportedException, system.security.SecurityException, system.ObjectDisposedException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.resources.MissingManifestResourceException, system.componentmodel.InvalidEnumArgumentException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("InsertTextInRun", textData); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Properties section public boolean getHasValidLayout() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (boolean)classInstance.Get("HasValidLayout"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public boolean getIsAtInsertionPosition() throws Throwable, system.ArgumentException, system.ArgumentNullException, system.NotSupportedException, system.security.SecurityException, system.ObjectDisposedException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.resources.MissingManifestResourceException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (boolean)classInstance.Get("IsAtInsertionPosition"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public boolean getIsAtLineStartPosition() throws Throwable, system.ArgumentException, system.ArgumentNullException, system.NotSupportedException, system.security.SecurityException, system.ObjectDisposedException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.resources.MissingManifestResourceException, system.NotImplementedException, system.componentmodel.InvalidEnumArgumentException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (boolean)classInstance.Get("IsAtLineStartPosition"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public DependencyObject getParent() throws Throwable, system.ArgumentException, system.ArgumentNullException, system.NotSupportedException, system.security.SecurityException, system.ObjectDisposedException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.resources.MissingManifestResourceException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("Parent"); return new DependencyObject(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public LogicalDirection getLogicalDirection() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("LogicalDirection"); return new LogicalDirection(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public Paragraph getParagraph() throws Throwable, system.ArgumentException, system.ArgumentNullException, system.NotSupportedException, system.security.SecurityException, system.ObjectDisposedException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.resources.MissingManifestResourceException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("Paragraph"); return new Paragraph(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer getDocumentEnd() throws Throwable, system.ArgumentException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentNullException, system.InvalidOperationException, system.resources.MissingManifestResourceException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("DocumentEnd"); return new TextPointer(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public TextPointer getDocumentStart() throws Throwable, system.ArgumentException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException, system.ArgumentNullException, system.InvalidOperationException, system.resources.MissingManifestResourceException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("DocumentStart"); return new TextPointer(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Instance Events section }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy