New loading scheme for Winelib apps, makes them behave like builtin
[wine] / include / wine / obj_contextmenu.h
1 /*
2  *    IContextMenu
3  *
4  * Undocumented:
5  * word95 gets a IContextMenu Interface and calls HandleMenuMsg()
6  * which should only a member of IContextMenu2. 
7  *
8  * Copyright (C) 1999 Juergen Schmied
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23  */
24
25 #ifndef __WINE_WINE_OBJ_CONTEXTMENU_H
26 #define __WINE_WINE_OBJ_CONTEXTMENU_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* defined(__cplusplus) */
31
32 typedef struct IContextMenu IContextMenu, *LPCONTEXTMENU;
33
34 /* QueryContextMenu uFlags */
35 #define CMF_NORMAL              0x00000000
36 #define CMF_DEFAULTONLY         0x00000001
37 #define CMF_VERBSONLY           0x00000002
38 #define CMF_EXPLORE             0x00000004
39 #define CMF_NOVERBS             0x00000008
40 #define CMF_CANRENAME           0x00000010
41 #define CMF_NODEFAULT           0x00000020
42 #define CMF_INCLUDESTATIC       0x00000040
43 #define CMF_RESERVED            0xffff0000      /* View specific */
44
45 /* GetCommandString uFlags */
46 #define GCS_VERBA        0x00000000     /* canonical verb */
47 #define GCS_HELPTEXTA    0x00000001     /* help text (for status bar) */
48 #define GCS_VALIDATEA    0x00000002     /* validate command exists */
49 #define GCS_VERBW        0x00000004     /* canonical verb (unicode) */
50 #define GCS_HELPTEXTW    0x00000005     /* help text (unicode version) */
51 #define GCS_VALIDATEW    0x00000006     /* validate command exists (unicode) */
52 #define GCS_UNICODE      0x00000004     /* for bit testing - Unicode string */
53
54 #define GCS_VERB        GCS_VERBA
55 #define GCS_HELPTEXT    GCS_HELPTEXTA
56 #define GCS_VALIDATE    GCS_VALIDATEA
57
58 #define CMDSTR_NEWFOLDERA   "NewFolder"
59 #define CMDSTR_VIEWLISTA    "ViewList"
60 #define CMDSTR_VIEWDETAILSA "ViewDetails"
61 static const WCHAR CMDSTR_NEWFOLDERW[] = {'N','e','w','F','o','l','d','e','r',0};
62 static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0};
63 static const WCHAR CMDSTR_VIEWDETAILSW[] = {'V','i','e','w','D','e','t','a','i','l','s',0};
64
65 #define CMDSTR_NEWFOLDER    CMDSTR_NEWFOLDERA
66 #define CMDSTR_VIEWLIST     CMDSTR_VIEWLISTA
67 #define CMDSTR_VIEWDETAILS  CMDSTR_VIEWDETAILSA
68
69 #define CMIC_MASK_HOTKEY        SEE_MASK_HOTKEY
70 #define CMIC_MASK_ICON          SEE_MASK_ICON
71 #define CMIC_MASK_FLAG_NO_UI    SEE_MASK_FLAG_NO_UI
72 #define CMIC_MASK_UNICODE       SEE_MASK_UNICODE
73 #define CMIC_MASK_NO_CONSOLE    SEE_MASK_NO_CONSOLE
74 #define CMIC_MASK_HASLINKNAME   SEE_MASK_HASLINKNAME
75 #define CMIC_MASK_FLAG_SEP_VDM  SEE_MASK_FLAG_SEPVDM
76 #define CMIC_MASK_HASTITLE      SEE_MASK_HASTITLE
77 #define CMIC_MASK_ASYNCOK       SEE_MASK_ASYNCOK
78
79 #define CMIC_MASK_PTINVOKE      0x20000000
80
81 /*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */
82 typedef struct tagCMINVOKECOMMANDINFO 
83 {       DWORD cbSize;        /* sizeof(CMINVOKECOMMANDINFO) */
84         DWORD fMask;         /* any combination of CMIC_MASK_* */
85         HWND hwnd;         /* might be NULL (indicating no owner window) */
86         LPCSTR lpVerb;       /* either a string or MAKEINTRESOURCE(idOffset) */
87         LPCSTR lpParameters; /* might be NULL (indicating no parameter) */
88         LPCSTR lpDirectory;  /* might be NULL (indicating no specific directory) */
89         INT nShow;           /* one of SW_ values for ShowWindow() API */
90
91         DWORD dwHotKey;
92         HANDLE hIcon;
93 } CMINVOKECOMMANDINFO,  *LPCMINVOKECOMMANDINFO;
94
95 typedef struct tagCMInvokeCommandInfoEx 
96 {       DWORD cbSize;        /* must be sizeof(CMINVOKECOMMANDINFOEX) */
97         DWORD fMask;         /* any combination of CMIC_MASK_* */
98         HWND hwnd;         /* might be NULL (indicating no owner window) */
99         LPCSTR lpVerb;       /* either a string or MAKEINTRESOURCE(idOffset) */
100         LPCSTR lpParameters; /* might be NULL (indicating no parameter) */
101         LPCSTR lpDirectory;  /* might be NULL (indicating no specific directory) */
102         INT nShow;           /* one of SW_ values for ShowWindow() API */
103
104         DWORD dwHotKey;
105
106         HANDLE hIcon;
107         LPCSTR lpTitle;        /* For CreateProcess-StartupInfo.lpTitle */
108         LPCWSTR lpVerbW;       /* Unicode verb (for those who can use it) */
109         LPCWSTR lpParametersW; /* Unicode parameters (for those who can use it) */
110         LPCWSTR lpDirectoryW;  /* Unicode directory (for those who can use it) */
111         LPCWSTR lpTitleW;      /* Unicode title (for those who can use it) */
112         POINT ptInvoke;      /* Point where it's invoked */
113
114 } CMINVOKECOMMANDINFOEX,  *LPCMINVOKECOMMANDINFOEX;
115
116 #define ICOM_INTERFACE IContextMenu
117 #define IContextMenu_METHODS \
118         ICOM_METHOD5(HRESULT, QueryContextMenu, HMENU, hmenu, UINT, indexMenu, UINT, idCmdFirst, UINT, idCmdLast, UINT, uFlags) \
119         ICOM_METHOD1(HRESULT, InvokeCommand, LPCMINVOKECOMMANDINFO, lpici) \
120         ICOM_METHOD5(HRESULT, GetCommandString, UINT, idCmd, UINT, uType, UINT*, pwReserved, LPSTR, pszName, UINT, cchMax) \
121         ICOM_METHOD3(HRESULT, HandleMenuMsg, UINT, uMsg, WPARAM, wParam, LPARAM, lParam) \
122         void * guard;   /*possibly another nasty entry from ContextMenu3 ?*/
123 #define IContextMenu_IMETHODS \
124         IUnknown_IMETHODS \
125         IContextMenu_METHODS
126 ICOM_DEFINE(IContextMenu,IUnknown)
127 #undef ICOM_INTERFACE
128
129 #define IContextMenu_QueryInterface(p,a,b)              ICOM_CALL2(QueryInterface,p,a,b)
130 #define IContextMenu_AddRef(p)                          ICOM_CALL(AddRef,p)
131 #define IContextMenu_Release(p)                         ICOM_CALL(Release,p)
132 #define IContextMenu_QueryContextMenu(p,a,b,c,d,e)      ICOM_CALL5(QueryContextMenu,p,a,b,c,d,e)
133 #define IContextMenu_InvokeCommand(p,a)                 ICOM_CALL1(InvokeCommand,p,a)
134 #define IContextMenu_GetCommandString(p,a,b,c,d,e)      ICOM_CALL5(GetCommandString,p,a,b,c,d,e)
135 #define IContextMenu_HandleMenuMsg(p,a,b,c)             ICOM_CALL3(HandleMenuMsg,p,a,b,c)
136
137 #ifdef __cplusplus
138 } /* extern "C" */
139 #endif /* defined(__cplusplus) */
140
141 #endif /* __WINE_WINE_OBJ_CONTEXTMENU_H */