From 25729deb2239b3604707381946d35cf804c4628c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Bl=C3=A4sing?= Date: Fri, 15 Apr 2016 22:22:32 +0200 Subject: [PATCH] Update msoffice samples with two MSDN demos and test compatibility The office samples were verified for these environments: Platform Windows 10 64Bit: * Java 1.8.0_77 64 Bit + Office 2013 64 Bit (Testversion) * Java 1.8.0_77 32 Bit + Office 2013 64 Bit (Testversion) Platform Windows 7 64Bit: * Java 1.8.0_60 64 Bit + Office 2007 32 Bit * Java 1.8.0_60 32 Bit + Office 2007 32 Bit Closes #572 --- CHANGES.md | 3 +- contrib/msoffice/jnatest.xls | Bin 28160 -> 0 bytes .../jna/platform/win32/COM/COMInfoUtil.java | 4 +- .../sun/jna/platform/win32/COM/Helper.java | 75 ++++ .../platform/win32/COM/office/MSExcel.java | 4 +- .../win32/COM/office/MSOfficeDemo.java | 116 ++--- .../jna/platform/win32/COM/office/MSWord.java | 5 +- .../office/Excelautomation_KB_219151_Mod.java | 207 +++++++++ .../COM/util/office/MSOfficeExcelDemo.java | 106 +++-- .../COM/util/office/MSOfficeWordDemo.java | 109 ++--- .../office/Wordautomation_KB_313193_Mod.java | 204 +++++++++ .../win32/COM/util/office/excel/Borders.java | 20 + .../win32/COM/util/office/excel/Chart.java | 19 + .../win32/COM/util/office/excel/Charts.java | 18 + .../office/excel/ComExcel_Application.java | 20 +- .../COM/util/office/excel/ComIAppEvents.java | 24 +- .../util/office/excel/ComIApplication.java | 70 +-- .../COM/util/office/excel/ComIRange.java | 118 +++-- .../COM/util/office/excel/ComIWorkbook.java | 37 +- .../COM/util/office/excel/ComIWorkbooks.java | 40 +- .../COM/util/office/excel/ComIWorksheet.java | 53 ++- .../win32/COM/util/office/excel/Interior.java | 14 + .../win32/COM/util/office/excel/Series.java | 16 + .../win32/COM/util/office/excel/Shape.java | 21 + .../win32/COM/util/office/excel/Shapes.java | 10 + .../COM/util/office/excel/XlBorderWeight.java | 22 + .../util/office/excel/XlChartLocation.java | 20 + .../COM/util/office/excel/XlChartType.java | 91 ++++ .../COM/util/office/excel/XlLineStyle.java | 26 ++ .../win32/COM/util/office/excel/XlRowCol.java | 20 + .../COM/util/office/office/XlChartType.java | 412 ++++++++++++++++++ .../COM/util/office/resources}/jnatest.doc | Bin .../COM/util/office/resources/jnatest.xls | Bin 0 -> 11776 bytes .../win32/COM/util/office/word/Bookmark.java | 94 ++++ .../win32/COM/util/office/word/Bookmarks.java | 28 ++ .../win32/COM/util/office/word/Cell.java | 20 + .../win32/COM/util/office/word/Column.java | 26 ++ .../win32/COM/util/office/word/Columns.java | 37 ++ .../COM/util/office/word/ComIApplication.java | 92 ++-- .../COM/util/office/word/ComIDocument.java | 98 +++-- .../COM/util/office/word/ComIDocuments.java | 56 +-- .../COM/util/office/word/ComISelection.java | 48 +- .../util/office/word/ComWord_Application.java | 42 +- .../win32/COM/util/office/word/Font.java | 22 + .../COM/util/office/word/InlineShape.java | 47 ++ .../COM/util/office/word/InlineShapes.java | 25 ++ .../win32/COM/util/office/word/OLEFormat.java | 170 ++++++++ .../win32/COM/util/office/word/Paragraph.java | 32 ++ .../COM/util/office/word/ParagraphFormat.java | 22 + .../COM/util/office/word/Paragraphs.java | 33 ++ .../win32/COM/util/office/word/Range.java | 135 ++++++ .../win32/COM/util/office/word/Row.java | 18 + .../win32/COM/util/office/word/Rows.java | 30 ++ .../win32/COM/util/office/word/Table.java | 40 ++ .../win32/COM/util/office/word/Tables.java | 37 ++ .../COM/util/office/word/WdBreakType.java | 70 +++ .../util/office/word/WdCollapseDirection.java | 30 ++ .../office/word/WdExportCreateBookmarks.java | 35 ++ .../COM/util/office/word/WdExportFormat.java | 30 ++ .../COM/util/office/word/WdExportItem.java | 30 ++ .../util/office/word/WdExportOptimizeFor.java | 30 ++ .../COM/util/office/word/WdExportRange.java | 40 ++ .../COM/util/office/word/WdInformation.java | 225 ++++++++++ .../util/office/word/WdOriginalFormat.java | 58 +-- .../COM/util/office/word/WdSaveFormat.java | 108 ++--- .../COM/util/office/word/WdSaveOptions.java | 35 ++ .../win32/COM/util/office/word/_Font.java | 39 ++ .../util/office/word/_ParagraphFormat.java | 17 + 68 files changed, 3288 insertions(+), 515 deletions(-) delete mode 100644 contrib/msoffice/jnatest.xls create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/Helper.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/Excelautomation_KB_219151_Mod.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/Wordautomation_KB_313193_Mod.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Borders.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Chart.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Charts.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Interior.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Series.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Shape.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/Shapes.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlBorderWeight.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlChartLocation.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlChartType.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlLineStyle.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/excel/XlRowCol.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/office/XlChartType.java rename contrib/msoffice/{ => src/com/sun/jna/platform/win32/COM/util/office/resources}/jnatest.doc (100%) create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/resources/jnatest.xls create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Bookmark.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Bookmarks.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Cell.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Column.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Columns.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Font.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/InlineShape.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/InlineShapes.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/OLEFormat.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Paragraph.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/ParagraphFormat.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Paragraphs.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Range.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Row.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Rows.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Table.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/Tables.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdBreakType.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdCollapseDirection.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportCreateBookmarks.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportFormat.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportItem.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportOptimizeFor.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdExportRange.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdInformation.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/WdSaveOptions.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/_Font.java create mode 100644 contrib/msoffice/src/com/sun/jna/platform/win32/COM/util/office/word/_ParagraphFormat.java 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 6077e40a432103a9a651ea187b16e50078424fd0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28160 zcmeHQ3yfUVdH(P0?Cz}B_IUlm7`z_u`muhjv1ir~V$7~F57XFS5l2vAv{|ob@ycs2 zS+7&0;$YfDl>$wOoq_^x(-bI8cs~k>parBVX{4o%S`Z0A35jUbh_(olsttlnzwewm z^WS^s&h?PCi4x7V?&JH$AP^oJJUXIUBU?Jo@O`Ut;hR?FB6sx58u?I^%sxSs&zKgX?C)37jj|f$ zp``Bq3a`7_P>1g<$i47?&Xgp(R=E$wQscI3`Wh&uSlU5=^zTh-oj$2rqp!iV!9GW(;VF`@>R4eG0*6`qZVy^ zz9@Y^8WoKptBFTv#P7=k@M5A7YJK&Ss|lJb-hgPjqhBBo${aKT_t^Gk%idmh*_mD> z56Oa1nr$0G89L=*yy7c2qf&+L2kK0B%OhwOBRM=RCff#i6u~Zo)a}}dUaL!CIhAci z@0P*dfx+I+^cs0gR`5p6wl{Q5c_jZ$bXh{=4=no=O||f#>ju>l9J_o>Br@-C8yT7{J+ie0JUE?>ral6 zj31sXr=-7R{9i49sD}KjHRKQ1kl$TH{zwh^gEi!TT0?$o4S6klYUzK%=xMF;&!5$h zTYIYWTYIYI_twz!SPl7;HROL=L;jf>@~_vBe^7h=+UUX9%8MTxCv8stg^rFp+wW|b z^c^Puw2FLW(0c$Y3^C-yf?Xf4qkL(O7vqbjH>9=}umWe;dy; zoctx(jmyOt$r(FmM&(dzIa0%$iy><*ES8GqjKQ{h5octyE7%mq&J+qy>V&?eLnnrmyzS`Rnc$#Z2ccdTdaTPy8ND<^PK!84B6zuiXY}Xc_{x)nYnTk z1ER8BC>_uAedl;)n;ehG`SeXP1MPehuGrR_cM0APGttverA{Z3&C34kfIewUw}J&!}W-XL9LaxK@vn zG2Nkg%CCR08PJK#}O9$iJkRrs+iI_SdI zqa?X>(4y3%B)N2Q^(jd%oh9`tNiLnPdX$JHmri$mN|H-wX?;qPOJ`YqN|H-wd3{Qf zOJ_xWN|H;br=o=8g45Dcs(SA*q4dpvC~5QfdGF=55;hJHbGKwz!FisXtjsp&liEQ|&vk4@#^PX?4}(REGk8=F<4=@Bc)+ z6H8NHtO|wyyZH1AWn;w^v6aSEhSG_kVpMf_Y>Fs3U91rvr8iH9lpOPd5)&QhW3r1$ zOG>4wihEowef;sqOHx+i3^TH_dt5E8$WT*UEv?8u&Rd@zQKroX~n>G#s8a?@eB zol)glYPg+Ih@x5 z#S&9AD4j^nJ(Zd*v%o9)b<1+SxoyM4#lw^9PiA(>NxnPETafN7&A`0;I$4JKj$Z8B zWElU7a#$ug{|!R|nJ%sA;>c@1e!JAnYYss`w~V6?(scMV`D&W31RC3X7@Fqd$UCon zFP>($PgAI-S)M>+8yG{=QXF~n?eE9a%<*aZs%cgw(69+AJFT@i^2QJTEuLnsPqU$# zW^Dou8?G`#pC%^KmL|}IBQ0Ne^^PyZ({%bYF_G4jKogF% zeBtk2xjUX_u}>2dX=@T_!jYCQJoe|`jHk)@G%=C3E`cT-Y5Bs*7hj8~S>n^gL|R`0 zO*qo>g?FF(TpZ1G{Pu^DTIIdD&3kVyDz(;pSBhMD%iqK+?N+6TC|~IkPiZ)cFuA#V zSG>}tsuc0#D_!O(4abbg-Ov1PywYW=6w%@rQy;S`L8=JjZ>PD9(KVl8rpv{bAGhsgL6tvauJ4G`zvqY zW(?~%3})|$*BmRCTasB=xqx}^?L%Y3N5_UHN5>DJ%-j-Hn3`W|7rV%3SdL=x(Ga>` zqcV;z7(2jx_fjeQxsHJ2XhYB<=nEr}o$Uab!zdF$Z4q=TmBsJd_=n9#)b|LO^#38nA=l4 zHhD60SyWYOLur;=BFC`!j%9z?l>aykxe-3!19Ofc9ysc7rO(1HhgTb(4a4fo#>Ww; zTcUb{g{8Dy2B(dCp~@Knrwe3G*G%;HF(b62IJAHC@bx*26+A(X)bqvK;SY{i-Q>mF4WQ3HX?emp)#3;AzUk&A@{`;R}AD+q!VdZE8 zedV)bl-qW&hH~3ANEzjQVdZEGy#}FaPK13P+*f4TmD*fVAU+NGVQpbw(Z z_eWZQrb;wc+9KEba9W}Tj+-upau=q;&fs2;p! z5;ky_!!@*=IF+Rxx_of<}&NeFOa9h}E6GM^d1p3`I8}?}(VnlVw zR=f=5>Y<6lY@uvx+8;GE)sBYwYA{To8o5R)t`+4w+j#i1nQP>;p*fM;@pK*dw+Bl0 znWy~-Ouo@v?ZUIO?K_GvJ0D&gl~0%m(j2TX*W;zh*^`a(v4E2^pT>KjjnlQ5$KErv z4=>x|ddlvI!D%iy%>}2q;4~MU=Du}U%di9GJDwYv7(bMQhnAG^=F15B4-8$|f%8tBKZo-v zoL|BDdpIw~^nW*s=z5$F;yj$0j~xl+ZGQQjk~>i7cZ5@r}*Qs-Fk59##?>$0L}=|8K~-P8dC`Tthw&MQ4p#bdG9N4|I@C0 zyZZ-?e3g-}Hpf3Ok`u_|wqr_tFvt!Chk==QTuI{Z;s zk&)x3oJ5|Qk!3?}Fg}-%L#>MOS_=-fqpZ21`@xNV;|m*=JcVwbxkekqEyx-fOQjX| znyoCOCw&>`etj8z=gUwPt7Np;&qtel86D!w&_An^F=G6DTpr}h7~8&#%Yu9vedWvO zM_)z{`m&A~+3XnEoERD7&DY2H^JT1OzKp9gd>QMDFXP$?U&f^nzKkmyd>I!i_%g0L z@MT;^;L8?!viD6r=ejD!q(uQ&SyfOff|?>I9YM_z)Dl9B<}B)+Wnc{qBQj_j85EI0 z5g8Pb!6DWSwm6o7txy<|LDR^fhzyFzpok0(v8H7?&^KOU=QE7RplM`KL42sC0hzyFz;1FAZEMMzJ3%jvlLnw&*mZ8HiC?bO*GAJU0A~GlmrB@ znnngiWKcu~MPzV@{kbeZRWb|<41*#vC?bO*GAJU0A~HC{-eH#CIvIwu4TB;wC?bO* zGAJU0A~HC{zGjxI;0?nei21R60LOb~CL@RpnnngiWKcu~MPzV@ zee^89Su+fshCvY-6p=v@85EI05g8m}k3Y-rEDXb9!=Q)^ipZdd42sC0hzvxp$i?zJ zUPWW6eV73I<^ORUoP$1pys{)l))gb`j*%^mku8gnEsv3{@MMhP9AsH@w209_nML%Z zB6?C0J*kMER76iYv_#0jBXuq@Wu=G=ipZdd42sC0hzt(VcUdzRLI!-l8$o1X4x2^> zMPyJ!21R6Wh$WH57ra(Ww_#9321R60Lch-u-q^xB7-6_C?bO*GAJU0LyX|8 z@JNOghCvY-6p=v@85EI05gCYHL7(B#CQczo>->dS-(GD+ail@kI=_54FE#hI*Tj_4>?N*emxSHQ>UVri+tiC)uae?dzBPCe2Fn z0o`n*J7bB!FE=Y$HS4HeF{NbSfC^DUHA>0m3CdajA4+NPvPLPnxnV7kUu7vNE3SS~ z!k_;MQV|&eBjEKJ?9XcO7K+Vs9;{58#}}z5_d}?lsssL>j}+ zVfUx7b8vh+b`ES#V<*!axQSgB-m_UZ`@Ib=@4G%Ot(C|RR0}T%} zJkan!!vhTu#CRZS{GWRH#g|X7J!jUbJ2C!W^Ye!}{(l`i7ankaU^jODaLjQ(e=ysR zoj>Sv{LgXwBzBJbZ^F)>?A(07ZMf!G{~7Gz`2b7{n9Yvk?cx9msFRz2?gR<*(jK>d zHVn+C1umr^(~+HYoO+kxpy7dr2O1t|c%b2dh6frR zXn3IEfrbYf9{4Tw0LSqh6m#^;@pm(JuIb@#{QP~MV{3i}zyUMI?EF2S%h5UR=NO-h zuKAlk$N5}Z%*DSP>vKMUOI*1KmCHoAkdsR-xfqfIa4sm!VPAs13wt+q{y$P&G{t32 zE3o%qUx|Gc_SM*#-iz~E?B`)$hkZTvJoW;1roWG!=f+l_2d=_*%KY>?hd(vJzwO39 zFY!UP`O<6_YLSg`l*{la^1M09rS@cxyZ`-1Pc6kd4VI6SUk&yN{27sb#*TwdT=yCO z15|~dHq?9LPcO4Mo8=?st8M=M5I#Hq%EE}Ti4y&TE4B3YfS+}U^`~C`rBuesgRL2h bYRB=#J--~ce_ii`*|YhVc>XmcF7y8nGz3!H 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 0000000000000000000000000000000000000000..0c6dadeea01594cb3b0913e7d176d9fd4328fa2b GIT binary patch literal 11776 zcmeI2U5p-88ONV__v_t$&98_fnrhUTIe(;D{O-gBOt{n67y_B4INog-tTt^d`uKaOD};~38RL*|aG z-=8%Ne=5D=`4an1todo=ci1xD%BNv#?TLlV{?Ie*+nK!>`NqhXc%Io0W1rtgWT&mR zU;0*4pMQx5neWh-?elx!xQ*DD)z_SeX8Y_ zG@We`=fEQVx4FeR>u%f67N^v1+h4iy(_W`7POqF&J#Q=OVX_{-X_ol*S>iX(5+9rq zf4SlJ)r3tkADZZi`O=C0m@k{?jrsD4ftX)2(Kq!-T)Qvu)FipFA8V-aomOxj*a~4=^quaTSud zikPQZ#}-a<_x;ShO?xi$@j~-#HthMZt$&9Rf{z%QURd*5Pyg^i!+UltTjfPy@zKU7 z@7wqA&T`%^=bduCtDN6b&TlQ}yUY2Wa(`4o$?+S0b?Q&v>#?)Y3SM>iw)B68KzT2aIMbKL=jTRsBwtep# z@4SBS@B@1vj`)N}(zJ=I*rx0`UvsYa=GbFfSdYO%) zw=A=QvUul8)R;y+)2MeE^-ZJx3UM{(aZO|3zN!)iwkXzN5MdBu5MfBfy+J=xltO<} zB@9}JL4-ksL4+X@cUm4#BaX8t48#h;Ai^NRAi^NRkcj&>k7pre_J)C2K^R0BL>NRE zL>Lm$3*_hesk#vE^wL4-ks zL4-ksArXCX?qwHca?e!>gVtdXVGv;uVMs*Jp2yc3j(TAjh!uoEgh7Nsgh7NM5zmP{ zp0Jd;C=A33!XUyR!XUyR!jOokP99&HD06Wbh!uoEgh7Nsgh7NMQSk+foHCb$L4-ks zL4-ksL4+X@PsH5+3Ijc2l`v=>1`!4k1`&otJYVzp2FE!tHmMQ@wkXzN5MdBu5MfBf z(>jl@yp*yu48#h;Ai^NRAi^NRkcel09&hiIxhxFC3c?`5Ai^NRAi|J{kwk9fl({?% zA`Bu7A`Bu7A`FQbm*nyOj)C{}Dq&!YVjTt%1`!4khD3~V@)$u=%8D=$D+q%Kg9w8N zg9t++#!R`9Q|8Jrh%ksSh%ksSh%h8#1eO~)hHJwh!XUyR!XUyR!jOpZTyEqTR)s-? zL4-ksL4-ksArYg)+{iIp7X}dq5e5+k5e5;4M2t0a|0Y!!R);}^L4-ksL4-ksArT|j z+{ihHHDM585MdBu5MdBuNW?feH*ySX!yv*S!XUyR!XUzsh*5QJF0oBrVw=0fw$x&rbIW6S+EWp0Q% z7GV%!5MdBu5Mf9}-R1seqA+X>g9w8Ng9w8Ng9t++S|T@c&f$hIh%ksSh%ksSh%h9g zU2`MHaAO!m7(^IE7(^IE7!q-nNREL>NRE5^>GtMvh@~7(^IE7(^IE z7(^HnaRui_j$um}L>NREL>NREL>QpA?EznEOn$c@-JVpAN%zA%8xac*_nQ}8YU~Jb(Gf=FSnWJ{?~KNKg}M)SWf<$&i^Mt zyj5JmUkGP>0W534XVn&IRa?X>YThm4`+U$Mp%|9PpEFv&ZPs1-Vm0Z;S^#OVc?U!AVJ8pyn5d%S@; zv!Q0gTiWbwj`8Vl|M8nT zftNhdJAB;}_rkY4aXEyeICBw>|N7?4O>zW3k@SG30Z~f9rz9xF07I z?*P?h%06`B@bQsTGuKtOt1k0>BLz%UB-$)5rrq{>pDt@gAA`G+X_142?Hld*hXlt{Hmyt6u-x-~IMo z9_y>c9`e{KPsmA(Y}l7Nn=S6EuTGb!1}^3AzoPwWeMq;%;c@8(tCr_Anj^ON2e-0#QmcoCdOj-S2*H`82qy{FtT zbMKfPnd@#dwp-x-!d&DtHs})I{Q0)X)MuZv&-(d4>A!g5w}1EeuKuuid({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