diff options
author | Jocelyn Turcotte <jturcotte@woboq.com> | 2017-01-05 19:01:32 +0300 |
---|---|---|
committer | Jocelyn Turcotte <jturcotte@woboq.com> | 2017-01-18 14:15:52 +0300 |
commit | e709d75d569f5b1bf6e19fd773485300db6f9fae (patch) | |
tree | 05c488e4a5159722a1dc8a8c6dda55804babdf95 /shell_integration | |
parent | cb5cfb8cf6e4d3f90b68145153b5816dff3de155 (diff) |
shell/Windows: Remove unused files
The real OCContextMenu.cpp is in the OCContextMenu folder.
Diffstat (limited to 'shell_integration')
-rw-r--r-- | shell_integration/windows/OCOverlays/OCContextMenu.cpp | 131 | ||||
-rw-r--r-- | shell_integration/windows/OCOverlays/OCContextMenu.h | 43 |
2 files changed, 0 insertions, 174 deletions
diff --git a/shell_integration/windows/OCOverlays/OCContextMenu.cpp b/shell_integration/windows/OCOverlays/OCContextMenu.cpp deleted file mode 100644 index cac5125a8..000000000 --- a/shell_integration/windows/OCOverlays/OCContextMenu.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/** -* Copyright (c) 2015 Daniel Molkentin <danimo@owncloud.com>. All rights reserved. -* -* This library is free software; you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the Free -* Software Foundation; either version 2.1 of the License, or (at your option) -* any later version. -* -* This library is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -* details. -*/ - -#include "OCContextMenu.h" -#include "stdafx.h" - -#define IDM_SHARE 0 - -OCContextMenu::OCContextMenu() - : m_pwszVerb(0) - , m_referenceCount(0) -{ -} - - -OCContextMenu::~OCContextMenu() -{ -} - -IFACEMETHODIMP_(ULONG) OCContextMenu::AddRef() -{ - return InterlockedIncrement(&m_referenceCount); -} - -IFACEMETHODIMP_(ULONG) OCContextMenu::Release() -{ - ULONG cRef = InterlockedDecrement(&m_referenceCount); - if (0 == cRef) - { - delete this; - } - - return cRef; -} - -IFACEMETHODIMP OCContextMenu::QueryInterface(REFIID riid, void **ppv) -{ - HRESULT hr = S_OK; - - if (IsEqualIID(IID_IUnknown, riid) || IsEqualIID(IID_IContextMenu, riid)) - { - *ppv = static_cast<IContextMenu *>(this); - } - else - { - hr = E_NOINTERFACE; - *ppv = NULL; - } - - if (*ppv) - { - AddRef(); - } - - return hr; -} - -IFACEMETHODIMP OCContextMenu::GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax) -{ - HRESULT hr = E_INVALIDARG; - - if (idCmd == IDM_SHARE) - { - switch (uFlags) - { - case GCS_HELPTEXTW: - hr = StringCchCopyW(reinterpret_cast<PWSTR>(pszName), cchMax, L"Shares file or directory with ownCloud"); - break; - - case GCS_VERBW: - // GCS_VERBW is an optional feature that enables a caller - // to discover the canonical name for the verb that is passed in - // through idCommand. - hr = StringCchCopyW(reinterpret_cast<PWSTR>(pszName), cchMax, L"ownCloudShare"); - break; - } - } - return hr; -} - -IFACEMETHODIMP OCContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO pici) -{ - if (pici->cbSize == sizeof(CMINVOKECOMMANDINFOEX) && - (pici->fMask & CMIC_MASK_UNICODE)) - { - return E_FAIL; - } - return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(0)); - if (HIWORD(((CMINVOKECOMMANDINFOEX *)pici)->lpVerbW)) - { - if (StrCmpIW(((CMINVOKECOMMANDINFOEX *)pici)->lpVerbW, m_pwszVerb)) - { - return E_FAIL; - } - } - - if (LOWORD(pici->lpVerb) != IDM_SHARE) { - return E_FAIL; - } - - MessageBox(pici->hwnd, - L"ownCloud was here", - L"ownCloud was here", - MB_OK | MB_ICONINFORMATION); - -} - -IFACEMETHODIMP OCContextMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) -{ - HRESULT hr; - - if (!(CMF_DEFAULTONLY & uFlags)) - { - InsertMenu(hMenu, indexMenu, MF_STRING | MF_BYPOSITION, idCmdFirst + IDM_SHARE, L"&Share with ownCloud"); - } - hr = StringCbCopyW(m_pwszVerb, sizeof(m_pwszVerb), L"ownCloudShare"); - - return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(IDM_SHARE + 1)); -} - diff --git a/shell_integration/windows/OCOverlays/OCContextMenu.h b/shell_integration/windows/OCOverlays/OCContextMenu.h deleted file mode 100644 index 81cec6021..000000000 --- a/shell_integration/windows/OCOverlays/OCContextMenu.h +++ /dev/null @@ -1,43 +0,0 @@ -/** -* Copyright (c) 2015 Daniel Molkentin <danimo@owncloud.com>. All rights reserved. -* -* This library is free software; you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the Free -* Software Foundation; either version 2.1 of the License, or (at your option) -* any later version. -* -* This library is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -* details. -*/ - -#ifndef OCCONTEXTMENU_H -#define OCCONTEXTMENU_H - -#pragma once - -#include "ShObjIdl.h" -#include "memory" - -class OCContextMenu :public IContextMenu -{ -public: - OCContextMenu(); - ~OCContextMenu(); - - IFACEMETHODIMP QueryInterface(REFIID riid, void **ppv); - IFACEMETHODIMP_(ULONG) AddRef(); - IFACEMETHODIMP_(ULONG) Release(); - - - IFACEMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT *pwReserved, LPSTR pszName, UINT cchMax); - IFACEMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO pici); - IFACEMETHODIMP QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); -private: - TCHAR* m_pwszVerb; - long m_referenceCount; - -}; - -#endif //OCCONTEXTMENU_H
\ No newline at end of file |