Windows: Build afs_shl_ext.dll with talocaleU.lib
[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   "AfsClientContextMenu"
28 #define _STR_EXT_TITLE2  "AfsClientOverlayHandler"
29 #define STR_EXT_TITLE   TEXT(_STR_EXT_TITLE)
30 #define STR_EXT_TITLE2  TEXT(_STR_EXT_TITLE2)
31 #define STR_REG_PATH    TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellIconOverlayIdentifiers")
32
33 /////////////////////////////////////////////////////////////////////////////
34 // CShellExt command target
35
36 class CShellExt : public CCmdTarget
37 {
38     DECLARE_DYNCREATE(CShellExt)
39
40     BOOL m_bDirSelected;
41     BOOL m_bIsSymlink;  // is symbolic link!
42     TCHAR m_szFile[MAX_PATH];
43     BOOL m_bIsOverlayEnabled;
44     int  m_overlayObject;
45     BOOL IsOverlayEnabled(){return m_bIsOverlayEnabled;}
46
47     CStringArray m_astrFileNames;
48
49     CShellExt();           // protected constructor used by dynamic creation
50     LPMALLOC m_pAlloc;
51
52 // Attributes
53 public:
54
55 // Operations
56 public:
57     int GetOverlayObject() {return m_overlayObject;}
58 // Overrides
59     // ClassWizard generated virtual function overrides
60     //{{AFX_VIRTUAL(CShellExt)
61   public:
62     virtual void OnFinalRelease();
63     //}}AFX_VIRTUAL
64
65 // Implementation
66 protected:
67     virtual ~CShellExt();
68
69     // Generated message map functions
70     //{{AFX_MSG(CShellExt)
71     // NOTE - the ClassWizard will add and remove member functions here.
72     //}}AFX_MSG
73
74     DECLARE_MESSAGE_MAP()
75     // Generated OLE dispatch map functions
76     //{{AFX_DISPATCH(CShellExt)
77     // NOTE - the ClassWizard will add and remove member functions here.
78     //}}AFX_DISPATCH
79     DECLARE_DISPATCH_MAP()
80
81     DECLARE_OLECREATE(CShellExt)
82
83         // IFileViewer interface
84     BEGIN_INTERFACE_PART(MenuExt, IContextMenu)
85         STDMETHOD(QueryContextMenu)( HMENU hmenu,UINT indexMenu,UINT idCmdFirst,
86                                      UINT idCmdLast,UINT uFlags);
87         STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpici);
88         STDMETHOD(GetCommandString)(UINT_PTR idCmd,UINT uType,UINT* pwReserved,LPSTR pszName,
89                                      UINT cchMax);
90     END_INTERFACE_PART(MenuExt)
91
92     // IShellExtInit interface
93     BEGIN_INTERFACE_PART(ShellInit, IShellExtInit)
94         STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder,IDataObject *lpdobj, HKEY hkeyProgID);
95     END_INTERFACE_PART(ShellInit)
96
97     BEGIN_INTERFACE_PART(IconExt, IShellIconOverlayIdentifier)
98         STDMETHOD(GetOverlayInfo)(LPWSTR pwszIconFile,int cchMax,int* pIndex,DWORD* pdwFlags);
99         STDMETHOD(GetPriority)(int* pPriority);
100         STDMETHOD(IsMemberOf)(LPCWSTR pwszPath,DWORD dwAttrib);
101     END_INTERFACE_PART(IconExt)
102
103     BEGIN_INTERFACE_PART(ToolTipExt, IQueryInfo)
104         STDMETHOD(GetInfoTip)(DWORD dwFlags, LPWSTR *ppwszTip);
105         STDMETHOD(GetInfoFlags)(LPDWORD pdwFlags);
106     END_INTERFACE_PART(ToolTipExt)
107
108     BEGIN_INTERFACE_PART(PersistFileExt, IPersistFile)
109         STDMETHOD(Load)(LPCOLESTR wszFile, DWORD dwMode);
110         STDMETHOD(GetClassID)(LPCLSID);
111         STDMETHOD(IsDirty)(VOID);
112         STDMETHOD(Save)(LPCOLESTR, BOOL);
113         STDMETHOD(SaveCompleted)(LPCOLESTR);
114         STDMETHOD(GetCurFile)(LPOLESTR FAR*);
115     END_INTERFACE_PART(PersistFileExt)
116
117     DECLARE_INTERFACE_MAP()
118 };
119
120 class CShellExt2 : public CShellExt
121 {
122 public:
123     DECLARE_DYNCREATE(CShellExt2)
124     CShellExt2() : CShellExt()
125     {
126         m_overlayObject = 1;
127     }
128     ~CShellExt2()
129     {
130     }
131     DECLARE_OLECREATE(CShellExt2)
132 };
133
134 /////////////////////////////////////////////////////////////////////////////
135
136 //{{AFX_INSERT_LOCATION}}
137 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
138
139 #endif // !defined(AFX_SHELLEXT_H__DC515C28_6CAC_11D1_BAE7_00C04FD140D2__INCLUDED_)