diff --git a/examples/jinx-com4j-examples.xlsx b/examples/jinx-com4j-examples.xlsx index 63f02ee..d50c64a 100644 Binary files a/examples/jinx-com4j-examples.xlsx and b/examples/jinx-com4j-examples.xlsx differ diff --git a/examples/pom.xml b/examples/pom.xml index 896192d..d9d04c8 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -5,7 +5,7 @@ com.exceljava jinx-com4j-root - 1.0-SNAPSHOT + 1.1.0 .. 4.0.0 @@ -16,6 +16,7 @@ org.apache.maven.plugins maven-compiler-plugin + 3.8.1 1.8 1.8 @@ -27,12 +28,12 @@ com.exceljava jinx-com4j - 1.0-SNAPSHOT + 1.1.0 com.exceljava jinx - 1.6.0 + [2.0.0,) diff --git a/examples/src/main/java/com/exceljava/com4j/examples/MacroFunctions.java b/examples/src/main/java/com/exceljava/com4j/examples/MacroFunctions.java index 0c88d4e..a22477f 100644 --- a/examples/src/main/java/com/exceljava/com4j/examples/MacroFunctions.java +++ b/examples/src/main/java/com/exceljava/com4j/examples/MacroFunctions.java @@ -5,7 +5,11 @@ import com.exceljava.com4j.JinxBridge; import com.exceljava.com4j.excel.*; -import com4j.Com4jObject; +import com.exceljava.jinx.ExcelReference; +import com.exceljava.jinx.IUnknown; + +import javax.swing.*; +import java.awt.*; /** * Example macros that use com4j to call back into Excel @@ -76,4 +80,32 @@ public void scrollbarExample() { // Set the cell value from the scrollbar value range.setValue(scrollbar.getValue()); } + + @ExcelMacro( + value = "jinx.show_object_example", + shortcut = "Ctrl+Shift+I" + ) + public void showObject() throws HeadlessException { + // Get the current selection + _Application app = JinxBridge.getApplication(xl); + Range selection = app.getSelection().queryInterface(Range.class); + + // Ensure the cell is calculated + selection.setFormula(selection.getFormula()); + selection.calculate(); + + // Get an ExcelReference corresponding to the selection + IUnknown unk = JinxBridge.getIUnknown(selection); + ExcelReference cell = xl.getReference(unk); + + // Find the cached object for this cell + Object cachedObject = xl.getCachedObject(cell); + + // Popup a non-modal dialog with the string representation of the object + String message = cachedObject != null ? cachedObject.toString() : "NULL"; + JOptionPane pane = new JOptionPane(message, JOptionPane.INFORMATION_MESSAGE); + JDialog dialog = pane.createDialog("Java Object"); + dialog.setModal(false); + dialog.setVisible(true); + } } diff --git a/jinx-com4j/pom.xml b/jinx-com4j/pom.xml index 2f8abab..d56ae5d 100644 --- a/jinx-com4j/pom.xml +++ b/jinx-com4j/pom.xml @@ -5,7 +5,7 @@ com.exceljava jinx-com4j-root - 1.0-SNAPSHOT + 1.1.0 .. 4.0.0 @@ -26,7 +26,7 @@ com.exceljava jinx - [1.0.0,) + [2.0.0,) @@ -47,6 +47,7 @@ org.apache.maven.plugins maven-compiler-plugin + 3.8.1 1.8 1.8 diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/IUnknownAdaptor.java b/jinx-com4j/src/main/java/com/exceljava/com4j/IUnknownAdaptor.java new file mode 100644 index 0000000..5f194de --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/IUnknownAdaptor.java @@ -0,0 +1,48 @@ +package com.exceljava.com4j; + +import com.exceljava.jinx.IUnknown; +import com4j.Com4jObject; + +/** + * Adaptor class that implements the IUnknown interface + * wrapping a Com4jObject instance. + */ +class IUnknownAdaptor implements IUnknown { + private Com4jObject obj; + + public IUnknownAdaptor(Com4jObject obj) { + this.obj = obj; + } + + private static Class adaptClass(Class cls) { + return (Class)cls; + } + + @Override + public T queryInterface(Class cls) { + Com4jObject obj = this.obj; + if (null != obj && cls.isAssignableFrom(Com4jObject.class)) { + return obj.queryInterface(adaptClass(cls)); + } + return null; + } + + @Override + public long getPointer(boolean addRef) { + if (addRef) { + throw new UnsupportedOperationException(); + } + + Com4jObject obj = this.obj; + if (null != obj) { + return obj.getIUnknownPointer(); + } + + return 0; + } + + @Override + public void close() { + this.obj = null; + } +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/JinxBridge.java b/jinx-com4j/src/main/java/com/exceljava/com4j/JinxBridge.java index 08b6ed0..3e08761 100644 --- a/jinx-com4j/src/main/java/com/exceljava/com4j/JinxBridge.java +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/JinxBridge.java @@ -1,24 +1,18 @@ package com.exceljava.com4j; import com.exceljava.jinx.ExcelAddIn; +import com.exceljava.jinx.ExcelArgumentConverter; +import com.exceljava.jinx.IUnknown; import com.exceljava.com4j.excel._Application; import com4j.COM4J; import com4j.Com4jObject; -import com4j.ComThread; -import com4j.ROT; + /** * Bridge between the Jinx add-in and com4j. * Used for obtaining com4j COM wrappers from code running in Excel using Jinx. */ public class JinxBridge { - - private static final ThreadLocal<_Application> xlApp = new ThreadLocal<_Application>() { - public _Application initialValue() { - return null; - } - }; - /** * Gets the Excel Application object for the current Excel process. * @@ -34,7 +28,37 @@ public _Application initialValue() { * @return An Excel Application instance. */ public static _Application getApplication(ExcelAddIn xl) { - Com4jObject unk = COM4J.wrapSta(Com4jObject.class, xl.getExcelApplication()); - return unk.queryInterface(_Application.class); + return xl.getExcelApplication(_Application.class); + } + + /** + * Return an IUnknown instance that wraps a Com4jObject. + * + * This can be used for passing Com4jObjects back to Jinx + * methods requiring an IUnknown instance. + * + * @param object COM object to be wrapped as an IUnknown. + * @return Instance implementing IUnknown. + */ + public static IUnknown getIUnknown(Com4jObject object) { + return new IUnknownAdaptor(object); + } + + /** + * Converts IUnknown to any Com4jObject type. + * + * This allows Com4jObjects to be used as method arguments where + * an IUnknown would be passed by Jinx. For example, in the + * ribbon actions. + * + * @param unk IUnknown instance. + * @param cls Class of type to cast to. + * @param Type to cast to. + * @return IUnknown instance cast to a Com4jObject instance. + */ + @ExcelArgumentConverter + public static T convertIUnknown(IUnknown unk, Class cls) { + Com4jObject obj = COM4J.wrapSta(Com4jObject.class, unk.getPointer(true)); + return obj.queryInterface(cls); } } diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/excel/Author.java b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/Author.java new file mode 100644 index 0000000..06755e1 --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/Author.java @@ -0,0 +1,75 @@ +package com.exceljava.com4j.excel ; + +import com4j.*; + +@IID("{00020400-0000-0000-C000-000000000046}") +public interface Author extends Com4jObject { + // Methods: + /** + *

+ * Getter method for the COM property "Application" + *

+ */ + + @DISPID(148) + @PropGet + com.exceljava.com4j.excel._Application getApplication(); + + + /** + *

+ * Getter method for the COM property "Creator" + *

+ */ + + @DISPID(149) + @PropGet + com.exceljava.com4j.excel.XlCreator getCreator(); + + + /** + *

+ * Getter method for the COM property "Parent" + *

+ */ + + @DISPID(150) + @PropGet + com4j.Com4jObject getParent(); + + + /** + *

+ * Getter method for the COM property "Name" + *

+ */ + + @DISPID(110) + @PropGet + java.lang.String getName(); + + + /** + *

+ * Getter method for the COM property "ProviderID" + *

+ */ + + @DISPID(3286) + @PropGet + java.lang.String getProviderID(); + + + /** + *

+ * Getter method for the COM property "UserID" + *

+ */ + + @DISPID(3287) + @PropGet + java.lang.String getUserID(); + + + // Properties: +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/excel/CommentThreaded.java b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/CommentThreaded.java new file mode 100644 index 0000000..5a2f1fa --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/CommentThreaded.java @@ -0,0 +1,211 @@ +package com.exceljava.com4j.excel ; + +import com4j.*; + +@IID("{00020400-0000-0000-C000-000000000046}") +public interface CommentThreaded extends Com4jObject { + // Methods: + /** + *

+ * Getter method for the COM property "Application" + *

+ */ + + @DISPID(148) + @PropGet + com.exceljava.com4j.excel._Application getApplication(); + + + /** + *

+ * Getter method for the COM property "Creator" + *

+ */ + + @DISPID(149) + @PropGet + com.exceljava.com4j.excel.XlCreator getCreator(); + + + /** + *

+ * Getter method for the COM property "Parent" + *

+ */ + + @DISPID(150) + @PropGet + com4j.Com4jObject getParent(); + + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • java.lang.Object parameter text is set to com4j.Variant.getMissing()
+ *

+ * Therefore, using this method is equivalent to + * + * addReply(com4j.Variant.getMissing()); + * + *

+ */ + + @DISPID(3283) + @UseDefaultValues(paramIndexMapping = {}, optParamIndex = {0}, javaType = {java.lang.Object.class}, nativeType = {NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR}, literal = {"80020004"}) + @ReturnValue(index=-1) + com.exceljava.com4j.excel.CommentThreaded addReply(); + + /** + * @param text Optional parameter. Default value is com4j.Variant.getMissing() + */ + + @DISPID(3283) + com.exceljava.com4j.excel.CommentThreaded addReply( + @Optional java.lang.Object text); + + + /** + */ + + @DISPID(117) + void delete(); + + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • java.lang.Object parameter text is set to com4j.Variant.getMissing()
  • java.lang.Object parameter start is set to com4j.Variant.getMissing()
  • java.lang.Object parameter overwrite is set to com4j.Variant.getMissing()
+ *

+ * Therefore, using this method is equivalent to + * + * text(com4j.Variant.getMissing(), com4j.Variant.getMissing(), com4j.Variant.getMissing()); + * + *

+ */ + + @DISPID(138) + @UseDefaultValues(paramIndexMapping = {}, optParamIndex = {0, 1, 2}, javaType = {java.lang.Object.class, java.lang.Object.class, java.lang.Object.class}, nativeType = {NativeType.VARIANT, NativeType.VARIANT, NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR, Variant.Type.VT_ERROR, Variant.Type.VT_ERROR}, literal = {"80020004", "80020004", "80020004"}) + @ReturnValue(index=-1) + java.lang.String text(); + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • java.lang.Object parameter start is set to com4j.Variant.getMissing()
  • java.lang.Object parameter overwrite is set to com4j.Variant.getMissing()
+ *

+ * Therefore, using this method is equivalent to + * + * text(text, com4j.Variant.getMissing(), com4j.Variant.getMissing()); + * + *

+ * @param text Optional parameter. Default value is com4j.Variant.getMissing() + */ + + @DISPID(138) + @UseDefaultValues(paramIndexMapping = {0}, optParamIndex = {1, 2}, javaType = {java.lang.Object.class, java.lang.Object.class}, nativeType = {NativeType.VARIANT, NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR, Variant.Type.VT_ERROR}, literal = {"80020004", "80020004"}) + @ReturnValue(index=-1) + java.lang.String text( + @Optional java.lang.Object text); + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • java.lang.Object parameter overwrite is set to com4j.Variant.getMissing()
+ *

+ * Therefore, using this method is equivalent to + * + * text(text, start, com4j.Variant.getMissing()); + * + *

+ * @param text Optional parameter. Default value is com4j.Variant.getMissing() + * @param start Optional parameter. Default value is com4j.Variant.getMissing() + */ + + @DISPID(138) + @UseDefaultValues(paramIndexMapping = {0, 1}, optParamIndex = {2}, javaType = {java.lang.Object.class}, nativeType = {NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR}, literal = {"80020004"}) + @ReturnValue(index=-1) + java.lang.String text( + @Optional java.lang.Object text, + @Optional java.lang.Object start); + + /** + * @param text Optional parameter. Default value is com4j.Variant.getMissing() + * @param start Optional parameter. Default value is com4j.Variant.getMissing() + * @param overwrite Optional parameter. Default value is com4j.Variant.getMissing() + */ + + @DISPID(138) + java.lang.String text( + @Optional java.lang.Object text, + @Optional java.lang.Object start, + @Optional java.lang.Object overwrite); + + + /** + *

+ * Getter method for the COM property "SupportsReplies" + *

+ */ + + @DISPID(3284) + @PropGet + boolean getSupportsReplies(); + + + /** + *

+ * Getter method for the COM property "Replies" + *

+ */ + + @DISPID(3285) + @PropGet + com.exceljava.com4j.excel.CommentsThreaded getReplies(); + + + /** + *

+ * Getter method for the COM property "Author" + *

+ */ + + @DISPID(574) + @PropGet + com.exceljava.com4j.excel.Author getAuthor(); + + + /** + *

+ * Getter method for the COM property "Date" + *

+ */ + + @DISPID(465) + @PropGet + java.lang.Object getDate(); + + + /** + */ + + @DISPID(502) + com.exceljava.com4j.excel.CommentThreaded next(); + + + /** + */ + + @DISPID(503) + com.exceljava.com4j.excel.CommentThreaded previous(); + + + // Properties: +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/excel/CommentsThreaded.java b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/CommentsThreaded.java new file mode 100644 index 0000000..b574c79 --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/CommentsThreaded.java @@ -0,0 +1,86 @@ +package com.exceljava.com4j.excel ; + +import com4j.*; + +@IID("{00020400-0000-0000-C000-000000000046}") +public interface CommentsThreaded extends Com4jObject,Iterable { + // Methods: + /** + *

+ * Getter method for the COM property "Application" + *

+ */ + + @DISPID(148) + @PropGet + com.exceljava.com4j.excel._Application getApplication(); + + + /** + *

+ * Getter method for the COM property "Creator" + *

+ */ + + @DISPID(149) + @PropGet + com.exceljava.com4j.excel.XlCreator getCreator(); + + + /** + *

+ * Getter method for the COM property "Parent" + *

+ */ + + @DISPID(150) + @PropGet + com4j.Com4jObject getParent(); + + + /** + *

+ * Getter method for the COM property "Count" + *

+ */ + + @DISPID(118) + @PropGet + int getCount(); + + + /** + * @param index Mandatory int parameter. + */ + + @DISPID(170) + com.exceljava.com4j.excel.CommentThreaded item( + int index); + + + /** + *

+ * Getter method for the COM property "_Default" + *

+ * @param index Mandatory int parameter. + */ + + @DISPID(0) + @PropGet + @DefaultMethod + com.exceljava.com4j.excel.CommentThreaded get_Default( + int index); + + + /** + *

+ * Getter method for the COM property "_NewEnum" + *

+ */ + + @DISPID(-4) + @PropGet + java.util.Iterator iterator(); + + // Properties: +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/excel/IAuthor.java b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/IAuthor.java new file mode 100644 index 0000000..fb8c564 --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/IAuthor.java @@ -0,0 +1,76 @@ +package com.exceljava.com4j.excel ; + +import com4j.*; + +@IID("{000244FE-0001-0000-C000-000000000046}") +public interface IAuthor extends Com4jObject { + // Methods: + /** + *

+ * Getter method for the COM property "Application" + *

+ * @return Returns a value of type com.exceljava.com4j.excel._Application + */ + + @VTID(7) + com.exceljava.com4j.excel._Application getApplication(); + + + /** + *

+ * Getter method for the COM property "Creator" + *

+ * @return Returns a value of type com.exceljava.com4j.excel.XlCreator + */ + + @VTID(8) + com.exceljava.com4j.excel.XlCreator getCreator(); + + + /** + *

+ * Getter method for the COM property "Parent" + *

+ * @return Returns a value of type com4j.Com4jObject + */ + + @VTID(9) + @ReturnValue(type=NativeType.Dispatch) + com4j.Com4jObject getParent(); + + + /** + *

+ * Getter method for the COM property "Name" + *

+ * @return Returns a value of type java.lang.String + */ + + @VTID(10) + java.lang.String getName(); + + + /** + *

+ * Getter method for the COM property "ProviderID" + *

+ * @return Returns a value of type java.lang.String + */ + + @VTID(11) + java.lang.String getProviderID(); + + + /** + *

+ * Getter method for the COM property "UserID" + *

+ * @return Returns a value of type java.lang.String + */ + + @VTID(12) + java.lang.String getUserID(); + + + // Properties: +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/excel/ICommentThreaded.java b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/ICommentThreaded.java new file mode 100644 index 0000000..610bdf2 --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/ICommentThreaded.java @@ -0,0 +1,221 @@ +package com.exceljava.com4j.excel ; + +import com4j.*; + +@IID("{000244FD-0001-0000-C000-000000000046}") +public interface ICommentThreaded extends Com4jObject { + // Methods: + /** + *

+ * Getter method for the COM property "Application" + *

+ * @return Returns a value of type com.exceljava.com4j.excel._Application + */ + + @VTID(7) + com.exceljava.com4j.excel._Application getApplication(); + + + /** + *

+ * Getter method for the COM property "Creator" + *

+ * @return Returns a value of type com.exceljava.com4j.excel.XlCreator + */ + + @VTID(8) + com.exceljava.com4j.excel.XlCreator getCreator(); + + + /** + *

+ * Getter method for the COM property "Parent" + *

+ * @return Returns a value of type com4j.Com4jObject + */ + + @VTID(9) + @ReturnValue(type=NativeType.Dispatch) + com4j.Com4jObject getParent(); + + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • java.lang.Object parameter text is set to com4j.Variant.getMissing()
+ *

+ * Therefore, using this method is equivalent to + * + * addReply(com4j.Variant.getMissing()); + * + *

+ * @return Returns a value of type com.exceljava.com4j.excel.CommentThreaded + */ + + @VTID(10) + @UseDefaultValues(paramIndexMapping = {1}, optParamIndex = {0}, javaType = {java.lang.Object.class}, nativeType = {NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR}, literal = {"80020004"}) + @ReturnValue(index=1) + com.exceljava.com4j.excel.CommentThreaded addReply(); + + /** + * @param text Optional parameter. Default value is com4j.Variant.getMissing() + * @return Returns a value of type com.exceljava.com4j.excel.CommentThreaded + */ + + @VTID(10) + com.exceljava.com4j.excel.CommentThreaded addReply( + @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object text); + + + /** + */ + + @VTID(11) + void delete(); + + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • java.lang.Object parameter text is set to com4j.Variant.getMissing()
  • java.lang.Object parameter start is set to com4j.Variant.getMissing()
  • java.lang.Object parameter overwrite is set to com4j.Variant.getMissing()
+ *

+ * Therefore, using this method is equivalent to + * + * text(com4j.Variant.getMissing(), com4j.Variant.getMissing(), com4j.Variant.getMissing()); + * + *

+ * @return Returns a value of type java.lang.String + */ + + @VTID(12) + @UseDefaultValues(paramIndexMapping = {3}, optParamIndex = {0, 1, 2}, javaType = {java.lang.Object.class, java.lang.Object.class, java.lang.Object.class}, nativeType = {NativeType.VARIANT, NativeType.VARIANT, NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR, Variant.Type.VT_ERROR, Variant.Type.VT_ERROR}, literal = {"80020004", "80020004", "80020004"}) + @ReturnValue(index=3) + java.lang.String text(); + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • java.lang.Object parameter start is set to com4j.Variant.getMissing()
  • java.lang.Object parameter overwrite is set to com4j.Variant.getMissing()
+ *

+ * Therefore, using this method is equivalent to + * + * text(text, com4j.Variant.getMissing(), com4j.Variant.getMissing()); + * + *

+ * @param text Optional parameter. Default value is com4j.Variant.getMissing() + * @return Returns a value of type java.lang.String + */ + + @VTID(12) + @UseDefaultValues(paramIndexMapping = {0, 3}, optParamIndex = {1, 2}, javaType = {java.lang.Object.class, java.lang.Object.class}, nativeType = {NativeType.VARIANT, NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR, Variant.Type.VT_ERROR}, literal = {"80020004", "80020004"}) + @ReturnValue(index=3) + java.lang.String text( + @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object text); + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • java.lang.Object parameter overwrite is set to com4j.Variant.getMissing()
+ *

+ * Therefore, using this method is equivalent to + * + * text(text, start, com4j.Variant.getMissing()); + * + *

+ * @param text Optional parameter. Default value is com4j.Variant.getMissing() + * @param start Optional parameter. Default value is com4j.Variant.getMissing() + * @return Returns a value of type java.lang.String + */ + + @VTID(12) + @UseDefaultValues(paramIndexMapping = {0, 1, 3}, optParamIndex = {2}, javaType = {java.lang.Object.class}, nativeType = {NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR}, literal = {"80020004"}) + @ReturnValue(index=3) + java.lang.String text( + @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object text, + @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object start); + + /** + * @param text Optional parameter. Default value is com4j.Variant.getMissing() + * @param start Optional parameter. Default value is com4j.Variant.getMissing() + * @param overwrite Optional parameter. Default value is com4j.Variant.getMissing() + * @return Returns a value of type java.lang.String + */ + + @VTID(12) + java.lang.String text( + @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object text, + @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object start, + @Optional @MarshalAs(NativeType.VARIANT) java.lang.Object overwrite); + + + /** + *

+ * Getter method for the COM property "SupportsReplies" + *

+ * @return Returns a value of type boolean + */ + + @VTID(13) + boolean getSupportsReplies(); + + + /** + *

+ * Getter method for the COM property "Replies" + *

+ * @return Returns a value of type com.exceljava.com4j.excel.CommentsThreaded + */ + + @VTID(14) + com.exceljava.com4j.excel.CommentsThreaded getReplies(); + + + /** + *

+ * Getter method for the COM property "Author" + *

+ * @return Returns a value of type com.exceljava.com4j.excel.Author + */ + + @VTID(15) + com.exceljava.com4j.excel.Author getAuthor(); + + + /** + *

+ * Getter method for the COM property "Date" + *

+ * @return Returns a value of type java.lang.Object + */ + + @VTID(16) + @ReturnValue(type=NativeType.VARIANT) + java.lang.Object getDate(); + + + /** + * @return Returns a value of type com.exceljava.com4j.excel.CommentThreaded + */ + + @VTID(17) + com.exceljava.com4j.excel.CommentThreaded next(); + + + /** + * @return Returns a value of type com.exceljava.com4j.excel.CommentThreaded + */ + + @VTID(18) + com.exceljava.com4j.excel.CommentThreaded previous(); + + + // Properties: +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/excel/ICommentsThreaded.java b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/ICommentsThreaded.java new file mode 100644 index 0000000..ee0741b --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/ICommentsThreaded.java @@ -0,0 +1,87 @@ +package com.exceljava.com4j.excel ; + +import com4j.*; + +@IID("{000244FC-0001-0000-C000-000000000046}") +public interface ICommentsThreaded extends Com4jObject,Iterable { + // Methods: + /** + *

+ * Getter method for the COM property "Application" + *

+ * @return Returns a value of type com.exceljava.com4j.excel._Application + */ + + @VTID(7) + com.exceljava.com4j.excel._Application getApplication(); + + + /** + *

+ * Getter method for the COM property "Creator" + *

+ * @return Returns a value of type com.exceljava.com4j.excel.XlCreator + */ + + @VTID(8) + com.exceljava.com4j.excel.XlCreator getCreator(); + + + /** + *

+ * Getter method for the COM property "Parent" + *

+ * @return Returns a value of type com4j.Com4jObject + */ + + @VTID(9) + @ReturnValue(type=NativeType.Dispatch) + com4j.Com4jObject getParent(); + + + /** + *

+ * Getter method for the COM property "Count" + *

+ * @return Returns a value of type int + */ + + @VTID(10) + int getCount(); + + + /** + * @param index Mandatory int parameter. + * @return Returns a value of type com.exceljava.com4j.excel.CommentThreaded + */ + + @VTID(11) + com.exceljava.com4j.excel.CommentThreaded item( + int index); + + + /** + *

+ * Getter method for the COM property "_Default" + *

+ * @param index Mandatory int parameter. + * @return Returns a value of type com.exceljava.com4j.excel.CommentThreaded + */ + + @VTID(12) + @DefaultMethod + com.exceljava.com4j.excel.CommentThreaded get_Default( + int index); + + + /** + *

+ * Getter method for the COM property "_NewEnum" + *

+ */ + + @VTID(13) + java.util.Iterator iterator(); + + // Properties: +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/excel/Model3DFormat.java b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/Model3DFormat.java new file mode 100644 index 0000000..a1b2313 --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/Model3DFormat.java @@ -0,0 +1,356 @@ +package com.exceljava.com4j.excel ; + +import com4j.*; + +@IID("{000C03D8-0000-0000-C000-000000000046}") +public interface Model3DFormat extends com.exceljava.com4j.office._IMsoDispObj { + // Methods: + /** + *

+ * Getter method for the COM property "Parent" + *

+ * @return Returns a value of type com4j.Com4jObject + */ + + @DISPID(1) //= 0x1. The runtime will prefer the VTID if present + @VTID(9) + @ReturnValue(type=NativeType.Dispatch) + com4j.Com4jObject getParent(); + + + /** + *

+ * Getter method for the COM property "AutoFit" + *

+ * @return Returns a value of type com.exceljava.com4j.office.MsoTriState + */ + + @DISPID(100) //= 0x64. The runtime will prefer the VTID if present + @VTID(10) + com.exceljava.com4j.office.MsoTriState getAutoFit(); + + + /** + *

+ * Setter method for the COM property "AutoFit" + *

+ * @param autoFit Mandatory com.exceljava.com4j.office.MsoTriState parameter. + */ + + @DISPID(100) //= 0x64. The runtime will prefer the VTID if present + @VTID(11) + void setAutoFit( + com.exceljava.com4j.office.MsoTriState autoFit); + + + /** + *

+ * Getter method for the COM property "RotationX" + *

+ * @return Returns a value of type float + */ + + @DISPID(101) //= 0x65. The runtime will prefer the VTID if present + @VTID(12) + float getRotationX(); + + + /** + *

+ * Setter method for the COM property "RotationX" + *

+ * @param rotationX Mandatory float parameter. + */ + + @DISPID(101) //= 0x65. The runtime will prefer the VTID if present + @VTID(13) + void setRotationX( + float rotationX); + + + /** + *

+ * Getter method for the COM property "RotationY" + *

+ * @return Returns a value of type float + */ + + @DISPID(102) //= 0x66. The runtime will prefer the VTID if present + @VTID(14) + float getRotationY(); + + + /** + *

+ * Setter method for the COM property "RotationY" + *

+ * @param rotationY Mandatory float parameter. + */ + + @DISPID(102) //= 0x66. The runtime will prefer the VTID if present + @VTID(15) + void setRotationY( + float rotationY); + + + /** + *

+ * Getter method for the COM property "RotationZ" + *

+ * @return Returns a value of type float + */ + + @DISPID(103) //= 0x67. The runtime will prefer the VTID if present + @VTID(16) + float getRotationZ(); + + + /** + *

+ * Setter method for the COM property "RotationZ" + *

+ * @param rotationZ Mandatory float parameter. + */ + + @DISPID(103) //= 0x67. The runtime will prefer the VTID if present + @VTID(17) + void setRotationZ( + float rotationZ); + + + /** + *

+ * Getter method for the COM property "FieldOfView" + *

+ * @return Returns a value of type float + */ + + @DISPID(104) //= 0x68. The runtime will prefer the VTID if present + @VTID(18) + float getFieldOfView(); + + + /** + *

+ * Setter method for the COM property "FieldOfView" + *

+ * @param fov Mandatory float parameter. + */ + + @DISPID(104) //= 0x68. The runtime will prefer the VTID if present + @VTID(19) + void setFieldOfView( + float fov); + + + /** + *

+ * Getter method for the COM property "CameraPositionX" + *

+ * @return Returns a value of type float + */ + + @DISPID(105) //= 0x69. The runtime will prefer the VTID if present + @VTID(20) + float getCameraPositionX(); + + + /** + *

+ * Setter method for the COM property "CameraPositionX" + *

+ * @param cameraPositionX Mandatory float parameter. + */ + + @DISPID(105) //= 0x69. The runtime will prefer the VTID if present + @VTID(21) + void setCameraPositionX( + float cameraPositionX); + + + /** + *

+ * Getter method for the COM property "CameraPositionY" + *

+ * @return Returns a value of type float + */ + + @DISPID(106) //= 0x6a. The runtime will prefer the VTID if present + @VTID(22) + float getCameraPositionY(); + + + /** + *

+ * Setter method for the COM property "CameraPositionY" + *

+ * @param cameraPositionY Mandatory float parameter. + */ + + @DISPID(106) //= 0x6a. The runtime will prefer the VTID if present + @VTID(23) + void setCameraPositionY( + float cameraPositionY); + + + /** + *

+ * Getter method for the COM property "CameraPositionZ" + *

+ * @return Returns a value of type float + */ + + @DISPID(107) //= 0x6b. The runtime will prefer the VTID if present + @VTID(24) + float getCameraPositionZ(); + + + /** + *

+ * Setter method for the COM property "CameraPositionZ" + *

+ * @param cameraPositionZ Mandatory float parameter. + */ + + @DISPID(107) //= 0x6b. The runtime will prefer the VTID if present + @VTID(25) + void setCameraPositionZ( + float cameraPositionZ); + + + /** + *

+ * Getter method for the COM property "LookAtPointX" + *

+ * @return Returns a value of type float + */ + + @DISPID(108) //= 0x6c. The runtime will prefer the VTID if present + @VTID(26) + float getLookAtPointX(); + + + /** + *

+ * Setter method for the COM property "LookAtPointX" + *

+ * @param lookAtPointX Mandatory float parameter. + */ + + @DISPID(108) //= 0x6c. The runtime will prefer the VTID if present + @VTID(27) + void setLookAtPointX( + float lookAtPointX); + + + /** + *

+ * Getter method for the COM property "LookAtPointY" + *

+ * @return Returns a value of type float + */ + + @DISPID(109) //= 0x6d. The runtime will prefer the VTID if present + @VTID(28) + float getLookAtPointY(); + + + /** + *

+ * Setter method for the COM property "LookAtPointY" + *

+ * @param lookAtPointY Mandatory float parameter. + */ + + @DISPID(109) //= 0x6d. The runtime will prefer the VTID if present + @VTID(29) + void setLookAtPointY( + float lookAtPointY); + + + /** + *

+ * Getter method for the COM property "LookAtPointZ" + *

+ * @return Returns a value of type float + */ + + @DISPID(110) //= 0x6e. The runtime will prefer the VTID if present + @VTID(30) + float getLookAtPointZ(); + + + /** + *

+ * Setter method for the COM property "LookAtPointZ" + *

+ * @param lookAtPointZ Mandatory float parameter. + */ + + @DISPID(110) //= 0x6e. The runtime will prefer the VTID if present + @VTID(31) + void setLookAtPointZ( + float lookAtPointZ); + + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • boolean parameter resetSize is set to false
+ *

+ * Therefore, using this method is equivalent to + * + * resetModel(false); + * + *

+ */ + + @DISPID(111) //= 0x6f. The runtime will prefer the VTID if present + @VTID(32) + @UseDefaultValues(paramIndexMapping = {}, optParamIndex = {0}, javaType = {boolean.class}, nativeType = {NativeType.VariantBool}, variantType = {Variant.Type.VT_BOOL}, literal = {"false"}) + void resetModel(); + + /** + * @param resetSize Optional parameter. Default value is false + */ + + @DISPID(111) //= 0x6f. The runtime will prefer the VTID if present + @VTID(32) + void resetModel( + @Optional @DefaultValue("0") boolean resetSize); + + + /** + * @param increment Mandatory float parameter. + */ + + @DISPID(112) //= 0x70. The runtime will prefer the VTID if present + @VTID(33) + void incrementRotationX( + float increment); + + + /** + * @param increment Mandatory float parameter. + */ + + @DISPID(113) //= 0x71. The runtime will prefer the VTID if present + @VTID(34) + void incrementRotationY( + float increment); + + + /** + * @param increment Mandatory float parameter. + */ + + @DISPID(114) //= 0x72. The runtime will prefer the VTID if present + @VTID(35) + void incrementRotationZ( + float increment); + + + // Properties: +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/excel/XlLinkedDataTypeState.java b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/XlLinkedDataTypeState.java new file mode 100644 index 0000000..3c3292f --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/excel/XlLinkedDataTypeState.java @@ -0,0 +1,38 @@ +package com.exceljava.com4j.excel ; + +import com4j.*; + +/** + */ +public enum XlLinkedDataTypeState { + /** + *

+ * The value of this constant is 0 + *

+ */ + xlLinkedDataTypeStateNone, // 0 + /** + *

+ * The value of this constant is 1 + *

+ */ + xlLinkedDataTypeStateValidLinkedData, // 1 + /** + *

+ * The value of this constant is 2 + *

+ */ + xlLinkedDataTypeStateDisambiguationNeeded, // 2 + /** + *

+ * The value of this constant is 3 + *

+ */ + xlLinkedDataTypeStateBrokenLinkedData, // 3 + /** + *

+ * The value of this constant is 4 + *

+ */ + xlLinkedDataTypeStateFetchingData, // 4 +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/office/Model3DFormat.java b/jinx-com4j/src/main/java/com/exceljava/com4j/office/Model3DFormat.java new file mode 100644 index 0000000..f778b0f --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/office/Model3DFormat.java @@ -0,0 +1,356 @@ +package com.exceljava.com4j.office ; + +import com4j.*; + +@IID("{000C03D8-0000-0000-C000-000000000046}") +public interface Model3DFormat extends com.exceljava.com4j.office._IMsoDispObj { + // Methods: + /** + *

+ * Getter method for the COM property "Parent" + *

+ * @return Returns a value of type com4j.Com4jObject + */ + + @DISPID(1) //= 0x1. The runtime will prefer the VTID if present + @VTID(9) + @ReturnValue(type=NativeType.Dispatch) + com4j.Com4jObject getParent(); + + + /** + *

+ * Getter method for the COM property "AutoFit" + *

+ * @return Returns a value of type com.exceljava.com4j.office.MsoTriState + */ + + @DISPID(100) //= 0x64. The runtime will prefer the VTID if present + @VTID(10) + com.exceljava.com4j.office.MsoTriState getAutoFit(); + + + /** + *

+ * Setter method for the COM property "AutoFit" + *

+ * @param autoFit Mandatory com.exceljava.com4j.office.MsoTriState parameter. + */ + + @DISPID(100) //= 0x64. The runtime will prefer the VTID if present + @VTID(11) + void setAutoFit( + com.exceljava.com4j.office.MsoTriState autoFit); + + + /** + *

+ * Getter method for the COM property "RotationX" + *

+ * @return Returns a value of type float + */ + + @DISPID(101) //= 0x65. The runtime will prefer the VTID if present + @VTID(12) + float getRotationX(); + + + /** + *

+ * Setter method for the COM property "RotationX" + *

+ * @param rotationX Mandatory float parameter. + */ + + @DISPID(101) //= 0x65. The runtime will prefer the VTID if present + @VTID(13) + void setRotationX( + float rotationX); + + + /** + *

+ * Getter method for the COM property "RotationY" + *

+ * @return Returns a value of type float + */ + + @DISPID(102) //= 0x66. The runtime will prefer the VTID if present + @VTID(14) + float getRotationY(); + + + /** + *

+ * Setter method for the COM property "RotationY" + *

+ * @param rotationY Mandatory float parameter. + */ + + @DISPID(102) //= 0x66. The runtime will prefer the VTID if present + @VTID(15) + void setRotationY( + float rotationY); + + + /** + *

+ * Getter method for the COM property "RotationZ" + *

+ * @return Returns a value of type float + */ + + @DISPID(103) //= 0x67. The runtime will prefer the VTID if present + @VTID(16) + float getRotationZ(); + + + /** + *

+ * Setter method for the COM property "RotationZ" + *

+ * @param rotationZ Mandatory float parameter. + */ + + @DISPID(103) //= 0x67. The runtime will prefer the VTID if present + @VTID(17) + void setRotationZ( + float rotationZ); + + + /** + *

+ * Getter method for the COM property "FieldOfView" + *

+ * @return Returns a value of type float + */ + + @DISPID(104) //= 0x68. The runtime will prefer the VTID if present + @VTID(18) + float getFieldOfView(); + + + /** + *

+ * Setter method for the COM property "FieldOfView" + *

+ * @param fov Mandatory float parameter. + */ + + @DISPID(104) //= 0x68. The runtime will prefer the VTID if present + @VTID(19) + void setFieldOfView( + float fov); + + + /** + *

+ * Getter method for the COM property "CameraPositionX" + *

+ * @return Returns a value of type float + */ + + @DISPID(105) //= 0x69. The runtime will prefer the VTID if present + @VTID(20) + float getCameraPositionX(); + + + /** + *

+ * Setter method for the COM property "CameraPositionX" + *

+ * @param positionX Mandatory float parameter. + */ + + @DISPID(105) //= 0x69. The runtime will prefer the VTID if present + @VTID(21) + void setCameraPositionX( + float positionX); + + + /** + *

+ * Getter method for the COM property "CameraPositionY" + *

+ * @return Returns a value of type float + */ + + @DISPID(106) //= 0x6a. The runtime will prefer the VTID if present + @VTID(22) + float getCameraPositionY(); + + + /** + *

+ * Setter method for the COM property "CameraPositionY" + *

+ * @param positionY Mandatory float parameter. + */ + + @DISPID(106) //= 0x6a. The runtime will prefer the VTID if present + @VTID(23) + void setCameraPositionY( + float positionY); + + + /** + *

+ * Getter method for the COM property "CameraPositionZ" + *

+ * @return Returns a value of type float + */ + + @DISPID(107) //= 0x6b. The runtime will prefer the VTID if present + @VTID(24) + float getCameraPositionZ(); + + + /** + *

+ * Setter method for the COM property "CameraPositionZ" + *

+ * @param positionZ Mandatory float parameter. + */ + + @DISPID(107) //= 0x6b. The runtime will prefer the VTID if present + @VTID(25) + void setCameraPositionZ( + float positionZ); + + + /** + *

+ * Getter method for the COM property "LookAtPointX" + *

+ * @return Returns a value of type float + */ + + @DISPID(108) //= 0x6c. The runtime will prefer the VTID if present + @VTID(26) + float getLookAtPointX(); + + + /** + *

+ * Setter method for the COM property "LookAtPointX" + *

+ * @param lookAtPointX Mandatory float parameter. + */ + + @DISPID(108) //= 0x6c. The runtime will prefer the VTID if present + @VTID(27) + void setLookAtPointX( + float lookAtPointX); + + + /** + *

+ * Getter method for the COM property "LookAtPointY" + *

+ * @return Returns a value of type float + */ + + @DISPID(109) //= 0x6d. The runtime will prefer the VTID if present + @VTID(28) + float getLookAtPointY(); + + + /** + *

+ * Setter method for the COM property "LookAtPointY" + *

+ * @param lookAtPointY Mandatory float parameter. + */ + + @DISPID(109) //= 0x6d. The runtime will prefer the VTID if present + @VTID(29) + void setLookAtPointY( + float lookAtPointY); + + + /** + *

+ * Getter method for the COM property "LookAtPointZ" + *

+ * @return Returns a value of type float + */ + + @DISPID(110) //= 0x6e. The runtime will prefer the VTID if present + @VTID(30) + float getLookAtPointZ(); + + + /** + *

+ * Setter method for the COM property "LookAtPointZ" + *

+ * @param lookAtPointZ Mandatory float parameter. + */ + + @DISPID(110) //= 0x6e. The runtime will prefer the VTID if present + @VTID(31) + void setLookAtPointZ( + float lookAtPointZ); + + + /** + *

+ * This method uses predefined default values for the following parameters: + *

+ *
    + *
  • boolean parameter resetSize is set to false
+ *

+ * Therefore, using this method is equivalent to + * + * resetModel(false); + * + *

+ */ + + @DISPID(111) //= 0x6f. The runtime will prefer the VTID if present + @VTID(32) + @UseDefaultValues(paramIndexMapping = {}, optParamIndex = {0}, javaType = {boolean.class}, nativeType = {NativeType.VariantBool}, variantType = {Variant.Type.VT_BOOL}, literal = {"false"}) + void resetModel(); + + /** + * @param resetSize Optional parameter. Default value is false + */ + + @DISPID(111) //= 0x6f. The runtime will prefer the VTID if present + @VTID(32) + void resetModel( + @Optional @DefaultValue("0") boolean resetSize); + + + /** + * @param increment Mandatory float parameter. + */ + + @DISPID(112) //= 0x70. The runtime will prefer the VTID if present + @VTID(33) + void incrementRotationX( + float increment); + + + /** + * @param increment Mandatory float parameter. + */ + + @DISPID(113) //= 0x71. The runtime will prefer the VTID if present + @VTID(34) + void incrementRotationY( + float increment); + + + /** + * @param increment Mandatory float parameter. + */ + + @DISPID(114) //= 0x72. The runtime will prefer the VTID if present + @VTID(35) + void incrementRotationZ( + float increment); + + + // Properties: +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/office/MsoPictureType.java b/jinx-com4j/src/main/java/com/exceljava/com4j/office/MsoPictureType.java new file mode 100644 index 0000000..3e83aa8 --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/office/MsoPictureType.java @@ -0,0 +1,49 @@ +package com.exceljava.com4j.office ; + +import com4j.*; + +/** + */ +public enum MsoPictureType implements ComEnum { + /** + *

+ * The value of this constant is -2 + *

+ */ + msoPictureTypeDefault(-2), + /** + *

+ * The value of this constant is 0 + *

+ */ + msoPictureTypePNG(0), + /** + *

+ * The value of this constant is 1 + *

+ */ + msoPictureTypeBMP(1), + /** + *

+ * The value of this constant is 2 + *

+ */ + msoPictureTypeGIF(2), + /** + *

+ * The value of this constant is 3 + *

+ */ + msoPictureTypeJPG(3), + /** + *

+ * The value of this constant is 4 + *

+ */ + msoPictureTypePDF(4), + ; + + private final int value; + MsoPictureType(int value) { this.value=value; } + public int comEnumValue() { return value; } +} diff --git a/jinx-com4j/src/main/java/com/exceljava/com4j/office/MsoTextRangeInsertPosition.java b/jinx-com4j/src/main/java/com/exceljava/com4j/office/MsoTextRangeInsertPosition.java new file mode 100644 index 0000000..41a661b --- /dev/null +++ b/jinx-com4j/src/main/java/com/exceljava/com4j/office/MsoTextRangeInsertPosition.java @@ -0,0 +1,20 @@ +package com.exceljava.com4j.office ; + +import com4j.*; + +/** + */ +public enum MsoTextRangeInsertPosition { + /** + *

+ * The value of this constant is 0 + *

+ */ + msoMsoTextRangeInsertBefore, // 0 + /** + *

+ * The value of this constant is 1 + *

+ */ + msoMsoTextRangeInsertAfter, // 1 +} diff --git a/jinx-com4j/src/main/resources/jinx-classes.txt b/jinx-com4j/src/main/resources/jinx-classes.txt new file mode 100644 index 0000000..18322ab --- /dev/null +++ b/jinx-com4j/src/main/resources/jinx-classes.txt @@ -0,0 +1,5 @@ +# +# Classes to be loaded by the Jinx Add-In +# +com.exceljava.com4j.JinxBridge + diff --git a/pom.xml b/pom.xml index ed6c2e7..d26e092 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.exceljava jinx-com4j-root pom - 1.0-SNAPSHOT + 1.1.0 examples jinx-com4j