joachim99@75: /* joachim99@75: * Copyright (c) 2003-2004, Sergey Zorin. All rights reserved. joachim99@75: * joachim99@75: * This software is distributable under the BSD license. See the terms joachim99@75: * of the BSD license in the LICENSE file provided with this software. joachim99@75: * joachim99@75: */ joachim99@75: joachim99@75: #ifndef __diff_ext_h__ joachim99@75: #define __diff_ext_h__ joachim99@75: joachim99@75: #include joachim99@75: #include joachim99@75: #include joachim99@75: joachim99@75: #include "server.h" joachim99@75: joachim99@75: joachim99@75: // this is the actual OLE Shell context menu handler joachim99@75: class DIFF_EXT : public IContextMenu, IShellExtInit { joachim99@75: public: joachim99@75: DIFF_EXT(); joachim99@75: virtual ~DIFF_EXT(); joachim99@75: joachim99@75: //IUnknown members joachim99@75: STDMETHODIMP QueryInterface(REFIID interface_id, void** result); joachim99@75: STDMETHODIMP_(ULONG) AddRef(); joachim99@75: STDMETHODIMP_(ULONG) Release(); joachim99@75: joachim99@75: //IShell members joachim99@75: STDMETHODIMP QueryContextMenu(HMENU menu, UINT index, UINT cmd_first, UINT cmd_last, UINT flags); joachim99@75: STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO info); joachim99@75: STDMETHODIMP GetCommandString(UINT cmd, UINT flags, UINT* reserved, LPSTR name, UINT name_length); joachim99@75: joachim99@75: //IShellExtInit methods joachim99@75: STDMETHODIMP Initialize(LPCITEMIDLIST folder, IDataObject* subj, HKEY key); joachim99@75: joachim99@75: private: joachim99@75: void diff( const tstring& arguments ); joachim99@75: void diff_with(unsigned int num, bool bMerge); joachim99@75: tstring cut_to_length(const tstring&, size_t length = 64); joachim99@75: void initialize_language(); joachim99@75: joachim99@75: private: joachim99@75: UINT m_nrOfSelectedFiles; joachim99@75: tstring _file_name1; joachim99@75: tstring _file_name2; joachim99@75: tstring _file_name3; joachim99@75: HINSTANCE _resource; joachim99@75: HWND _hwnd; joachim99@75: joachim99@75: ULONG _ref_count; joachim99@75: joachim99@75: std::list< tstring >& m_recentFiles; joachim99@75: UINT m_id_FirstCmd; joachim99@75: UINT m_id_Diff; joachim99@75: UINT m_id_DiffWith; joachim99@75: UINT m_id_DiffLater; joachim99@75: UINT m_id_MergeWith; joachim99@75: UINT m_id_Merge3; joachim99@75: UINT m_id_Diff3; joachim99@75: UINT m_id_DiffWith_Base; joachim99@75: UINT m_id_About; joachim99@77: UINT m_id_ClearList; joachim99@75: }; joachim99@75: joachim99@75: #endif // __diff_ext_h__