diff --git a/CHANGES.md b/CHANGES.md index 7f24745f03..672f0aa4e1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -51,6 +51,7 @@ Features * [#640](https://github.com/java-native-access/jna/pull/640): Add `com.sun.jna.platform.win32.Psapi.GetPerformanceInfo()`, `com.sun.jna.platform.win32.Kernel32.GetTickCount64()`, and `com.sun.jna.platform.win32.Kernel32.SetErrorMode()` - [@dbwiddis](https://github.com/dbwiddis). * [#642](https://github.com/java-native-access/jna/pull/642): COM calls with variable number of arguments (varargs) are now supported - [@SevenOf9Sleeper](https://github.com/SevenOf9Sleeper). * [#644](https://github.com/java-native-access/jna/pull/644): New ant target 'install' for installing JNA artifacts in local m2-repository - [@SevenOf9Sleeper](https://github.com/SevenOf9Sleeper). +* [#649](https://github.com/java-native-access/jna/pull/649): Bugfix msoffice sample and add two samples taken from MSDN and translated from VisualBasic to Java - [@matthiasblaesing](https://github.com/matthiasblaesing). Bug Fixes --------- @@ -66,7 +67,7 @@ Bug Fixes * [#602](https://github.com/java-native-access/jna/pull/602): Make sure SID related memory is properly released once no longer required [@lgoldstein](https://github.com/lgoldstein). * [#610](https://github.com/java-native-access/jna/pull/610): Fixed issue #604: Kernel32#GetLastError() always returns ERROR_SUCCESS [@lgoldstein](https://github.com/lgoldstein). * [#633](https://github.com/java-native-access/jna/pull/633): Restore default usage of platform native encoding for Java strings passed to native functions (was hard-coded to UTF-8 in 4.0 and later) [@amake](https://github.com/amake) -* [#634](https://github.com/java-native-access/jna/pull/634): Improve BSTR handling - [@matthiasblaesing](https://github.com/matthiasblaesing). +* [#634](https://github.com/java-native-access/jna/pull/634): Improve BSTR handling and add `SysStringByteLen` and `SysStringLen` to `com.sun.jna.platform.win32.OleAuto` - [@matthiasblaesing](https://github.com/matthiasblaesing). Release 4.2.1 ============= diff --git a/contrib/msoffice/jnatest.xls b/contrib/msoffice/jnatest.xls deleted file mode 100644 index 6077e40a43..0000000000 Binary files a/contrib/msoffice/jnatest.xls and /dev/null differ diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/COMInfoUtil.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/COMInfoUtil.java index 04fc0bb3b5..3ed641de5b 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/COMInfoUtil.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/COMInfoUtil.java @@ -4,15 +4,15 @@ import java.io.IOException; import java.util.ArrayList; -import com.sun.jna.platform.win32.COM.COMUtils; import com.sun.jna.platform.win32.COM.COMUtils.COMInfo; +import java.io.File; public class COMInfoUtil { public static void main(String[] args) { FileWriter writer = null; try { - String filename = "C:\\TEMP\\CLSIDs.txt"; + String filename = new File(Helper.tempDir, "CLSIDs.txt").getAbsolutePath(); ArrayList comInfos = COMUtils.getAllCOMInfoOnSystem(); writer = new FileWriter(filename); diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/Helper.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/Helper.java new file mode 100644 index 0000000000..4b7c885be8 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/Helper.java @@ -0,0 +1,75 @@ + +package com.sun.jna.platform.win32.COM; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; + +public class Helper { + public static final File tempDir = new File(System.getProperty("java.io.tmpdir")); + + /** + * Sleep for specified seconds. + * + * @param seconds + */ + public static void sleep(int seconds) { + try { + Thread.sleep(seconds * 1000L); + } catch (InterruptedException ex) { + // Ignore + } + } + + /** + * Extract data contained in classpath into a system accessible target file. + * + * @param localPath + * @param target + * @throws IOException + */ + public static void extractClasspathFileToReal(String localPath, File target) throws IOException { + InputStream is = null; + OutputStream os = null; + try { + is = Helper.class.getResourceAsStream(localPath); + os = new FileOutputStream(target); + + int read; + byte[] buffer = new byte[20480]; + + while((read = is.read(buffer)) > 0) { + os.write(buffer, 0, read); + } + + } finally { + if(is != null) { + try { + is.close(); + } catch(Exception ex) {} + } + if(os != null) { + try { + os.close(); + } catch(Exception ex) {} + } + } + } + + /** + * Create a temporary file, that does not exist. + * + * @param prefix + * @param suffix + * @return + * @throws IOException + */ + public static File createNotExistingFile(String prefix, String suffix) throws IOException { + File tempFile = Files.createTempFile(prefix, suffix).toFile(); + tempFile.delete(); + return tempFile; + } +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSExcel.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSExcel.java index 44dff49eb1..00d1cc75bf 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSExcel.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSExcel.java @@ -28,9 +28,7 @@ public void newExcelBook() throws COMException { this.invokeNoReply("Add", getWorkbooks()); } - public void openExcelBook(String filename, boolean bVisible) - throws COMException { - // OpenDocument + public void openExcelBook(String filename) throws COMException { this.invokeNoReply("Open", getWorkbooks(), new VARIANT(filename)); } diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSOfficeDemo.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSOfficeDemo.java index f4d6658cbd..85aa3aa574 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSOfficeDemo.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSOfficeDemo.java @@ -1,28 +1,28 @@ package com.sun.jna.platform.win32.COM.office; -import java.io.File; +import com.sun.jna.Pointer; import com.sun.jna.platform.win32.COM.COMException; +import com.sun.jna.platform.win32.COM.Helper; +import com.sun.jna.platform.win32.Ole32; import com.sun.jna.platform.win32.WinDef.LONG; +import java.io.File; +import java.io.IOException; public class MSOfficeDemo { - - /** - * @param args - */ - public static void main(String[] args) { - new MSOfficeDemo(); - } - - private String currentWorkingDir = new File("").getAbsolutePath() - + File.separator; - - public MSOfficeDemo() { - //this.testMSWord(); - this.testMSExcel(); + public static void main(String[] args) throws IOException { + Ole32.INSTANCE.CoInitializeEx(Pointer.NULL, Ole32.COINIT_MULTITHREADED); + try { + MSOfficeDemo demo = new MSOfficeDemo(); + demo.testMSExcel(); + demo.testMSWord(); + } finally { + Ole32.INSTANCE.CoUninitialize(); + } } - public void testMSWord() { + public void testMSWord() throws IOException { + File demoDocument = null; MSWord msWord = null; // http://msdn.microsoft.com/en-us/library/office/ff839952(v=office.15).aspx @@ -42,82 +42,92 @@ public void testMSWord() { System.out.println("MSWord version: " + msWord.getVersion()); msWord.setVisible(true); - // msWord.newDocument(); - msWord.openDocument(currentWorkingDir + "jnatest.doc", true); + + Helper.sleep(5); + + demoDocument = Helper.createNotExistingFile("jnatest", ".doc"); + Helper.extractClasspathFileToReal("/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.doc", demoDocument); + + msWord.openDocument(demoDocument.getAbsolutePath()); msWord.insertText("Hello from JNA! \n\n"); // wait 10sec. before closing - Thread.currentThread().sleep(1000); + Helper.sleep(10); // save in different formats // pdf format is only supported in MSWord 2007 and above - msWord.SaveAs("C:\\TEMP\\jnatestSaveAs.doc", wdFormatDocument); - msWord.SaveAs("C:\\TEMP\\jnatestSaveAs.pdf", wdFormatPDF); - msWord.SaveAs("C:\\TEMP\\jnatestSaveAs.rtf", wdFormatRTF); - msWord.SaveAs("C:\\TEMP\\jnatestSaveAs.html", wdFormatHTML); + System.out.println("Wrinting files to: " + Helper.tempDir); + msWord.SaveAs(new File(Helper.tempDir, "jnatestSaveAs.doc").getAbsolutePath(), wdFormatDocument); + msWord.SaveAs(new File(Helper.tempDir, "jnatestSaveAs.pdf").getAbsolutePath(), wdFormatPDF); + msWord.SaveAs(new File(Helper.tempDir, "jnatestSaveAs.rtf").getAbsolutePath(), wdFormatRTF); + msWord.SaveAs(new File(Helper.tempDir, "jnatestSaveAs.html").getAbsolutePath(), wdFormatHTML); // close and save the document msWord.closeActiveDocument(false); msWord.newDocument(); // msWord.openDocument(currentWorkingDir + "jnatest.doc", true); msWord.insertText("Hello from JNA! \n Please notice that JNA can control MS Word via the new COM interface! \nHere we are creating a new word document and we save it to the 'TEMP' directory!"); // save with no user prompt - msWord.SaveAs("C:\\TEMP\\jnatestNewDoc1.docx", wdFormatDocumentDefault); - msWord.SaveAs("C:\\TEMP\\jnatestNewDoc2.docx", wdFormatDocumentDefault); - msWord.SaveAs("C:\\TEMP\\jnatestNewDoc3.docx", wdFormatDocumentDefault); + msWord.SaveAs(new File(Helper.tempDir, "jnatestNewDoc1.docx").getAbsolutePath(), wdFormatDocumentDefault); + msWord.SaveAs(new File(Helper.tempDir, "jnatestNewDoc2.docx").getAbsolutePath(), wdFormatDocumentDefault); + msWord.SaveAs(new File(Helper.tempDir, "jnatestNewDoc3.docx").getAbsolutePath(), wdFormatDocumentDefault); // close and save the document msWord.closeActiveDocument(false); // open 3 documents - msWord.openDocument("C:\\TEMP\\jnatestNewDoc1.docx", true); + msWord.openDocument(new File(Helper.tempDir, "jnatestNewDoc1.docx").getAbsolutePath()); msWord.insertText("Hello some changes from JNA!\n"); - msWord.openDocument("C:\\TEMP\\jnatestNewDoc2.docx", true); + msWord.openDocument(new File(Helper.tempDir, "jnatestNewDoc2.docx").getAbsolutePath()); msWord.insertText("Hello some changes from JNA!\n"); - msWord.openDocument("C:\\TEMP\\jnatestNewDoc3.docx", true); + msWord.openDocument(new File(Helper.tempDir, "jnatestNewDoc3.docx").getAbsolutePath()); msWord.insertText("Hello some changes from JNA!\n"); // save the document and prompt the user msWord.Save(false, wdPromptUser); - // wait then close word - msWord.quit(); - } catch(InterruptedException ie) { - ie.printStackTrace(); } catch (COMException e) { if (e.getExcepInfo() != null) { - System.out - .println("bstrSource: " + e.getExcepInfo().bstrSource); - System.out.println("bstrDescription: " - + e.getExcepInfo().bstrDescription); + System.out.println("bstrSource: " + e.getExcepInfo().bstrSource); + System.out.println("bstrDescription: " + e.getExcepInfo().bstrDescription); } - - // print stack trace - e.printStackTrace(); - - if (msWord != null) + } finally { + if (msWord != null) { msWord.quit(); + } + + if(demoDocument != null && demoDocument.exists()) { + demoDocument.delete(); + } } } - public void testMSExcel() { + public void testMSExcel() throws IOException { + File demoDocument = null; MSExcel msExcel = null; try { msExcel = new MSExcel(); System.out.println("MSExcel version: " + msExcel.getVersion()); msExcel.setVisible(true); - // msExcel.newExcelBook(); - msExcel.openExcelBook(currentWorkingDir + "jnatest.xls", true); + + Helper.sleep(5); + + demoDocument = Helper.createNotExistingFile("jnatest", ".xls"); + Helper.extractClasspathFileToReal("/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.xls", demoDocument); + + msExcel.openExcelBook(demoDocument.getAbsolutePath()); msExcel.insertValue("A1", "Hello from JNA!"); // wait 10sec. before closing - Thread.currentThread().sleep(10000); + Helper.sleep(10); // close and save the active sheet msExcel.closeActiveWorkbook(true); - msExcel.setVisible(true); - // msExcel.newExcelBook(); - msExcel.openExcelBook(currentWorkingDir + "jnatest.xls", true); + + msExcel.newExcelBook(); msExcel.insertValue("A1", "Hello from JNA!"); // close and save the active sheet msExcel.closeActiveWorkbook(true); - } catch (Exception e) { - e.printStackTrace(); - - if (msExcel != null) + } finally { + if (msExcel != null) { msExcel.quit(); + } + + if (demoDocument != null && demoDocument.exists()) { + demoDocument.delete(); + } } } } diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSWord.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSWord.java index 9d6cae3ec9..6f9bae6cd4 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSWord.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/office/MSWord.java @@ -29,9 +29,7 @@ public void newDocument() throws COMException { this.invokeNoReply("Add", getDocuments()); } - public void openDocument(String filename, boolean bVisible) - throws COMException { - // OpenDocument + public void openDocument(String filename) throws COMException { this.invokeNoReply("Open", getDocuments(), new VARIANT(filename)); } @@ -70,7 +68,6 @@ public ActiveDocument getActiveDocument() { } public Documents getDocuments() { - // GetDocuments Documents pDocuments = new Documents(this.getAutomationProperty( "Documents", this.getApplication().getIDispatch())); diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/Excelautomation_KB_219151_Mod.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/Excelautomation_KB_219151_Mod.java new file mode 100644 index 0000000000..9db5f074aa --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/Excelautomation_KB_219151_Mod.java @@ -0,0 +1,207 @@ + +package com.sun.jna.platform.win32.COM.util.office; + +import com.sun.jna.Pointer; +import com.sun.jna.platform.win32.COM.Helper; +import com.sun.jna.platform.win32.COM.util.Factory; +import com.sun.jna.platform.win32.COM.util.office.excel.Borders; +import com.sun.jna.platform.win32.COM.util.office.excel.Chart; +import com.sun.jna.platform.win32.COM.util.office.excel.ComExcel_Application; +import com.sun.jna.platform.win32.COM.util.office.excel.ComIApplication; +import com.sun.jna.platform.win32.COM.util.office.excel.ComIRange; +import com.sun.jna.platform.win32.COM.util.office.excel.ComIWorkbook; +import com.sun.jna.platform.win32.COM.util.office.excel.ComIWorksheet; +import com.sun.jna.platform.win32.COM.util.office.excel.Shape; +import com.sun.jna.platform.win32.COM.util.office.excel.XlBorderWeight; +import com.sun.jna.platform.win32.COM.util.office.excel.XlChartLocation; +import com.sun.jna.platform.win32.COM.util.office.excel.XlLineStyle; +import com.sun.jna.platform.win32.COM.util.office.excel.XlRowCol; +import com.sun.jna.platform.win32.COM.util.office.office.XlChartType; +import com.sun.jna.platform.win32.OaIdl; +import com.sun.jna.platform.win32.OaIdl.SAFEARRAY; +import com.sun.jna.platform.win32.Ole32; +import com.sun.jna.platform.win32.Variant; +import com.sun.jna.platform.win32.Variant.VARIANT; +import static com.sun.jna.platform.win32.Variant.VARIANT.VARIANT_MISSING; +import com.sun.jna.platform.win32.WTypes.BSTR; +import java.io.File; + +import java.io.IOException; +import javax.swing.JDialog; + +import javax.swing.JOptionPane; + +/** + * Based on VB sample: https://support.microsoft.com/en-us/kb/219151 + * + *

Please note: The contained type-bindings are far from complete and only + * included as sample - please use one of the generators to generate complete + * bindings or enhance the coverage yourself.

+ */ +public class Excelautomation_KB_219151_Mod { + private static final String FKT_SUM = "SUM"; + private static final String FKT_RAND = "RAND"; + private static final String FKT_COLUMN = "COLUMN"; + private static final String FKT_CHAR = "CHAR"; +// Variant for de-Locale: +// private static final String FKT_SUM = "SUMME"; +// private static final String FKT_RAND = "ZUFALLSZAHL"; +// private static final String FKT_COLUMN = "SPALTE"; +// private static final String FKT_CHAR = "ZEICHEN"; + + public static void main(String[] args) throws IOException { + // Initialize COM Subsystem + Ole32.INSTANCE.CoInitializeEx(Pointer.NULL, Ole32.COINIT_MULTITHREADED); + // Initialize Factory for COM object creation + Factory fact = new Factory(); + + try { + // Start word application + ComExcel_Application excel = fact.createObject(ComExcel_Application.class); + ComIApplication excelApp = excel.queryInterface(ComIApplication.class); + + // Set visiblite of application + excelApp.setVisible(true); + + Helper.sleep(5); + + // Get a new workbook. + ComIWorkbook wb = excelApp.getWorkbooks().Add(); + ComIWorksheet sheet = wb.getActiveSheet(); + + // Add table headers going cell by cell. + sheet.getCells().getItem(1, 1).setValue("First Name"); + sheet.getCells().getItem(1, 2).setValue("Last Name"); + sheet.getCells().getItem(1, 3).setValue("Full Name"); + sheet.getCells().getItem(1, 4).setValue("Salary"); + + // Create an array to set multiple values at once. + SAFEARRAY saNames = safeVariantArrayFromJava(new String[][] { + {"John", "Smith"}, + {"Tom", "Brown"}, + {"Sue", "Thomas"}, + {"Jane", "Jones"}, + {"Adam", "Johnson"}, + }); + + // Fill A2:B6 with an array of values (First and Last Names). + VARIANT valueHolder = new VARIANT(); + valueHolder.setValue(Variant.VT_ARRAY | Variant.VT_VARIANT, saNames); + sheet.getRange("A2", "B6").setValue(valueHolder); + saNames.destroy(); + + // Fill C2:C6 with a relative formula (=A2 & " " & B2). + sheet.getRange("C2", "C6").setFormula("= A2 & \" \" & B2"); + + // Fill D2:D6 with a formula(=RAND()*100000) and apply format. + sheet.getRange("D2", "D6").setFormula("=" + FKT_RAND + "()*100000"); + sheet.getRange("D2", "D6").setNumberFormat("$0.00"); + + // AutoFit columns A:D. + sheet.getRange("A1", "D2").getEntireColumn().AutoFit(); + + displayQuaterlySales(sheet); + + File tempFile = Helper.createNotExistingFile("exceloutput", ".xlsx"); + System.out.println("Writing output to: " + tempFile.getAbsolutePath()); + wb.SaveAs(tempFile.getAbsolutePath()); + + excelApp.setUserControl(true); + } finally { + fact.disposeAll(); + Ole32.INSTANCE.CoUninitialize(); + } + + System.exit(0); + } + + private static void displayQuaterlySales(ComIWorksheet sheet) { + // Determine how many quarters to display data for. + int iNumQtrs = 4; + for(; iNumQtrs >= 2; iNumQtrs--) { + JOptionPane pane = new JOptionPane( + String.format("Enter sales data for %d quarter(s)?", iNumQtrs), + JOptionPane.QUESTION_MESSAGE); + pane.setOptionType(JOptionPane.YES_NO_OPTION); + JDialog dialog = pane.createDialog("Input..."); + dialog.setAlwaysOnTop(true); + dialog.show(); + if(((Integer) pane.getValue()) == JOptionPane.YES_OPTION) { + break; + } + } + + JOptionPane.showMessageDialog( + null, + String.format("Displaying data for %d quarter(s).", iNumQtrs) + ); + + // Starting at E1, fill headers for the number of columns selected. + ComIRange oResizeRange = sheet.getRange("E1", "E1").getResize(VARIANT_MISSING, iNumQtrs); + + oResizeRange.setFormula("=\"Q\" & " + FKT_COLUMN + "() - 4 & " + FKT_CHAR + "(10) & \"Sales\""); + + // Change the Orientation and WrapText properties for the headers. + oResizeRange.setOrientation(38); + oResizeRange.setWrapText(true); + + // Fill the interior color of the headers. + oResizeRange.getInterior().setColorIndex(36); + + // Fill the columns with a formula and apply a number format. + oResizeRange = sheet.getRange("E2", "E6").getResize(VARIANT_MISSING, iNumQtrs); + oResizeRange.setFormula("="+ FKT_RAND + "()*100"); + oResizeRange.setNumberFormat("$0.00"); + + // Apply borders to the Sales data and headers. + oResizeRange = sheet.getRange("E1", "E6").getResize(VARIANT_MISSING, iNumQtrs); + oResizeRange.getBorders().setWeight(XlBorderWeight.xlThin); + + // Add a Totals formula for the sales data and apply a border. + oResizeRange = sheet.getRange("E8", "E8").getResize(VARIANT_MISSING, iNumQtrs); + oResizeRange.setFormula("=" + FKT_SUM + "(E2:E6)"); + Borders oResizeRangeBorders = oResizeRange.getBorders(); + oResizeRangeBorders.setLineStyle(XlLineStyle.xlDouble); + oResizeRangeBorders.setWeight(XlBorderWeight.xlThick); + + // Add a Chart for the selected data + oResizeRange = sheet.getRange("E2:E6").getResize(VARIANT_MISSING, iNumQtrs); + + Chart chart = sheet.getParent().getCharts().Add(VARIANT_MISSING,VARIANT_MISSING,VARIANT_MISSING,VARIANT_MISSING); + // Java note: Assumption is, that VARIANT_MISSING is the correct indicator + // for missing values, it turns out, NULL is correct in this case... + chart.ChartWizard(oResizeRange, XlChartType.xl3DColumn, VARIANT_MISSING, + XlRowCol.xlColumns, + null, null, null, + null,null,null, + null + ); + chart.SeriesCollection(1).setXValues(sheet.getRange("C2", "C6")); + for(int i = 1; i <= iNumQtrs; i++) { + chart.SeriesCollection(i).setName("=\"Q" + Integer.toString(i) + "\""); + } + chart.Location(XlChartLocation.xlLocationAsObject, sheet.getName()); + + // Move the chart so as not to cover your data. + Shape shape = sheet.getShapes().Item(1); + shape.setTop(sheet.getRows(10).getTop()); + shape.setLeft(sheet.getColumns(2).getLeft()); + } + + private static SAFEARRAY safeVariantArrayFromJava(String[][] data) { + // The data array is defined/stored row major, while excel expects the + // data column major, so this method also transposes the matrix + + OaIdl.SAFEARRAY wrapped = OaIdl.SAFEARRAY.createSafeArray(data[0].length, data.length); + // VARIANT is java allocated and will be freed by GC + VARIANT var = new VARIANT(); + for(int i = 0; i < data.length; i++) { + for(int j = 0; j < data[0].length; j++) { + // BSTR is allocated by java and will be freed by GC + var.setValue(Variant.VT_BSTR, new BSTR(data[i][j])); + wrapped.putElement(var, j, i); + } + } + return wrapped; + } +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeExcelDemo.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeExcelDemo.java index a7a49b7d06..b64929eb6c 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeExcelDemo.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeExcelDemo.java @@ -12,57 +12,69 @@ */ package com.sun.jna.platform.win32.COM.util.office; +import com.sun.jna.Pointer; +import com.sun.jna.platform.win32.COM.Helper; import java.io.File; -import com.sun.jna.platform.win32.COM.office.MSExcel; import com.sun.jna.platform.win32.COM.util.AbstractComEventCallbackListener; import com.sun.jna.platform.win32.COM.util.Factory; +import com.sun.jna.platform.win32.COM.util.IComEventCallbackCookie; import com.sun.jna.platform.win32.COM.util.office.excel.ComExcel_Application; import com.sun.jna.platform.win32.COM.util.office.excel.ComIAppEvents; import com.sun.jna.platform.win32.COM.util.office.excel.ComIApplication; import com.sun.jna.platform.win32.COM.util.office.excel.ComIRange; +import com.sun.jna.platform.win32.COM.util.office.excel.ComIWorkbook; import com.sun.jna.platform.win32.COM.util.office.excel.ComIWorksheet; -import com.sun.jna.platform.win32.COM.util.office.word.ComWord_Application; +import com.sun.jna.platform.win32.Ole32; +import java.io.IOException; public class MSOfficeExcelDemo { + private static final String currentWorkingDir = new File("").getAbsolutePath() + File.separator; - /** - * @param args - */ - public static void main(String[] args) { - new MSOfficeExcelDemo(); - } - - private String currentWorkingDir = new File("").getAbsolutePath() + File.separator; - - public MSOfficeExcelDemo() { - this.testMSExcel(); - } - - public void testMSExcel() { - ComExcel_Application excelObject = null; - ComIApplication msExcel = null; - Factory factory = null; + public static void main(String[] argv) throws IOException { + Ole32.INSTANCE.CoInitializeEx(Pointer.NULL, Ole32.COINIT_MULTITHREADED); + try { + testExcel(); + } finally { + Ole32.INSTANCE.CoUninitialize(); + } + } + + public static void testExcel() throws IOException { + File demoDocument = null; + ComIApplication msExcel = null; + Factory factory = new Factory(); try { - factory = new Factory(); - excelObject = factory.createObject(ComExcel_Application.class); + System.out.println("Files in temp dir: " + Helper.tempDir.getAbsolutePath()); + + ComExcel_Application excelObject = factory.createObject(ComExcel_Application.class); msExcel = excelObject.queryInterface(ComIApplication.class); + System.out.println("MSExcel version: " + msExcel.getVersion()); + msExcel.setVisible(true); - // msExcel.newExcelBook(); - msExcel.getWorkbooks().Open(currentWorkingDir + "jnatest.xls"); + + Helper.sleep(5); + + demoDocument = Helper.createNotExistingFile("jnatest", ".xls"); + Helper.extractClasspathFileToReal("/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.xls", demoDocument); + + ComIWorkbook workbook = msExcel.getWorkbooks().Open(demoDocument.getAbsolutePath()); msExcel.getActiveSheet().getRange("A1").setValue("Hello from JNA!"); // wait 1sec. before closing - Thread.currentThread().sleep(1000); -// // close and save the active sheet -// msExcel.getActiveWorkbook().Close(true); -// msExcel.setVisible(true); + Helper.sleep(1); + // Save document into temp and close + File output = new File(Helper.tempDir, "jnatest.xls"); + output.delete(); + workbook.SaveAs(output.getAbsolutePath()); + msExcel.getActiveWorkbook().Close(false); + // // msExcel.newExcelBook(); -// msExcel.getWorkbooks().Open(currentWorkingDir + "jnatest.xls"); -// msExcel.getActiveSheet().getRange("A2").setValue("Hello again from JNA!"); + msExcel.getWorkbooks().Open(output.getAbsolutePath()); + msExcel.getActiveSheet().getRange("A2").setValue("Hello again from JNA!"); class Listener extends AbstractComEventCallbackListener implements ComIAppEvents { - boolean SheetSelectionChange_called; + volatile boolean SheetSelectionChange_called; @Override public void errorReceivingCallbackEvent(String message, Exception exception) { @@ -75,26 +87,32 @@ public void SheetSelectionChange(ComIWorksheet sheet, ComIRange target) { }; Listener listener = new Listener(); - msExcel.advise(ComIAppEvents.class, listener); -// -// msExcel.getActiveSheet().getRange("A5").Activate(); -// -// Thread.currentThread().sleep(500); + IComEventCallbackCookie cookie = msExcel.advise(ComIAppEvents.class, listener); - // close and save the active sheet - msExcel.getActiveWorkbook().Close(true); + Helper.sleep(1); + + msExcel.getActiveSheet().getRange("A5").Activate(); - msExcel.Quit(); - msExcel = null; - } catch (Exception e) { - e.printStackTrace(); + Helper.sleep(1); + + msExcel.unadvise(ComIAppEvents.class, cookie); + + System.out.println("Listener was fired: " + listener.SheetSelectionChange_called); + + // close and discard changes + msExcel.getActiveWorkbook().Close(false); } finally { + // Make sure the excel instance is shut down if (null != msExcel) { msExcel.Quit(); } - if (null != factory) { - factory.disposeAll(); - } + + // Release all objects acquired by the factory + factory.disposeAll(); + + if (demoDocument != null && demoDocument.exists()) { + demoDocument.delete(); + } } } } diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeWordDemo.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeWordDemo.java index 8221ca6d44..47393f2823 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeWordDemo.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/MSOfficeWordDemo.java @@ -16,95 +16,96 @@ import com.sun.jna.Pointer; import com.sun.jna.platform.win32.Ole32; -import com.sun.jna.platform.win32.COM.COMException; +import com.sun.jna.platform.win32.COM.Helper; import com.sun.jna.platform.win32.COM.util.Factory; import com.sun.jna.platform.win32.COM.util.office.word.ComIApplication; import com.sun.jna.platform.win32.COM.util.office.word.ComWord_Application; import com.sun.jna.platform.win32.COM.util.office.word.WdOriginalFormat; import com.sun.jna.platform.win32.COM.util.office.word.WdSaveFormat; +import java.io.IOException; public class MSOfficeWordDemo { + private static final String currentWorkingDir = new File("").getAbsolutePath() + File.separator; - /** - * @param args - */ - public static void main(String[] args) { - new MSOfficeWordDemo(); + public static void main(String[] args) throws IOException { + Ole32.INSTANCE.CoInitializeEx(Pointer.NULL, Ole32.COINIT_MULTITHREADED); + try { + testMSWord(); + } finally { + Ole32.INSTANCE.CoUninitialize(); + } } - private String currentWorkingDir = new File("").getAbsolutePath() + File.separator; - - public MSOfficeWordDemo() { - this.testMSWord(); - } - - public void testMSWord() { - ComWord_Application msWordObject = null; + public static void testMSWord() throws IOException { + File demoDocument = null; ComIApplication msWord = null; - Factory factory = null; - Ole32.INSTANCE.CoInitializeEx(Pointer.NULL, Ole32.COINIT_MULTITHREADED); + Factory factory = new Factory(); + try { - String tempDir = System.getProperty("java.io.tmpdir"); - System.out.println("Files in temp dir: "+tempDir); - - factory = new Factory(); - msWordObject = factory.createObject(ComWord_Application.class); + System.out.println("Files in temp dir: " + Helper.tempDir.getAbsolutePath()); + + ComWord_Application msWordObject = factory.createObject(ComWord_Application.class); msWord = msWordObject.queryInterface(ComIApplication.class); System.out.println("MSWord version: " + msWord.getVersion()); msWord.setVisible(true); - // msWord.newDocument(); - msWord.getDocuments().Open(currentWorkingDir + "jnatest.doc"); + + demoDocument = Helper.createNotExistingFile("jnatest", ".doc"); + Helper.extractClasspathFileToReal("/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.doc", demoDocument); + + msWord.getDocuments().Open(demoDocument.getAbsolutePath()); + + Helper.sleep(5); + msWord.getSelection().TypeText("Hello from JNA! \n\n"); // wait 10sec. before closing - Thread.sleep(1000); + Helper.sleep(10); // save in different formats // pdf format is only supported in MSWord 2007 and above - msWord.getActiveDocument().SaveAs(tempDir+"\\jnatestSaveAs.doc", WdSaveFormat.wdFormatDocument); - msWord.getActiveDocument().SaveAs(tempDir+"\\jnatestSaveAs.pdf", WdSaveFormat.wdFormatPDF); - msWord.getActiveDocument().SaveAs(tempDir+"\\jnatestSaveAs.rtf", WdSaveFormat.wdFormatRTF); - msWord.getActiveDocument().SaveAs(tempDir+"\\jnatestSaveAs.html", WdSaveFormat.wdFormatHTML); - // close and save the document + msWord.getActiveDocument().SaveAs(new File(Helper.tempDir, "jnatestSaveAs.doc").getAbsolutePath(), WdSaveFormat.wdFormatDocument); + msWord.getActiveDocument().SaveAs(new File(Helper.tempDir, "jnatestSaveAs.pdf").getAbsolutePath(), WdSaveFormat.wdFormatPDF); + msWord.getActiveDocument().SaveAs(new File(Helper.tempDir, "jnatestSaveAs.rtf").getAbsolutePath(), WdSaveFormat.wdFormatRTF); + msWord.getActiveDocument().SaveAs(new File(Helper.tempDir, "jnatestSaveAs.html").getAbsolutePath(), WdSaveFormat.wdFormatHTML); + // close and don't save the changes msWord.getActiveDocument().Close(false); + + // Create a new document msWord.getDocuments().Add(); // msWord.openDocument(currentWorkingDir + "jnatest.doc", true); - msWord.getSelection() - .TypeText( - "Hello from JNA! \n Please notice that JNA can control MS Word via the new COM interface! \nHere we are creating a new word document and we save it to the 'TEMP' directory!"); - // save with no user prompt - msWord.getActiveDocument().SaveAs(tempDir+"\\jnatestNewDoc1.docx", WdSaveFormat.wdFormatDocumentDefault); - msWord.getActiveDocument().SaveAs(tempDir+"\\jnatestNewDoc2.docx", WdSaveFormat.wdFormatDocumentDefault); - msWord.getActiveDocument().SaveAs(tempDir+"\\jnatestNewDoc3.docx", WdSaveFormat.wdFormatDocumentDefault); - // close and save the document + msWord.getSelection().TypeText( + "Hello from JNA! \n Please notice that JNA can control " + + "MS Word via the new COM interface! \nHere we are " + + "creating a new word document and we save it " + + "to the 'TEMP' directory!"); + // save with no user prompt + msWord.getActiveDocument().SaveAs(new File(Helper.tempDir, "jnatestNewDoc1.docx").getAbsolutePath(), WdSaveFormat.wdFormatDocumentDefault); + msWord.getActiveDocument().SaveAs(new File(Helper.tempDir, "jnatestNewDoc2.docx").getAbsolutePath(), WdSaveFormat.wdFormatDocumentDefault); + msWord.getActiveDocument().SaveAs(new File(Helper.tempDir, "jnatestNewDoc3.docx").getAbsolutePath(), WdSaveFormat.wdFormatDocumentDefault); + // close and don't save the changes msWord.getActiveDocument().Close(false); + // open 3 documents - msWord.getDocuments().Open(tempDir+"\\jnatestNewDoc1.docx"); + msWord.getDocuments().Open(new File(Helper.tempDir, "jnatestNewDoc1.docx").getAbsolutePath()); msWord.getSelection().TypeText("Hello some changes from JNA!\n"); - msWord.getDocuments().Open(tempDir+"\\jnatestNewDoc2.docx"); + msWord.getDocuments().Open(new File(Helper.tempDir, "jnatestNewDoc2.docx").getAbsolutePath()); msWord.getSelection().TypeText("Hello some changes from JNA!\n"); - msWord.getDocuments().Open(tempDir+"\\jnatestNewDoc3.docx"); + msWord.getDocuments().Open(new File(Helper.tempDir, "jnatestNewDoc3.docx").getAbsolutePath()); msWord.getSelection().TypeText("Hello some changes from JNA!\n"); // save the document and prompt the user msWord.getDocuments().Save(false, WdOriginalFormat.wdPromptUser); - // wait then close word - msWord.Quit(); - msWord = null; - } catch (InterruptedException ie) { - ie.printStackTrace(); - } catch (COMException e) { - if (e.getExcepInfo() != null) { - System.out.println("bstrSource: " + e.getExcepInfo().bstrSource); - System.out.println("bstrDescription: " + e.getExcepInfo().bstrDescription); - } - - // print stack trace - e.printStackTrace(); } finally { + // Make sure the word instance is shut down if (msWord != null) { msWord.Quit(); } + + // Release all objects acquired by the factory + factory.disposeAll(); + + if (demoDocument != null && demoDocument.exists()) { + demoDocument.delete(); + } } - Ole32.INSTANCE.CoUninitialize(); } } diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/Wordautomation_KB_313193_Mod.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/Wordautomation_KB_313193_Mod.java new file mode 100644 index 0000000000..dd939b0b76 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/Wordautomation_KB_313193_Mod.java @@ -0,0 +1,204 @@ + +package com.sun.jna.platform.win32.COM.util.office; + +import com.sun.jna.Pointer; +import com.sun.jna.platform.win32.COM.Helper; +import com.sun.jna.platform.win32.COM.util.Factory; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.COM.util.office.office.XlChartType; +import com.sun.jna.platform.win32.COM.util.office.word.ComIApplication; +import com.sun.jna.platform.win32.COM.util.office.word.ComIDocument; +import com.sun.jna.platform.win32.COM.util.office.word.ComWord_Application; +import com.sun.jna.platform.win32.COM.util.office.word.InlineShape; +import com.sun.jna.platform.win32.COM.util.office.word.Paragraph; +import com.sun.jna.platform.win32.COM.util.office.word.Range; +import com.sun.jna.platform.win32.COM.util.office.word.Table; +import com.sun.jna.platform.win32.COM.util.office.word.WdBreakType; +import com.sun.jna.platform.win32.COM.util.office.word.WdCollapseDirection; +import com.sun.jna.platform.win32.COM.util.office.word.WdExportCreateBookmarks; +import com.sun.jna.platform.win32.COM.util.office.word.WdExportFormat; +import com.sun.jna.platform.win32.COM.util.office.word.WdExportItem; +import com.sun.jna.platform.win32.COM.util.office.word.WdExportOptimizeFor; +import com.sun.jna.platform.win32.COM.util.office.word.WdExportRange; +import com.sun.jna.platform.win32.COM.util.office.word.WdInformation; +import com.sun.jna.platform.win32.COM.util.office.word.WdSaveOptions; +import com.sun.jna.platform.win32.Ole32; +import static com.sun.jna.platform.win32.Variant.VARIANT.VARIANT_MISSING; +import java.io.File; + + +import java.io.IOException; + + +/** + * Based on VB sample: https://support.microsoft.com/de-de/kb/313193 + * + *

This version of the sample runs without a visible word instance and in the + * end shuts down word. The process creates a PDF document, that is written to a + * temporary file, which name is printed.

+ * + *

Please note: The contained type-bindings are far from complete and only + * included as sample - please use one of the generators to generate complete + * bindings or enhance the coverage yourself.

+ */ +public class Wordautomation_KB_313193_Mod { + public static void main(String[] args) throws IOException { + // Initialize COM Subsystem + Ole32.INSTANCE.CoInitializeEx(Pointer.NULL, Ole32.COINIT_MULTITHREADED); + // Initialize Factory for COM object creation + Factory fact = new Factory(); + + try { + // oEndOfDoc is a predefined bookmark + final String oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */ + + // Start word application + ComWord_Application word = fact.createObject(ComWord_Application.class); + ComIApplication wordApp = word.queryInterface(ComIApplication.class); + + // Make word visible/invisible (invisible is default) + wordApp.setVisible(true); + + // Create an empty document (signiture of depends on bindings) + ComIDocument doc = wordApp.getDocuments().Add(); + + Helper.sleep(5); + + //Insert a paragraph at the beginning of the document. + Paragraph para1 = doc.getContent().getParagraphs().Add(VARIANT_MISSING); + para1.getRange().setText("Heading 1"); + para1.getRange().getFont().setBold(1); + //24 pt spacing after paragraph. + para1.getFormat().setSpaceAfter(24F); + para1.getRange().InsertParagraphAfter(); + + //Insert a paragraph at the end of the document. + Paragraph para2 = doc.getContent().getParagraphs().Add(doc.getBookmarks().Item(oEndOfDoc).getRange()); + para2.getRange().setText("Heading 2"); + para2.getFormat().setSpaceAfter(6F); + para2.getRange().InsertParagraphAfter(); + + //Insert another paragraph. + Paragraph para3 = doc.getContent().getParagraphs().Add(doc.getBookmarks().Item(oEndOfDoc).getRange()); + para3.getRange().setText("This is a sentence of normal text. Now here is a table:"); + para3.getRange().getFont().setBold(0); + para3.getFormat().setSpaceAfter(24F); + para3.getRange().InsertParagraphAfter(); + + //Insert a 3 x 5 table, fill it with data, and make the first row + //bold and italic. + Table table = doc.getTables().Add(doc.getBookmarks().Item(oEndOfDoc).getRange(), + 3, 5, VARIANT_MISSING, VARIANT_MISSING); + table.getRange().getParagraphFormat().setSpaceAfter(6F); + for(int r = 1; r <= 3; r++) { + for(int c = 1; c <= 5; c++) { + String strText = "r" + r + "c" + c; + table.Cell(r, c).getRange().setText(strText); + } + } + table.getRows().Item(1).getRange().getFont().setBold(1); + table.getRows().Item(1).getRange().getFont().setItalic(1); + + //Add some text after the table. + Paragraph para4 = doc.getContent().getParagraphs().Add(doc.getBookmarks().Item(oEndOfDoc).getRange()); + para4.getRange().InsertParagraphBefore(); + para4.getRange().setText("And here's another table:"); + para4.getFormat().setSpaceAfter(24F); + para4.getRange().InsertParagraphAfter(); + + //Insert a 5 x 2 table, fill it with data, and change the column widths. + table = doc.getTables().Add(doc.getBookmarks().Item(oEndOfDoc).getRange(), 5, 2, VARIANT_MISSING, VARIANT_MISSING); + table.getRange().getParagraphFormat().setSpaceAfter(6F); + + for(int r = 1; r <= 5; r++) { + for(int c = 1; c <= 2; c++) { + String strText = "r" + r + "c" + c; + table.Cell(r, c).getRange().setText(strText); + } + } + + //Change width of columns 1 & 2 + table.getColumns().Item(1).setWidth(wordApp.InchesToPoints(2F)); + table.getColumns().Item(2).setWidth(wordApp.InchesToPoints(3F)); + + //Keep inserting text. When you get to 7 inches from top of the + //document, insert a hard page break. + Range wrdRng; + float dPos = wordApp.InchesToPoints(7F); + doc.getBookmarks().Item(oEndOfDoc).getRange().InsertParagraphAfter(); + do { + wrdRng = doc.getBookmarks().Item(oEndOfDoc).getRange(); + wrdRng.getParagraphFormat().setSpaceAfter(6F); + wrdRng.InsertAfter("A line of text"); + wrdRng.InsertParagraphAfter(); + } while(dPos >= (Float) wrdRng.getInformation(WdInformation.wdVerticalPositionRelativeToPage)); + + wrdRng.Collapse(WdCollapseDirection.wdCollapseEnd); + wrdRng.InsertBreak(WdBreakType.wdPageBreak); + wrdRng.Collapse(WdCollapseDirection.wdCollapseEnd); + wrdRng.InsertAfter("We're now on page 2. Here's my chart:"); + wrdRng.InsertParagraphAfter(); + + //Insert a chart and change the chart. + InlineShape oShape = doc.getBookmarks().Item(oEndOfDoc).getRange() + .getInlineShapes().AddOLEObject( + "MSGraph.Chart.8", "", + Boolean.FALSE, Boolean.FALSE, VARIANT_MISSING, + VARIANT_MISSING, VARIANT_MISSING, VARIANT_MISSING); + + //Demonstrate use of late bound oChart and oChartApp objects to + //manipulate the chart object with MSGraph. + IDispatch oChart = oShape.getOLEFormat().getObject(); + IDispatch oChartApp = oChart.getProperty(IDispatch.class, "Application"); + + //Change the chart type to Line + oChart.setProperty("ChartType", XlChartType.xlLine.getValue()); + + //Update the chart image and quit MSGraph. + oChartApp.invokeMethod(Void.class, "Update"); + oChartApp.invokeMethod(Void.class, "Quit"); + + //... If desired, you can proceed from here using the Microsoft Graph + //Object model on the oChart and oChartApp objects to make additional + //changes to the chart. + + //Set the width of the chart. + oShape.setWidth(wordApp.InchesToPoints(6.25f)); + oShape.setHeight(wordApp.InchesToPoints(3.57f)); + + //Add text after the chart. + wrdRng = doc.getBookmarks().Item(oEndOfDoc).getRange(); + wrdRng.InsertParagraphAfter(); + wrdRng.InsertAfter("THE END."); + + File tempFile = Helper.createNotExistingFile("KB_313193_", ".pdf"); + + doc.ExportAsFixedFormat( + tempFile.getAbsolutePath(), + WdExportFormat.wdExportFormatPDF, + Boolean.FALSE, + WdExportOptimizeFor.wdExportOptimizeForOnScreen, + WdExportRange.wdExportAllDocument, + null, + null, + WdExportItem.wdExportDocumentContent, + Boolean.FALSE, + Boolean.TRUE, + WdExportCreateBookmarks.wdExportCreateNoBookmarks, + Boolean.TRUE, + Boolean.FALSE, + Boolean.TRUE, + VARIANT_MISSING); + + System.out.println("Output written to: " + tempFile.getAbsolutePath()); + + doc.Close(WdSaveOptions.wdDoNotSaveChanges, VARIANT_MISSING, VARIANT_MISSING); + + wordApp.Quit(); + } finally { + fact.disposeAll(); + Ole32.INSTANCE.CoUninitialize(); + } + } + +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Borders.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Borders.java new file mode 100644 index 0000000000..8ce5e704bb --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Borders.java @@ -0,0 +1,20 @@ + +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface +public interface Borders { + @ComProperty + XlBorderWeight getWeight(); + + @ComProperty + void setWeight(XlBorderWeight weight); + + @ComProperty + XlLineStyle getLineStyle(); + + @ComProperty + void setLineStyle(XlLineStyle weight); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Chart.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Chart.java new file mode 100644 index 0000000000..c7cb106654 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Chart.java @@ -0,0 +1,19 @@ +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.IDispatch; +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; + +@ComInterface +public interface Chart { + @ComMethod + void ChartWizard(Object Source,Object Gallery,Object Format,Object PlotBy, + Object CategoryLabels,Object SeriesLabels,Object HasLegend, + Object Title,Object CategoryTitle,Object ValueTitle,Object ExtraTitle); + + @ComMethod + Series SeriesCollection(Object index); + + @ComMethod + IDispatch Location(XlChartLocation location, String name); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Charts.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Charts.java new file mode 100644 index 0000000000..591f0af646 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Charts.java @@ -0,0 +1,18 @@ +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface +public interface Charts { + + @ComMethod + Chart Add(Object before, Object after, Object count, Object type); + + @ComProperty + int getCount(); + + @ComProperty + int getItem(Object item); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComExcel_Application.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComExcel_Application.java index 07cc479b48..b1dde8ca70 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComExcel_Application.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComExcel_Application.java @@ -1,10 +1,10 @@ -package com.sun.jna.platform.win32.COM.util.office.excel; - -import com.sun.jna.platform.win32.COM.util.IUnknown; -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; -import com.sun.jna.platform.win32.COM.util.annotation.ComObject; - -@ComObject(progId="Excel.Application") -public interface ComExcel_Application extends IUnknown { - -} +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.IUnknown; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComObject; + +@ComObject(progId="Excel.Application") +public interface ComExcel_Application extends IUnknown { + +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIAppEvents.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIAppEvents.java index 381abef705..34840aaa78 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIAppEvents.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIAppEvents.java @@ -1,12 +1,12 @@ -package com.sun.jna.platform.win32.COM.util.office.excel; - -import com.sun.jna.platform.win32.COM.util.annotation.ComEventCallback; -import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; - -@ComInterface(iid="{00024413-0000-0000-C000-000000000046}") -public interface ComIAppEvents { - - @ComEventCallback(dispid=1558) - public void SheetSelectionChange(ComIWorksheet sheet, ComIRange target); - -} +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComEventCallback; +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; + +@ComInterface(iid="{00024413-0000-0000-C000-000000000046}") +public interface ComIAppEvents { + + @ComEventCallback(dispid=1558) + public void SheetSelectionChange(ComIWorksheet sheet, ComIRange target); + +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIApplication.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIApplication.java index 11f7cec543..ad4fe363b4 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIApplication.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIApplication.java @@ -1,32 +1,38 @@ -package com.sun.jna.platform.win32.COM.util.office.excel; - -import com.sun.jna.platform.win32.COM.util.IConnectionPoint; -import com.sun.jna.platform.win32.COM.util.IUnknown; -import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; -import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; - -@ComInterface(iid="{000208D5-0000-0000-C000-000000000046}") -public interface ComIApplication extends IUnknown, IConnectionPoint { - - @ComProperty - String getVersion(); - - @ComProperty - boolean getVisible(); - - @ComProperty - void setVisible(boolean value); - - @ComProperty - ComIWorkbooks getWorkbooks(); - - @ComProperty - ComIWorksheet getActiveSheet(); - - @ComProperty - ComIWorkbook getActiveWorkbook(); - - @ComMethod - void Quit(); -} +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.IConnectionPoint; +import com.sun.jna.platform.win32.COM.util.IUnknown; +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface(iid="{000208D5-0000-0000-C000-000000000046}") +public interface ComIApplication extends IUnknown, IConnectionPoint { + + @ComProperty + String getVersion(); + + @ComProperty + boolean getVisible(); + + @ComProperty + void setVisible(boolean value); + + @ComProperty + ComIWorkbooks getWorkbooks(); + + @ComProperty + ComIWorksheet getActiveSheet(); + + @ComProperty + ComIWorkbook getActiveWorkbook(); + + @ComMethod + void Quit(); + + @ComProperty + boolean getUserControl(); + + @ComProperty + void setUserControl(boolean value); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIRange.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIRange.java index 4d79f20f44..61eb37383a 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIRange.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIRange.java @@ -1,25 +1,93 @@ -package com.sun.jna.platform.win32.COM.util.office.excel; - -import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; -import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; - -@ComInterface(iid = "{00020846-0000-0000-C000-000000000046}") -public interface ComIRange { - - @ComProperty - ComIApplication getApplication(); - - @ComProperty - String getText(); - - @ComMethod - void Select(); - - @ComProperty - void setValue(String value); - - @ComMethod - void Activate(); - -} +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface(iid = "{00020846-0000-0000-C000-000000000046}") +public interface ComIRange { + + @ComProperty + ComIApplication getApplication(); + + @ComProperty + String getText(); + + @ComMethod + void Select(); + + @ComProperty + void setValue(String value); + + @ComMethod + void Activate(); + + @ComProperty + ComIRange getItem(Object rowIndex, Object columnIndex); + + @ComProperty + void setValue(Object data); + + @ComProperty + Object getValue(); + + @ComProperty + void setFormula(String data); + + @ComProperty + String getFormula(); + + @ComProperty + void setNumberFormat(String data); + + @ComProperty + String getNumberFormat(); + + @ComProperty + ComIRange getEntireColumn(); + + @ComMethod + void AutoFit(); + + @ComProperty + public ComIRange getResize(Object rowSize, Object columnSize); + + @ComProperty + void setOrientation(int degree); + + @ComProperty + int getOrientation(); + + @ComProperty + void setWrapText(boolean wrap); + + @ComProperty + boolean getWrapText(); + + @ComProperty + Interior getInterior(); + + @ComProperty + Borders getBorders(); + + @ComProperty + int getTop(); + + @ComProperty + void setTop(int value); + + @ComProperty + int getLeft(); + + @ComProperty + void setLeft(int value); + + @ComProperty + String getName(); + + @ComProperty + void setName(String name); + + @ComProperty + void setAddress(String name); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorkbook.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorkbook.java index 375a684510..36d0aff2e5 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorkbook.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorkbook.java @@ -1,13 +1,24 @@ -package com.sun.jna.platform.win32.COM.util.office.excel; - -import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; - -@ComInterface(iid="{0002096B-0000-0000-C000-000000000046}") -public interface ComIWorkbook { - - @ComMethod - void Close(boolean saveChanges); - - -} +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface(iid="{0002096B-0000-0000-C000-000000000046}") +public interface ComIWorkbook { + + @ComMethod + void Close(boolean saveChanges); + + @ComProperty + ComIWorksheet getActiveSheet(); + + @ComMethod + void Save(); + + @ComMethod + void SaveAs(String filename); + + @ComProperty + Charts getCharts(); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorkbooks.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorkbooks.java index c9174c23c2..993404ea83 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorkbooks.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorkbooks.java @@ -1,19 +1,21 @@ -package com.sun.jna.platform.win32.COM.util.office.excel; - -import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; -import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; - -@ComInterface(iid = "{000208DB-0000-0000-C000-000000000046}") -public interface ComIWorkbooks { - - @ComProperty - long getCount(); - - @ComMethod - ComIWorkbook Item(long index); - - @ComMethod - ComIWorkbook Open(Object FileName); - -} +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface(iid = "{000208DB-0000-0000-C000-000000000046}") +public interface ComIWorkbooks { + + @ComProperty + long getCount(); + + @ComMethod + ComIWorkbook Item(long index); + + @ComMethod + ComIWorkbook Open(Object FileName); + + @ComMethod + ComIWorkbook Add(); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorksheet.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorksheet.java index 2687f80d27..34bc83b89a 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorksheet.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/ComIWorksheet.java @@ -1,19 +1,34 @@ -package com.sun.jna.platform.win32.COM.util.office.excel; - -import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; -import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; - -@ComInterface(iid="{000208D8-0000-0000-C000-000000000046}") -public interface ComIWorksheet { - - @ComProperty - String getName(); - - @ComProperty - ComIRange getRange(String cell1); - - @ComProperty - ComIApplication getApplication(); - -} +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface(iid="{000208D8-0000-0000-C000-000000000046}") +public interface ComIWorksheet { + @ComProperty + ComIWorkbook getParent(); + + @ComProperty + String getName(); + + @ComProperty + ComIRange getRange(String cell1); + + @ComProperty + ComIRange getRange(String cell1, String cell2); + + @ComProperty + ComIApplication getApplication(); + + @ComProperty + ComIRange getCells(); + + @ComProperty + Shapes getShapes(); + + @ComProperty + ComIRange getRows(Object identifier); + + @ComProperty + ComIRange getColumns(Object identifier); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Interior.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Interior.java new file mode 100644 index 0000000000..f23944ba57 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Interior.java @@ -0,0 +1,14 @@ + +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface +public interface Interior { + @ComProperty + int getColorIndex(); + + @ComProperty + void setColorIndex(int value); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Series.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Series.java new file mode 100644 index 0000000000..02faf0b180 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Series.java @@ -0,0 +1,16 @@ +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface +public interface Series { + @ComProperty + void setXValues(Object values); + + @ComProperty + String getName(); + + @ComProperty + void setName(String name); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Shape.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Shape.java new file mode 100644 index 0000000000..e4142646c4 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Shape.java @@ -0,0 +1,21 @@ +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface +public interface Shape { + + @ComProperty + int getTop(); + + @ComProperty + void setTop(int value); + + @ComProperty + int getLeft(); + + @ComProperty + void setLeft(int value); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Shapes.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Shapes.java new file mode 100644 index 0000000000..da4eebe453 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Shapes.java @@ -0,0 +1,10 @@ +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; + +@ComInterface +public interface Shapes { + @ComMethod + Shape Item(Object index); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlBorderWeight.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlBorderWeight.java new file mode 100644 index 0000000000..46d91ed344 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlBorderWeight.java @@ -0,0 +1,22 @@ + +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.office.word.*; +import com.sun.jna.platform.win32.COM.util.IComEnum; + +public enum XlBorderWeight implements IComEnum { + + xlHairline(1), + xlMedium(-4138), + xlThick(4), + xlThin(2); + + private XlBorderWeight(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlChartLocation.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlChartLocation.java new file mode 100644 index 0000000000..645622ed5c --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlChartLocation.java @@ -0,0 +1,20 @@ +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.office.word.*; +import com.sun.jna.platform.win32.COM.util.IComEnum; + +public enum XlChartLocation implements IComEnum { + + xlLocationAsNewSheet(1), + xlLocationAsObject(2), + xlLocationAutomatic(3); + + private XlChartLocation(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlChartType.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlChartType.java new file mode 100644 index 0000000000..4328ea1e36 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlChartType.java @@ -0,0 +1,91 @@ + +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.office.word.*; +import com.sun.jna.platform.win32.COM.util.IComEnum; + +public enum XlChartType implements IComEnum { + + xlColumnClustered(51), + xlColumnStacked(52), + xlColumnStacked100(53), + xl3DColumnClustered(54), + xl3DColumnStacked(55), + xl3DColumnStacked100(56), + xlBarClustered(57), + xlBarStacked(58), + xlBarStacked100(59), + xl3DBarClustered(60), + xl3DBarStacked(61), + xl3DBarStacked100(62), + xlLineStacked(63), + xlLineStacked100(64), + xlLineMarkers(65), + xlLineMarkersStacked(66), + xlLineMarkersStacked100(67), + xlPieOfPie(68), + xlPieExploded(69), + xl3DPieExploded(70), + xlBarOfPie(71), + xlXYScatterSmooth(72), + xlXYScatterSmoothNoMarkers(73), + xlXYScatterLines(74), + xlXYScatterLinesNoMarkers(75), + xlAreaStacked(76), + xlAreaStacked100(77), + xl3DAreaStacked(78), + xl3DAreaStacked100(79), + xlDoughnutExploded(80), + xlRadarMarkers(81), + xlRadarFilled(82), + xlSurface(83), + xlSurfaceWireframe(84), + xlSurfaceTopView(85), + xlSurfaceTopViewWireframe(86), + xlBubble(15), + xlBubble3DEffect(87), + xlStockHLC(88), + xlStockOHLC(89), + xlStockVHLC(90), + xlStockVOHLC(91), + xlCylinderColClustered(92), + xlCylinderColStacked(93), + xlCylinderColStacked100(94), + xlCylinderBarClustered(95), + xlCylinderBarStacked(96), + xlCylinderBarStacked100(97), + xlCylinderCol(98), + xlConeColClustered(99), + xlConeColStacked(100), + xlConeColStacked100(101), + xlConeBarClustered(102), + xlConeBarStacked(103), + xlConeBarStacked100(104), + xlConeCol(105), + xlPyramidColClustered(106), + xlPyramidColStacked(107), + xlPyramidColStacked100(108), + xlPyramidBarClustered(109), + xlPyramidBarStacked(110), + xlPyramidBarStacked100(111), + xlPyramidCol(112), + xl3DColumn(-4100), + xlLine(4), + xl3DLine(-4101), + xl3DPie(-4102), + xlPie(5), + xlXYScatter(-4169), + xl3DArea(-4098), + xlArea(1), + xlDoughnut(-4120), + xlRadar(-4151); + + private XlChartType(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlLineStyle.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlLineStyle.java new file mode 100644 index 0000000000..d670c75d84 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlLineStyle.java @@ -0,0 +1,26 @@ + +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.office.word.*; +import com.sun.jna.platform.win32.COM.util.IComEnum; + +public enum XlLineStyle implements IComEnum { + + xlContinuous(1), + xlDash(-4115), + xlDashDot(4), + xlDashDotDot(5), + xlDot(-4118), + xlDouble(-4119), + xlSlantDashDot(13), + xlLineStyleNone(-4142); + + private XlLineStyle(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlRowCol.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlRowCol.java new file mode 100644 index 0000000000..e5655db12f --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlRowCol.java @@ -0,0 +1,20 @@ + +package com.sun.jna.platform.win32.COM.util.office.excel; + +import com.sun.jna.platform.win32.COM.util.office.word.*; +import com.sun.jna.platform.win32.COM.util.IComEnum; + +public enum XlRowCol implements IComEnum { + + xlColumns(2), + xlRows(1); + + private XlRowCol(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/office/XlChartType.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/office/XlChartType.java new file mode 100644 index 0000000000..e2fd1b9edf --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/office/XlChartType.java @@ -0,0 +1,412 @@ + +package com.sun.jna.platform.win32.COM.util.office.office; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +public enum XlChartType implements IComEnum { + + /** + * (51) + */ + xlColumnClustered(51), + + /** + * (52) + */ + xlColumnStacked(52), + + /** + * (53) + */ + xlColumnStacked100(53), + + /** + * (54) + */ + xl3DColumnClustered(54), + + /** + * (55) + */ + xl3DColumnStacked(55), + + /** + * (56) + */ + xl3DColumnStacked100(56), + + /** + * (57) + */ + xlBarClustered(57), + + /** + * (58) + */ + xlBarStacked(58), + + /** + * (59) + */ + xlBarStacked100(59), + + /** + * (60) + */ + xl3DBarClustered(60), + + /** + * (61) + */ + xl3DBarStacked(61), + + /** + * (62) + */ + xl3DBarStacked100(62), + + /** + * (63) + */ + xlLineStacked(63), + + /** + * (64) + */ + xlLineStacked100(64), + + /** + * (65) + */ + xlLineMarkers(65), + + /** + * (66) + */ + xlLineMarkersStacked(66), + + /** + * (67) + */ + xlLineMarkersStacked100(67), + + /** + * (68) + */ + xlPieOfPie(68), + + /** + * (69) + */ + xlPieExploded(69), + + /** + * (70) + */ + xl3DPieExploded(70), + + /** + * (71) + */ + xlBarOfPie(71), + + /** + * (72) + */ + xlXYScatterSmooth(72), + + /** + * (73) + */ + xlXYScatterSmoothNoMarkers(73), + + /** + * (74) + */ + xlXYScatterLines(74), + + /** + * (75) + */ + xlXYScatterLinesNoMarkers(75), + + /** + * (76) + */ + xlAreaStacked(76), + + /** + * (77) + */ + xlAreaStacked100(77), + + /** + * (78) + */ + xl3DAreaStacked(78), + + /** + * (79) + */ + xl3DAreaStacked100(79), + + /** + * (80) + */ + xlDoughnutExploded(80), + + /** + * (81) + */ + xlRadarMarkers(81), + + /** + * (82) + */ + xlRadarFilled(82), + + /** + * (83) + */ + xlSurface(83), + + /** + * (84) + */ + xlSurfaceWireframe(84), + + /** + * (85) + */ + xlSurfaceTopView(85), + + /** + * (86) + */ + xlSurfaceTopViewWireframe(86), + + /** + * (15) + */ + xlBubble(15), + + /** + * (87) + */ + xlBubble3DEffect(87), + + /** + * (88) + */ + xlStockHLC(88), + + /** + * (89) + */ + xlStockOHLC(89), + + /** + * (90) + */ + xlStockVHLC(90), + + /** + * (91) + */ + xlStockVOHLC(91), + + /** + * (92) + */ + xlCylinderColClustered(92), + + /** + * (93) + */ + xlCylinderColStacked(93), + + /** + * (94) + */ + xlCylinderColStacked100(94), + + /** + * (95) + */ + xlCylinderBarClustered(95), + + /** + * (96) + */ + xlCylinderBarStacked(96), + + /** + * (97) + */ + xlCylinderBarStacked100(97), + + /** + * (98) + */ + xlCylinderCol(98), + + /** + * (99) + */ + xlConeColClustered(99), + + /** + * (100) + */ + xlConeColStacked(100), + + /** + * (101) + */ + xlConeColStacked100(101), + + /** + * (102) + */ + xlConeBarClustered(102), + + /** + * (103) + */ + xlConeBarStacked(103), + + /** + * (104) + */ + xlConeBarStacked100(104), + + /** + * (105) + */ + xlConeCol(105), + + /** + * (106) + */ + xlPyramidColClustered(106), + + /** + * (107) + */ + xlPyramidColStacked(107), + + /** + * (108) + */ + xlPyramidColStacked100(108), + + /** + * (109) + */ + xlPyramidBarClustered(109), + + /** + * (110) + */ + xlPyramidBarStacked(110), + + /** + * (111) + */ + xlPyramidBarStacked100(111), + + /** + * (112) + */ + xlPyramidCol(112), + + /** + * (-4100) + */ + xl3DColumn(-4100), + + /** + * (4) + */ + xlLine(4), + + /** + * (-4101) + */ + xl3DLine(-4101), + + /** + * (-4102) + */ + xl3DPie(-4102), + + /** + * (5) + */ + xlPie(5), + + /** + * (-4169) + */ + xlXYScatter(-4169), + + /** + * (-4098) + */ + xl3DArea(-4098), + + /** + * (1) + */ + xlArea(1), + + /** + * (-4120) + */ + xlDoughnut(-4120), + + /** + * (-4151) + */ + xlRadar(-4151), + + /** + * (-4152) + */ + xlCombo(-4152), + + /** + * (113) + */ + xlComboColumnClusteredLine(113), + + /** + * (114) + */ + xlComboColumnClusteredLineSecondaryAxis(114), + + /** + * (115) + */ + xlComboAreaStackedColumnClustered(115), + + /** + * (116) + */ + xlOtherCombinations(116), + + /** + * (-2) + */ + xlSuggestedChart(-2), + ; + + private XlChartType(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/jnatest.doc b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.doc similarity index 100% rename from contrib/msoffice/jnatest.doc rename to contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.doc diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.xls b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.xls new file mode 100644 index 0000000000..0c6dadeea0 Binary files /dev/null and b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.xls differ diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Bookmark.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Bookmark.java new file mode 100644 index 0000000000..7667341ea9 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Bookmark.java @@ -0,0 +1,94 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({00020968-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020968-0000-0000-C000-000000000046}") +public interface Bookmark { + /** + *

id(0x0)

+ */ + @ComProperty(name = "Name", dispId = 0x0) + String getName(); + + /** + *

id(0x1)

+ */ + @ComProperty(name = "Range", dispId = 0x1) + Range getRange(); + + /** + *

id(0x2)

+ */ + @ComProperty(name = "Empty", dispId = 0x2) + Boolean getEmpty(); + + /** + *

id(0x3)

+ */ + @ComProperty(name = "Start", dispId = 0x3) + Integer getStart(); + + /** + *

id(0x3)

+ */ + @ComProperty(name = "Start", dispId = 0x3) + void setStart(Integer param0); + + /** + *

id(0x4)

+ */ + @ComProperty(name = "End", dispId = 0x4) + Integer getEnd(); + + /** + *

id(0x4)

+ */ + @ComProperty(name = "End", dispId = 0x4) + void setEnd(Integer param0); + + /** + *

id(0x5)

+ */ + @ComProperty(name = "Column", dispId = 0x5) + Boolean getColumn(); + + /** + *

id(0x3e9)

+ */ + @ComProperty(name = "Creator", dispId = 0x3e9) + Integer getCreator(); + + /** + *

id(0x3ea)

+ */ + @ComProperty(name = "Parent", dispId = 0x3ea) + com.sun.jna.platform.win32.COM.util.IDispatch getParent(); + + /** + *

id(0xffff)

+ */ + @ComMethod(name = "Select", dispId = 0xffff) + void Select(); + + /** + *

id(0xb)

+ */ + @ComMethod(name = "Delete", dispId = 0xb) + void Delete(); + + /** + *

id(0xc)

+ */ + @ComMethod(name = "Copy", dispId = 0xc) + Bookmark Copy(String Name); + + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Bookmarks.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Bookmarks.java new file mode 100644 index 0000000000..f993d19767 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Bookmarks.java @@ -0,0 +1,28 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({00020967-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020967-0000-0000-C000-000000000046}") +public interface Bookmarks { + /** + *

id(0x2)

+ */ + @ComProperty(name = "Count", dispId = 0x2) + Integer getCount(); + + /** + *

id(0x0)

+ */ + @ComMethod(name = "Item", dispId = 0x0) + Bookmark Item(Object Index); + + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Cell.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Cell.java new file mode 100644 index 0000000000..6531fe496e --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Cell.java @@ -0,0 +1,20 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({0002094E-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{0002094E-0000-0000-C000-000000000046}") +public interface Cell { + /** + *

id(0x0)

+ */ + @ComProperty(name = "Range", dispId = 0x0) + Range getRange(); +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Column.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Column.java new file mode 100644 index 0000000000..f559c4e015 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Column.java @@ -0,0 +1,26 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({0002094F-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{0002094F-0000-0000-C000-000000000046}") +public interface Column { + /** + *

id(0x3)

+ */ + @ComProperty(name = "Width", dispId = 0x3) + Float getWidth(); + + /** + *

id(0x3)

+ */ + @ComProperty(name = "Width", dispId = 0x3) + void setWidth(Float param0); +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Columns.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Columns.java new file mode 100644 index 0000000000..b3000b9ba1 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Columns.java @@ -0,0 +1,37 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({0002094B-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{0002094B-0000-0000-C000-000000000046}") +public interface Columns { + /** + *

id(0x2)

+ */ + @ComProperty(name = "Count", dispId = 0x2) + Integer getCount(); + /** + *

id(0x0)

+ */ + @ComMethod(name = "Item", dispId = 0x0) + Column Item(Integer Index); + + /** + *

id(0x5)

+ */ + @ComMethod(name = "Add", dispId = 0x5) + Column Add(Object BeforeColumn); + + /** + *

id(0xc8)

+ */ + @ComMethod(name = "Delete", dispId = 0xc8) + void Delete(); +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIApplication.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIApplication.java index 10a18b21e8..7de6e1b8fa 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIApplication.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIApplication.java @@ -1,43 +1,49 @@ -/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - */ -package com.sun.jna.platform.win32.COM.util.office.word; - -import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; -import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; - -@ComInterface(iid="{00020970-0000-0000-C000-000000000046}") -public interface ComIApplication { - - @ComProperty - String getVersion(); - - @ComProperty - boolean getVisible(); - - @ComProperty - void setVisible(boolean value); - - @ComProperty - ComIDocuments getDocuments(); - - @ComProperty - ComISelection getSelection(); - - @ComProperty - ComIDocument getActiveDocument(); - - @ComMethod - void Quit(); - -} +/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +@ComInterface(iid="{00020970-0000-0000-C000-000000000046}") +public interface ComIApplication { + + @ComProperty + String getVersion(); + + @ComProperty + boolean getVisible(); + + @ComProperty + void setVisible(boolean value); + + @ComProperty + ComIDocuments getDocuments(); + + @ComProperty + ComISelection getSelection(); + + @ComProperty + ComIDocument getActiveDocument(); + + @ComMethod + void Quit(); + + /** + *

+ * id(0x172)

+ */ + @ComMethod(name = "InchesToPoints", dispId = 0x172) + Float InchesToPoints(Float Inches); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIDocument.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIDocument.java index e370130b8e..3b7891aace 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIDocument.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIDocument.java @@ -1,25 +1,73 @@ -/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - */ -package com.sun.jna.platform.win32.COM.util.office.word; - -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; - -public interface ComIDocument { - - @ComMethod - void SaveAs(String string, WdSaveFormat wdFormatDocument); - - @ComMethod - void Close(boolean saveChanges); - -} +/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +public interface ComIDocument { + + @ComMethod + void SaveAs(String string, WdSaveFormat wdFormatDocument); + + @ComMethod + void Close(boolean saveChanges); + + /** + *

id(0x451)

+ */ + @ComMethod(name = "Close", dispId = 0x451) + void Close(Object SaveChanges, + Object OriginalFormat, + Object RouteDocument); + + /** + *

+ * id(0x29)

+ */ + @ComProperty(name = "Content", dispId = 0x29) + Range getContent(); + + /** + *

id(0x4)

+ */ + @ComProperty(name = "Bookmarks", dispId = 0x4) + Bookmarks getBookmarks(); + + /** + *

+ * id(0x6)

+ */ + @ComProperty(name = "Tables", dispId = 0x6) + Tables getTables(); + + /** + *

id(0x228)

+ */ + @ComMethod(name = "ExportAsFixedFormat", dispId = 0x228) + void ExportAsFixedFormat(String OutputFileName, + WdExportFormat ExportFormat, + Boolean OpenAfterExport, + WdExportOptimizeFor OptimizeFor, + WdExportRange Range, + Integer From, + Integer To, + WdExportItem Item, + Boolean IncludeDocProps, + Boolean KeepIRM, + WdExportCreateBookmarks CreateBookmarks, + Boolean DocStructureTags, + Boolean BitmapMissingFonts, + Boolean UseISO19005_1, + Object FixedFormatExtClassPtr); +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIDocuments.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIDocuments.java index 2096de5af5..5563916e3e 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIDocuments.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComIDocuments.java @@ -1,28 +1,28 @@ -/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - */ -package com.sun.jna.platform.win32.COM.util.office.word; - -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; - -public interface ComIDocuments { - - @ComMethod - ComIDocument Open(String fileName); - - @ComMethod - ComIDocument Add(); - - @ComMethod - void Save(boolean noPrompt, WdOriginalFormat originalFormat); - -} +/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; + +public interface ComIDocuments { + + @ComMethod + ComIDocument Open(String fileName); + + @ComMethod + ComIDocument Add(); + + @ComMethod + void Save(boolean noPrompt, WdOriginalFormat originalFormat); + +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComISelection.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComISelection.java index 53d59b4f90..f551be764f 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComISelection.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComISelection.java @@ -1,24 +1,24 @@ -/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - */ -package com.sun.jna.platform.win32.COM.util.office.word; - -import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; -import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; - -@ComInterface -public interface ComISelection { - - @ComMethod - void TypeText(String text); - -} +/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; + +@ComInterface +public interface ComISelection { + + @ComMethod + void TypeText(String text); + +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComWord_Application.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComWord_Application.java index af7a26e2d9..798cd5a596 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComWord_Application.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ComWord_Application.java @@ -1,21 +1,21 @@ -/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - */ -package com.sun.jna.platform.win32.COM.util.office.word; - -import com.sun.jna.platform.win32.COM.util.IUnknown; -import com.sun.jna.platform.win32.COM.util.annotation.ComObject; - -@ComObject(progId="Word.Application") -public interface ComWord_Application extends IUnknown { - -} +/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IUnknown; +import com.sun.jna.platform.win32.COM.util.annotation.ComObject; + +@ComObject(progId="Word.Application") +public interface ComWord_Application extends IUnknown { + +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Font.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Font.java new file mode 100644 index 0000000000..7a18631596 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Font.java @@ -0,0 +1,22 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.COMException; +import com.sun.jna.platform.win32.COM.util.IComEventCallbackCookie; +import com.sun.jna.platform.win32.COM.util.IComEventCallbackListener; +import com.sun.jna.platform.win32.COM.util.IConnectionPoint; +import com.sun.jna.platform.win32.COM.util.IUnknown; +import com.sun.jna.platform.win32.COM.util.annotation.ComObject; + +/** + *

uuid({000209F5-0000-0000-C000-000000000046})

+ *

interface(_Font)

+ *

interface(IUnknown)

+ */ +@ComObject(clsId = "{000209F5-0000-0000-C000-000000000046}") +public interface Font extends + _Font, + IUnknown +{ + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/InlineShape.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/InlineShape.java new file mode 100644 index 0000000000..e8efe636df --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/InlineShape.java @@ -0,0 +1,47 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +/** + *

uuid({000209A8-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{000209A8-0000-0000-C000-000000000046}") +public interface InlineShape { + /** + *

id(0x2)

+ */ + @ComProperty(name = "Range", dispId = 0x2) + Range getRange(); + + /** + *

id(0x5)

+ */ + @ComProperty(name = "OLEFormat", dispId = 0x5) + OLEFormat getOLEFormat(); + + /** + *

id(0x8)

+ */ + @ComProperty(name = "Height", dispId = 0x8) + Float getHeight(); + + /** + *

id(0x8)

+ */ + @ComProperty(name = "Height", dispId = 0x8) + void setHeight(Float param0); + + /** + *

id(0x9)

+ */ + @ComProperty(name = "Width", dispId = 0x9) + Float getWidth(); + + /** + *

id(0x9)

+ */ + @ComProperty(name = "Width", dispId = 0x9) + void setWidth(Float param0); +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/InlineShapes.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/InlineShapes.java new file mode 100644 index 0000000000..147de1081c --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/InlineShapes.java @@ -0,0 +1,25 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; + +/** + *

uuid({000209A9-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{000209A9-0000-0000-C000-000000000046}") +public interface InlineShapes { + /** + *

id(0x18)

+ */ + @ComMethod(name = "AddOLEObject", dispId = 0x18) + InlineShape AddOLEObject(Object ClassType, + Object FileName, + Object LinkToFile, + Object DisplayAsIcon, + Object IconFileName, + Object IconIndex, + Object IconLabel, + Object Range); + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/OLEFormat.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/OLEFormat.java new file mode 100644 index 0000000000..4898a4528b --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/OLEFormat.java @@ -0,0 +1,170 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({00020933-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020933-0000-0000-C000-000000000046}") +public interface OLEFormat { + /** + *

id(0x3e8)

+ */ + @ComProperty(name = "Application", dispId = 0x3e8) + ComIApplication getApplication(); + + /** + *

id(0x3e9)

+ */ + @ComProperty(name = "Creator", dispId = 0x3e9) + Integer getCreator(); + + /** + *

id(0x3ea)

+ */ + @ComProperty(name = "Parent", dispId = 0x3ea) + com.sun.jna.platform.win32.COM.util.IDispatch getParent(); + + /** + *

id(0x2)

+ */ + @ComProperty(name = "ClassType", dispId = 0x2) + String getClassType(); + + /** + *

id(0x2)

+ */ + @ComProperty(name = "ClassType", dispId = 0x2) + void setClassType(String param0); + + /** + *

id(0x3)

+ */ + @ComProperty(name = "DisplayAsIcon", dispId = 0x3) + Boolean getDisplayAsIcon(); + + /** + *

id(0x3)

+ */ + @ComProperty(name = "DisplayAsIcon", dispId = 0x3) + void setDisplayAsIcon(Boolean param0); + + /** + *

id(0x7)

+ */ + @ComProperty(name = "IconName", dispId = 0x7) + String getIconName(); + + /** + *

id(0x7)

+ */ + @ComProperty(name = "IconName", dispId = 0x7) + void setIconName(String param0); + + /** + *

id(0x8)

+ */ + @ComProperty(name = "IconPath", dispId = 0x8) + String getIconPath(); + + /** + *

id(0x9)

+ */ + @ComProperty(name = "IconIndex", dispId = 0x9) + Integer getIconIndex(); + + /** + *

id(0x9)

+ */ + @ComProperty(name = "IconIndex", dispId = 0x9) + void setIconIndex(Integer param0); + + /** + *

id(0xa)

+ */ + @ComProperty(name = "IconLabel", dispId = 0xa) + String getIconLabel(); + + /** + *

id(0xa)

+ */ + @ComProperty(name = "IconLabel", dispId = 0xa) + void setIconLabel(String param0); + + /** + *

id(0xc)

+ */ + @ComProperty(name = "Label", dispId = 0xc) + String getLabel(); + + /** + *

id(0xe)

+ */ + @ComProperty(name = "Object", dispId = 0xe) + com.sun.jna.platform.win32.COM.util.IDispatch getObject(); + + /** + *

id(0x16)

+ */ + @ComProperty(name = "ProgID", dispId = 0x16) + String getProgID(); + + /** + *

id(0x68)

+ */ + @ComMethod(name = "Activate", dispId = 0x68) + void Activate(); + + /** + *

id(0x6a)

+ */ + @ComMethod(name = "Edit", dispId = 0x6a) + void Edit(); + + /** + *

id(0x6b)

+ */ + @ComMethod(name = "Open", dispId = 0x6b) + void Open(); + + /** + *

id(0x6d)

+ */ + @ComMethod(name = "DoVerb", dispId = 0x6d) + void DoVerb(Object VerbIndex); + + /** + *

id(0x6e)

+ */ + @ComMethod(name = "ConvertTo", dispId = 0x6e) + void ConvertTo(Object ClassType, + Object DisplayAsIcon, + Object IconFileName, + Object IconIndex, + Object IconLabel); + + /** + *

id(0x6f)

+ */ + @ComMethod(name = "ActivateAs", dispId = 0x6f) + void ActivateAs(String ClassType); + + /** + *

id(0x70)

+ */ + @ComProperty(name = "PreserveFormattingOnUpdate", dispId = 0x70) + Boolean getPreserveFormattingOnUpdate(); + + /** + *

id(0x70)

+ */ + @ComProperty(name = "PreserveFormattingOnUpdate", dispId = 0x70) + void setPreserveFormattingOnUpdate(Boolean param0); + + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Paragraph.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Paragraph.java new file mode 100644 index 0000000000..3651392860 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Paragraph.java @@ -0,0 +1,32 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({00020957-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020957-0000-0000-C000-000000000046}") +public interface Paragraph { + /** + *

id(0x0)

+ */ + @ComProperty(name = "Range", dispId = 0x0) + Range getRange(); + + /** + *

id(0x44e)

+ */ + @ComProperty(name = "Format", dispId = 0x44e) + ParagraphFormat getFormat(); + + /** + *

id(0x44e)

+ */ + @ComProperty(name = "Format", dispId = 0x44e) + void setFormat(ParagraphFormat param0); +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ParagraphFormat.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ParagraphFormat.java new file mode 100644 index 0000000000..115d3c0011 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ParagraphFormat.java @@ -0,0 +1,22 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.COMException; +import com.sun.jna.platform.win32.COM.util.IComEventCallbackCookie; +import com.sun.jna.platform.win32.COM.util.IComEventCallbackListener; +import com.sun.jna.platform.win32.COM.util.IConnectionPoint; +import com.sun.jna.platform.win32.COM.util.IUnknown; +import com.sun.jna.platform.win32.COM.util.annotation.ComObject; + +/** + *

uuid({000209F4-0000-0000-C000-000000000046})

+ *

interface(_ParagraphFormat)

+ *

interface(IUnknown)

+ */ +@ComObject(clsId = "{000209F4-0000-0000-C000-000000000046}") +public interface ParagraphFormat extends + _ParagraphFormat, + IUnknown +{ + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Paragraphs.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Paragraphs.java new file mode 100644 index 0000000000..059e552fc1 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Paragraphs.java @@ -0,0 +1,33 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({00020958-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020958-0000-0000-C000-000000000046}") +public interface Paragraphs { + /** + *

id(0x2)

+ */ + @ComProperty(name = "Count", dispId = 0x2) + Integer getCount(); + + /** + *

id(0x0)

+ */ + @ComMethod(name = "Item", dispId = 0x0) + Paragraph Item(Integer Index); + + /** + *

id(0x5)

+ */ + @ComMethod(name = "Add", dispId = 0x5) + Paragraph Add(Object Range); + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Range.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Range.java new file mode 100644 index 0000000000..ee924da9bc --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Range.java @@ -0,0 +1,135 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +/** + *

uuid({0002095E-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{0002095E-0000-0000-C000-000000000046}") +public interface Range { + /** + *

id(0x0)

+ */ + @ComProperty(name = "Text", dispId = 0x0) + String getText(); + + /** + *

id(0x0)

+ */ + @ComProperty(name = "Text", dispId = 0x0) + void setText(String param0); + + /** + *

id(0x5)

+ */ + @ComProperty(name = "Font", dispId = 0x5) + Font getFont(); + + /** + *

id(0x5)

+ */ + @ComProperty(name = "Font", dispId = 0x5) + void setFont(Font param0); + + /** + *

id(0x3b)

+ */ + @ComProperty(name = "Paragraphs", dispId = 0x3b) + Paragraphs getParagraphs(); + + + /** + *

id(0x44e)

+ */ + @ComProperty(name = "ParagraphFormat", dispId = 0x44e) + ParagraphFormat getParagraphFormat(); + + /** + *

id(0x44e)

+ */ + @ComProperty(name = "ParagraphFormat", dispId = 0x44e) + void setParagraphFormat(ParagraphFormat param0); + + /** + *

id(0x4b)

+ */ + @ComProperty(name = "Bookmarks", dispId = 0x4b) + Bookmarks getBookmarks(); + + /** + *

id(0xd4)

+ */ + @ComMethod(name = "InsertParagraphBefore", dispId = 0xd4) + void InsertParagraphBefore(); + + + /** + *

id(0x77)

+ */ + @ComMethod(name = "Cut", dispId = 0x77) + void Cut(); + + /** + *

id(0x78)

+ */ + @ComMethod(name = "Copy", dispId = 0x78) + void Copy(); + + /** + *

id(0x79)

+ */ + @ComMethod(name = "Paste", dispId = 0x79) + void Paste(); + + /** + *

id(0x7a)

+ */ + @ComMethod(name = "InsertBreak", dispId = 0x7a) + void InsertBreak(Object Type); + + /** + *

id(0xa0)

+ */ + @ComMethod(name = "InsertParagraph", dispId = 0xa0) + void InsertParagraph(); + + /** + *

id(0xa1)

+ */ + @ComMethod(name = "InsertParagraphAfter", dispId = 0xa1) + void InsertParagraphAfter(); + + /** + *

id(0x65)

+ */ + @ComMethod(name = "Collapse", dispId = 0x65) + void Collapse(Object Direction); + + /** + *

id(0x66)

+ */ + @ComMethod(name = "InsertBefore", dispId = 0x66) + void InsertBefore(String Text); + + /** + *

id(0x68)

+ */ + @ComMethod(name = "InsertAfter", dispId = 0x68) + void InsertAfter(String Text); + + /** + *

id(0x139)

+ */ + @ComProperty(name = "Information", dispId = 0x139) + Object getInformation(WdInformation Type); + + /** + *

id(0x13f)

+ */ + @ComProperty(name = "InlineShapes", dispId = 0x13f) + InlineShapes getInlineShapes(); + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Row.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Row.java new file mode 100644 index 0000000000..0a40fd6db4 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Row.java @@ -0,0 +1,18 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +/** + *

uuid({00020950-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020950-0000-0000-C000-000000000046}") +public interface Row { + /** + *

id(0x0)

+ */ + @ComProperty(name = "Range", dispId = 0x0) + Range getRange(); + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Rows.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Rows.java new file mode 100644 index 0000000000..11d4712fdb --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Rows.java @@ -0,0 +1,30 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; + +/** + *

uuid({0002094C-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{0002094C-0000-0000-C000-000000000046}") +public interface Rows { + /** + *

id(0x0)

+ */ + @ComMethod(name = "Item", dispId = 0x0) + Row Item(Integer Index); + + /** + *

id(0x64)

+ */ + @ComMethod(name = "Add", dispId = 0x64) + Row Add(Object BeforeRow); + + /** + *

id(0xc8)

+ */ + @ComMethod(name = "Delete", dispId = 0xc8) + void Delete(); + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Table.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Table.java new file mode 100644 index 0000000000..b3c213a869 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Table.java @@ -0,0 +1,40 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({00020951-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020951-0000-0000-C000-000000000046}") +public interface Table { + /** + *

id(0x0)

+ */ + @ComProperty(name = "Range", dispId = 0x0) + Range getRange(); + + /** + *

id(0x64)

+ */ + @ComProperty(name = "Columns", dispId = 0x64) + Columns getColumns(); + + /** + *

id(0x65)

+ */ + @ComProperty(name = "Rows", dispId = 0x65) + Rows getRows(); + + /** + *

id(0x11)

+ */ + @ComMethod(name = "Cell", dispId = 0x11) + Cell Cell(Integer Row, + Integer Column); + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Tables.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Tables.java new file mode 100644 index 0000000000..4752719584 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Tables.java @@ -0,0 +1,37 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({0002094D-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{0002094D-0000-0000-C000-000000000046}") +public interface Tables { + /** + *

id(0x2)

+ */ + @ComProperty(name = "Count", dispId = 0x2) + Integer getCount(); + + /** + *

id(0x0)

+ */ + @ComMethod(name = "Item", dispId = 0x0) + Table Item(Integer Index); + + /** + *

id(0xc8)

+ */ + @ComMethod(name = "Add", dispId = 0xc8) + Table Add(Range Range, + Integer NumRows, + Integer NumColumns, + Object DefaultTableBehavior, + Object AutoFitBehavior); + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdBreakType.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdBreakType.java new file mode 100644 index 0000000000..c1ed3be94b --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdBreakType.java @@ -0,0 +1,70 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({58B14C6F-0FE6-3BCA-880E-E3A9C039E588})

+ */ +public enum WdBreakType implements IComEnum { + + /** + * (2) + */ + wdSectionBreakNextPage(2), + + /** + * (3) + */ + wdSectionBreakContinuous(3), + + /** + * (4) + */ + wdSectionBreakEvenPage(4), + + /** + * (5) + */ + wdSectionBreakOddPage(5), + + /** + * (6) + */ + wdLineBreak(6), + + /** + * (7) + */ + wdPageBreak(7), + + /** + * (8) + */ + wdColumnBreak(8), + + /** + * (9) + */ + wdLineBreakClearLeft(9), + + /** + * (10) + */ + wdLineBreakClearRight(10), + + /** + * (11) + */ + wdTextWrappingBreak(11), + ; + + private WdBreakType(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdCollapseDirection.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdCollapseDirection.java new file mode 100644 index 0000000000..65ee1b9a49 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdCollapseDirection.java @@ -0,0 +1,30 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({2DEF3465-D4C4-369B-B91E-68C9711F3A6C})

+ */ +public enum WdCollapseDirection implements IComEnum { + + /** + * (1) + */ + wdCollapseStart(1), + + /** + * (0) + */ + wdCollapseEnd(0), + ; + + private WdCollapseDirection(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportCreateBookmarks.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportCreateBookmarks.java new file mode 100644 index 0000000000..f31d96b3ab --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportCreateBookmarks.java @@ -0,0 +1,35 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({42A64EC8-BC68-3DBC-8BF0-58A8CBA4AB3E})

+ */ +public enum WdExportCreateBookmarks implements IComEnum { + + /** + * (0) + */ + wdExportCreateNoBookmarks(0), + + /** + * (1) + */ + wdExportCreateHeadingBookmarks(1), + + /** + * (2) + */ + wdExportCreateWordBookmarks(2), + ; + + private WdExportCreateBookmarks(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportFormat.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportFormat.java new file mode 100644 index 0000000000..f1cf869bf9 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportFormat.java @@ -0,0 +1,30 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({5D7E6F43-3E57-353C-95E1-52E9783BE2BE})

+ */ +public enum WdExportFormat implements IComEnum { + + /** + * (17) + */ + wdExportFormatPDF(17), + + /** + * (18) + */ + wdExportFormatXPS(18), + ; + + private WdExportFormat(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportItem.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportItem.java new file mode 100644 index 0000000000..8936504d73 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportItem.java @@ -0,0 +1,30 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({D67854FC-9A45-33F6-A4D3-DC0002A53CE9})

+ */ +public enum WdExportItem implements IComEnum { + + /** + * (0) + */ + wdExportDocumentContent(0), + + /** + * (7) + */ + wdExportDocumentWithMarkup(7), + ; + + private WdExportItem(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportOptimizeFor.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportOptimizeFor.java new file mode 100644 index 0000000000..cf409aa7fc --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportOptimizeFor.java @@ -0,0 +1,30 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({147553BC-4DC5-3681-A445-D1C4BEA414AD})

+ */ +public enum WdExportOptimizeFor implements IComEnum { + + /** + * (0) + */ + wdExportOptimizeForPrint(0), + + /** + * (1) + */ + wdExportOptimizeForOnScreen(1), + ; + + private WdExportOptimizeFor(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportRange.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportRange.java new file mode 100644 index 0000000000..c89ea7e837 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportRange.java @@ -0,0 +1,40 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({20D65698-7CDC-3A68-A83D-D52A76FEA1A4})

+ */ +public enum WdExportRange implements IComEnum { + + /** + * (0) + */ + wdExportAllDocument(0), + + /** + * (1) + */ + wdExportSelection(1), + + /** + * (2) + */ + wdExportCurrentPage(2), + + /** + * (3) + */ + wdExportFromTo(3), + ; + + private WdExportRange(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdInformation.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdInformation.java new file mode 100644 index 0000000000..23aaeda7fe --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdInformation.java @@ -0,0 +1,225 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({26E3C1D3-6937-3EFA-8859-7FFC81869CE5})

+ */ +public enum WdInformation implements IComEnum { + + /** + * (1) + */ + wdActiveEndAdjustedPageNumber(1), + + /** + * (2) + */ + wdActiveEndSectionNumber(2), + + /** + * (3) + */ + wdActiveEndPageNumber(3), + + /** + * (4) + */ + wdNumberOfPagesInDocument(4), + + /** + * (5) + */ + wdHorizontalPositionRelativeToPage(5), + + /** + * (6) + */ + wdVerticalPositionRelativeToPage(6), + + /** + * (7) + */ + wdHorizontalPositionRelativeToTextBoundary(7), + + /** + * (8) + */ + wdVerticalPositionRelativeToTextBoundary(8), + + /** + * (9) + */ + wdFirstCharacterColumnNumber(9), + + /** + * (10) + */ + wdFirstCharacterLineNumber(10), + + /** + * (11) + */ + wdFrameIsSelected(11), + + /** + * (12) + */ + wdWithInTable(12), + + /** + * (13) + */ + wdStartOfRangeRowNumber(13), + + /** + * (14) + */ + wdEndOfRangeRowNumber(14), + + /** + * (15) + */ + wdMaximumNumberOfRows(15), + + /** + * (16) + */ + wdStartOfRangeColumnNumber(16), + + /** + * (17) + */ + wdEndOfRangeColumnNumber(17), + + /** + * (18) + */ + wdMaximumNumberOfColumns(18), + + /** + * (19) + */ + wdZoomPercentage(19), + + /** + * (20) + */ + wdSelectionMode(20), + + /** + * (21) + */ + wdCapsLock(21), + + /** + * (22) + */ + wdNumLock(22), + + /** + * (23) + */ + wdOverType(23), + + /** + * (24) + */ + wdRevisionMarking(24), + + /** + * (25) + */ + wdInFootnoteEndnotePane(25), + + /** + * (26) + */ + wdInCommentPane(26), + + /** + * (28) + */ + wdInHeaderFooter(28), + + /** + * (31) + */ + wdAtEndOfRowMarker(31), + + /** + * (32) + */ + wdReferenceOfType(32), + + /** + * (33) + */ + wdHeaderFooterType(33), + + /** + * (34) + */ + wdInMasterDocument(34), + + /** + * (35) + */ + wdInFootnote(35), + + /** + * (36) + */ + wdInEndnote(36), + + /** + * (37) + */ + wdInWordMail(37), + + /** + * (38) + */ + wdInClipboard(38), + + /** + * (41) + */ + wdInCoverPage(41), + + /** + * (42) + */ + wdInBibliography(42), + + /** + * (43) + */ + wdInCitation(43), + + /** + * (44) + */ + wdInFieldCode(44), + + /** + * (45) + */ + wdInFieldResult(45), + + /** + * (46) + */ + wdInContentControl(46), + ; + + private WdInformation(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdOriginalFormat.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdOriginalFormat.java index b7f4bbee46..d0bf48a6ad 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdOriginalFormat.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdOriginalFormat.java @@ -1,29 +1,29 @@ -/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - */ -package com.sun.jna.platform.win32.COM.util.office.word; - -import com.sun.jna.platform.win32.COM.util.IComEnum; - -public enum WdOriginalFormat implements IComEnum { - wdOriginalDocumentFormat(1), // Original document format. - wdPromptUser(2), // Prompt user to select a document format. - wdWordDocument(0); // Microsoft Word document format. - - private WdOriginalFormat(long value) { - this.value = value; - } - private long value; - public long getValue() { - return this.value; - } -} +/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +public enum WdOriginalFormat implements IComEnum { + wdOriginalDocumentFormat(1), // Original document format. + wdPromptUser(2), // Prompt user to select a document format. + wdWordDocument(0); // Microsoft Word document format. + + private WdOriginalFormat(long value) { + this.value = value; + } + private long value; + public long getValue() { + return this.value; + } +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdSaveFormat.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdSaveFormat.java index 7b7fce9fb1..aa808a1df7 100644 --- a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdSaveFormat.java +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdSaveFormat.java @@ -1,54 +1,54 @@ -/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - */ -package com.sun.jna.platform.win32.COM.util.office.word; - -import com.sun.jna.platform.win32.COM.util.IComEnum; - -public enum WdSaveFormat implements IComEnum { - wdFormatDocument(0), // Microsoft Office Word 97 - 2003 binary file format. - wdFormatDOSText(4), // Microsoft DOS text format. - wdFormatDOSTextLineBreaks(5), // Microsoft DOS text with line breaks preserved. - wdFormatEncodedText(7), // Encoded text format. - wdFormatFilteredHTML(10), // Filtered HTML format. - wdFormatFlatXML(19), // Open XML file format saved as a single XML file. - wdFormatFlatXMLMacroEnabled(20), // Open XML file format with macros enabled saved as a single XML file. - wdFormatFlatXMLTemplate(21), // Open XML template format saved as a XML single file. - wdFormatFlatXMLTemplateMacroEnabled(22), // Open XML template format with macros enabled saved as a single XML file. - wdFormatOpenDocumentText(23), // OpenDocument Text format. - wdFormatHTML(8), // Standard HTML format. - wdFormatRTF(6), // Rich text format (RTF). - wdFormatStrictOpenXMLDocument(24), // Strict Open XML document format. - wdFormatTemplate(1), // Word template format. - wdFormatText(2), // Microsoft Windows text format. - wdFormatTextLineBreaks(3), //Windows text format with line breaks preserved. - wdFormatUnicodeText( 7), //Unicode text format. - wdFormatWebArchive(9), //Web archive format. - wdFormatXML(11), //Extensible Markup Language (XML) format. - wdFormatDocument97( 0), // Microsoft Word 97 document format. - wdFormatDocumentDefault(16), // Word default document file format. For Word 2010, this is the DOCX format. - wdFormatPDF( 17), //PDF format. - wdFormatTemplate97( 1), // Word 97 template format. - wdFormatXMLDocument( 12), //XML document format. - wdFormatXMLDocumentMacroEnabled(13), //XML document format with macros enabled. - wdFormatXMLTemplate(14), //XML template format. - wdFormatXMLTemplateMacroEnabled(15), //XML template format with macros enabled. - wdFormatXPS(18); - - private WdSaveFormat(long value) { - this.value = value; - } - private long value; - public long getValue() { - return this.value; - } -} +/* Copyright (c) 2014 Dr David H. Akehurst (itemis), All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +public enum WdSaveFormat implements IComEnum { + wdFormatDocument(0), // Microsoft Office Word 97 - 2003 binary file format. + wdFormatDOSText(4), // Microsoft DOS text format. + wdFormatDOSTextLineBreaks(5), // Microsoft DOS text with line breaks preserved. + wdFormatEncodedText(7), // Encoded text format. + wdFormatFilteredHTML(10), // Filtered HTML format. + wdFormatFlatXML(19), // Open XML file format saved as a single XML file. + wdFormatFlatXMLMacroEnabled(20), // Open XML file format with macros enabled saved as a single XML file. + wdFormatFlatXMLTemplate(21), // Open XML template format saved as a XML single file. + wdFormatFlatXMLTemplateMacroEnabled(22), // Open XML template format with macros enabled saved as a single XML file. + wdFormatOpenDocumentText(23), // OpenDocument Text format. + wdFormatHTML(8), // Standard HTML format. + wdFormatRTF(6), // Rich text format (RTF). + wdFormatStrictOpenXMLDocument(24), // Strict Open XML document format. + wdFormatTemplate(1), // Word template format. + wdFormatText(2), // Microsoft Windows text format. + wdFormatTextLineBreaks(3), //Windows text format with line breaks preserved. + wdFormatUnicodeText( 7), //Unicode text format. + wdFormatWebArchive(9), //Web archive format. + wdFormatXML(11), //Extensible Markup Language (XML) format. + wdFormatDocument97( 0), // Microsoft Word 97 document format. + wdFormatDocumentDefault(16), // Word default document file format. For Word 2010, this is the DOCX format. + wdFormatPDF( 17), //PDF format. + wdFormatTemplate97( 1), // Word 97 template format. + wdFormatXMLDocument( 12), //XML document format. + wdFormatXMLDocumentMacroEnabled(13), //XML document format with macros enabled. + wdFormatXMLTemplate(14), //XML template format. + wdFormatXMLTemplateMacroEnabled(15), //XML template format with macros enabled. + wdFormatXPS(18); + + private WdSaveFormat(long value) { + this.value = value; + } + private long value; + public long getValue() { + return this.value; + } +} diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdSaveOptions.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdSaveOptions.java new file mode 100644 index 0000000000..5bbdb678e3 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdSaveOptions.java @@ -0,0 +1,35 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.IComEnum; + +/** + *

uuid({E1B4A968-3072-3060-B6B7-1A1356D45CA2})

+ */ +public enum WdSaveOptions implements IComEnum { + + /** + * (0) + */ + wdDoNotSaveChanges(0), + + /** + * (-1) + */ + wdSaveChanges(-1), + + /** + * (-2) + */ + wdPromptToSaveChanges(-2), + ; + + private WdSaveOptions(long value) { + this.value = value; + } + private long value; + + public long getValue() { + return this.value; + } +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/_Font.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/_Font.java new file mode 100644 index 0000000000..281be56764 --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/_Font.java @@ -0,0 +1,39 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComMethod; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; +import com.sun.jna.platform.win32.COM.util.IDispatch; +import com.sun.jna.platform.win32.Variant.VARIANT; + +/** + *

uuid({00020952-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020952-0000-0000-C000-000000000046}") +public interface _Font { + /** + *

id(0x82)

+ */ + @ComProperty(name = "Bold", dispId = 0x82) + Integer getBold(); + + /** + *

id(0x82)

+ */ + @ComProperty(name = "Bold", dispId = 0x82) + void setBold(Integer param0); + + /** + *

id(0x83)

+ */ + @ComProperty(name = "Italic", dispId = 0x83) + Integer getItalic(); + + /** + *

id(0x83)

+ */ + @ComProperty(name = "Italic", dispId = 0x83) + void setItalic(Integer param0); + +} \ No newline at end of file diff --git a/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/_ParagraphFormat.java b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/_ParagraphFormat.java new file mode 100644 index 0000000000..676c7cf00e --- /dev/null +++ b/contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/_ParagraphFormat.java @@ -0,0 +1,17 @@ + +package com.sun.jna.platform.win32.COM.util.office.word; + +import com.sun.jna.platform.win32.COM.util.annotation.ComInterface; +import com.sun.jna.platform.win32.COM.util.annotation.ComProperty; + +/** + *

uuid({00020953-0000-0000-C000-000000000046})

+ */ +@ComInterface(iid="{00020953-0000-0000-C000-000000000046}") +public interface _ParagraphFormat { + /** + *

id(0x70)

+ */ + @ComProperty(name = "SpaceAfter", dispId = 0x70) + void setSpaceAfter(Float param0); +} \ No newline at end of file