skyrope-mit-merge-hell-20040226
[openafs.git] / src / WINNT / client_exp / shell_ext.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #if !defined(AFX_SHELLEXT_H__DC515C28_6CAC_11D1_BAE7_00C04FD140D2__INCLUDED_)
11 #define AFX_SHELLEXT_H__DC515C28_6CAC_11D1_BAE7_00C04FD140D2__INCLUDED_
12
13 #if _MSC_VER >= 1000
14 #pragma once
15 #endif // _MSC_VER >= 1000
16 // shell_ext.h : header file
17 //
18
19 #include <shlobj.h>
20
21 extern ULONG nCMRefCount;       // IContextMenu ref count
22 extern ULONG nSERefCount;       // IShellExtInit ref count
23 extern ULONG nICRefCount;       // IContextMenu ref count
24 extern ULONG nTPRefCount;       // IQueryInfo ref count
25 extern ULONG nXPRefCount;       // IPersistFile ref count
26
27 #define STR_EXT_TITLE   TEXT("AfsClientContextMenu")
28 #define STR_REG_PATH    TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers")
29
30 /////////////////////////////////////////////////////////////////////////////
31 // CShellExt command target
32
33 class CShellExt : public CCmdTarget
34 {
35         DECLARE_DYNCREATE(CShellExt)
36
37         BOOL m_bDirSelected;
38         BOOL m_bIsSymlink;      // is symbolic link!
39         TCHAR m_szFile[MAX_PATH];
40         BOOL m_bIsOverlayEnabled;
41         BOOL IsOverlayEnabled(){return m_bIsOverlayEnabled;}
42
43     CStringArray m_astrFileNames;
44
45         CShellExt();           // protected constructor used by dynamic creation
46         LPMALLOC m_pAlloc;
47
48 // Attributes
49 public:
50
51 // Operations
52 public:
53
54 // Overrides
55         // ClassWizard generated virtual function overrides
56         //{{AFX_VIRTUAL(CShellExt)
57         public:
58         virtual void OnFinalRelease();
59         //}}AFX_VIRTUAL
60
61 // Implementation
62 protected:
63         virtual ~CShellExt();
64
65         // Generated message map functions
66         //{{AFX_MSG(CShellExt)
67                 // NOTE - the ClassWizard will add and remove member functions here.
68         //}}AFX_MSG
69
70         DECLARE_MESSAGE_MAP()
71         // Generated OLE dispatch map functions
72         //{{AFX_DISPATCH(CShellExt)
73                 // NOTE - the ClassWizard will add and remove member functions here.
74         //}}AFX_DISPATCH
75         DECLARE_DISPATCH_MAP()
76         
77         DECLARE_OLECREATE(CShellExt)
78     
79         // IFileViewer interface
80     BEGIN_INTERFACE_PART(MenuExt, IContextMenu)
81         STDMETHOD(QueryContextMenu)( HMENU hmenu,UINT indexMenu,UINT idCmdFirst,
82             UINT idCmdLast,UINT uFlags);
83         STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpici);
84         STDMETHOD(GetCommandString)(UINT idCmd,UINT uType,UINT* pwReserved,LPSTR pszName,
85             UINT cchMax);
86     END_INTERFACE_PART(MenuExt)
87
88     // IShellExtInit interface
89     BEGIN_INTERFACE_PART(ShellInit, IShellExtInit)
90         STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder,IDataObject *lpdobj, HKEY hkeyProgID);
91     END_INTERFACE_PART(ShellInit)
92
93     BEGIN_INTERFACE_PART(IconExt, IShellIconOverlayIdentifier)
94         STDMETHOD(GetOverlayInfo)(LPWSTR pwszIconFile,int cchMax,int* pIndex,DWORD* pdwFlags);
95         STDMETHOD(GetPriority)(int* pPriority);
96         STDMETHOD(IsMemberOf)(LPCWSTR pwszPath,DWORD dwAttrib);
97     END_INTERFACE_PART(IconExt)
98
99         BEGIN_INTERFACE_PART(ToolTipExt, IQueryInfo)
100                 STDMETHOD(GetInfoTip)(DWORD dwFlags, LPWSTR *ppwszTip);
101                 STDMETHOD(GetInfoFlags)(LPDWORD pdwFlags);
102     END_INTERFACE_PART(ToolTipExt)
103
104         BEGIN_INTERFACE_PART(PersistFileExt, IPersistFile)
105                 STDMETHOD(Load)(LPCOLESTR wszFile, DWORD dwMode);
106                 STDMETHOD(GetClassID)(LPCLSID);
107                 STDMETHOD(IsDirty)(VOID);
108                 STDMETHOD(Save)(LPCOLESTR, BOOL);
109                 STDMETHOD(SaveCompleted)(LPCOLESTR);
110                 STDMETHOD(GetCurFile)(LPOLESTR FAR*);
111     END_INTERFACE_PART(PersistFileExt)
112
113         DECLARE_INTERFACE_MAP()
114 };
115
116 /////////////////////////////////////////////////////////////////////////////
117
118 //{{AFX_INSERT_LOCATION}}
119 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
120
121 #endif // !defined(AFX_SHELLEXT_H__DC515C28_6CAC_11D1_BAE7_00C04FD140D2__INCLUDED_)