001/* 002 * BridJ - Dynamic and blazing-fast native interop for Java. 003 * http://bridj.googlecode.com/ 004 * 005 * Copyright (c) 2010-2013, Olivier Chafik (http://ochafik.com/) 006 * All rights reserved. 007 * 008 * Redistribution and use in source and binary forms, with or without 009 * modification, are permitted provided that the following conditions are met: 010 * 011 * * Redistributions of source code must retain the above copyright 012 * notice, this list of conditions and the following disclaimer. 013 * * Redistributions in binary form must reproduce the above copyright 014 * notice, this list of conditions and the following disclaimer in the 015 * documentation and/or other materials provided with the distribution. 016 * * Neither the name of Olivier Chafik nor the 017 * names of its contributors may be used to endorse or promote products 018 * derived from this software without specific prior written permission. 019 * 020 * THIS SOFTWARE IS PROVIDED BY OLIVIER CHAFIK AND CONTRIBUTORS ``AS IS'' AND ANY 021 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 022 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 023 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 024 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 025 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 026 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 027 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 028 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 029 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 030 */ 031package org.bridj.cpp.com.shell; 032 033import java.util.Collections; 034import java.util.Iterator; 035import org.bridj.ValuedEnum; 036import org.bridj.FlagSet; 037import org.bridj.IntValuedEnum; 038import org.bridj.Pointer; 039import org.bridj.StructObject; 040import org.bridj.ann.Array; 041import org.bridj.ann.Field; 042import org.bridj.ann.Virtual; 043import org.bridj.cpp.com.CLSID; 044import org.bridj.cpp.com.IID; 045 046@IID("EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF") 047@CLSID("56FDF344-FD6D-11d0-958A-006097C9A090") 048public class ITaskbarList3 extends ITaskbarList2 { 049 050 public enum THUMBBUTTONMASK implements IntValuedEnum<THUMBBUTTONMASK> { 051 052 THB_BITMAP(0x00000001), 053 THB_ICON(0x00000002), 054 THB_TOOLTIP(0x00000004), 055 THB_FLAGS(0x00000008); 056 057 THUMBBUTTONMASK(int value) { 058 this.value = value; 059 } 060 public final int value; 061 //@Override 062 063 public long value() { 064 return value; 065 } 066 067 public Iterator<THUMBBUTTONMASK> iterator() { 068 return Collections.singleton(this).iterator(); 069 } 070 071 public static ValuedEnum<THUMBBUTTONMASK> fromValue(long value) { 072 return FlagSet.fromValue(value, values()); 073 } 074 } 075 /// http://msdn.microsoft.com/en-us/library/dd562321(VS.85).aspx 076 077 public enum THUMBBUTTONFLAGS implements IntValuedEnum<THUMBBUTTONFLAGS> { 078 079 THBF_ENABLED(0x00000000), 080 THBF_DISABLED(0x00000001), 081 THBF_DISMISSONCLICK(0x00000002), 082 THBF_NOBACKGROUND(0x00000004), 083 THBF_HIDDEN(0x00000008), 084 THBF_NONINTERACTIVE(0x00000010); 085 086 THUMBBUTTONFLAGS(int value) { 087 this.value = value; 088 } 089 final int value; 090 //@Override 091 092 public long value() { 093 return value; 094 } 095 096 public Iterator<THUMBBUTTONFLAGS> iterator() { 097 return Collections.singleton(this).iterator(); 098 } 099 100 public static ValuedEnum<THUMBBUTTONFLAGS> fromValue(long value) { 101 return FlagSet.fromValue(value, values()); 102 } 103 } 104 105 public static class THUMBBUTTON extends StructObject { 106 107 @Field(0) 108 public native ValuedEnum<THUMBBUTTONMASK> dwMask(); 109 110 public native void dwMask(ValuedEnum<THUMBBUTTONMASK> dwMask); 111 112 @Field(1) 113 public native int iId(); 114 115 public native void iId(int iId); 116 117 @Field(2) 118 public native int iBitmap(); 119 120 public native void iBitmap(int iBitmap); 121 122 @Field(3) 123 public native Pointer<?> hIcon(); 124 125 public native void hIcon(Pointer<?> hIcon); 126 127 @Field(4) 128 @Array(260) 129 public native Pointer<Character> szTip(); 130 131 public native void szTip(Pointer<Character> szTip); 132 133 @Field(5) 134 public native ValuedEnum<THUMBBUTTONFLAGS> dwFlags(); 135 136 public native void dwFlags(ValuedEnum<THUMBBUTTONFLAGS> dwFlags); 137 } 138 139 @Virtual(0) 140 public native int SetProgressValue(Pointer<Integer> hWnd, long Completed, long Total); 141 142 public enum TbpFlag implements IntValuedEnum<TbpFlag> { 143 144 TBPF_NOPROGRESS(0), 145 TBPF_INDETERMINATE(1), 146 TBPF_NORMAL(2), 147 TBPF_ERROR(4), 148 TBPF_PAUSED(8); 149 150 TbpFlag(int value) { 151 this.value = value; 152 } 153 public final int value; 154 //@Override/ 155 156 public long value() { 157 return value; 158 } 159 160 public Iterator<TbpFlag> iterator() { 161 return Collections.singleton(this).iterator(); 162 } 163 164 public static ValuedEnum<TbpFlag> fromValue(long value) { 165 return FlagSet.fromValue(value, values()); 166 } 167 } 168 169 //@Virtual(1) public native int SetProgressState(Pointer<Integer> hWnd, ValuedEnum<TbpFlag> Flags); 170 @Virtual(1) 171 public native int SetProgressState(Pointer<Integer> hWnd, ValuedEnum<TbpFlag> Flags); 172 173 @Virtual(2) 174 public native void RegisterTab(Pointer<Integer> hWndTab, Pointer<Integer> hWndMDI); 175 176 @Virtual(3) 177 public native void UnregisterTab(Pointer<Integer> hWndTab); 178 179 @Virtual(4) 180 public native void SetTabOrder(Pointer<Integer> hWndTab, Pointer<Integer> hwndInsertBefore); 181 182 @Virtual(5) 183 public native void SetTabActive(Pointer<Integer> hWndTab, Pointer<Integer> hWndMDI, int dwReserved); 184 185 @Virtual(6) 186 public native void ThumbBarAddButtons(Pointer<Integer> hWnd, int cButtons, Pointer<THUMBBUTTON> pButtons); 187 188 @Virtual(7) 189 public native void ThumbBarUpdateButtons(Pointer<Integer> hWnd, int cButtons, Pointer<THUMBBUTTON> pButtons); 190 191 @Virtual(8) 192 public native void ThumbBarSetImageList(Pointer<Integer> hWnd, Pointer<Integer> himl); 193 194 @Virtual(9) 195 public native void SetOverlayIcon(Pointer<Integer> hWnd, Pointer<?> hIcon, Pointer<Character> pszDescription); 196 197 @Virtual(10) 198 public native void SetThumbnailTooltip(Pointer<Integer> hWnd, Pointer<Character> pszTip); 199 200 public class RECT { 201 } 202 203 @Virtual(11) 204 public native void SetThumbnailClip(Pointer<Integer> hWnd, Pointer<RECT> prcClip); 205}