Returns whether plugin should be enabled in the contextual menu. @param p_ParentPath Path of the parent directory of files that triggered the contextual menu. @param p_File Path of one file that was selected. @return Whether plugin should be enabled or not in the contextual menu.
| 194 | // @return Whether plugin should be enabled or not in the contextual menu. |
| 195 | // |
| 196 | bool COMPlugin::Enabled(const std::wstring& p_ParentPath, |
| 197 | const std::wstring& p_File) const |
| 198 | { |
| 199 | // Check if plugin supports state changes. Otherwise assume it is enabled. |
| 200 | bool enabled = true; |
| 201 | if (m_cpPluginState != nullptr) { |
| 202 | // Ask plugin if it should be enabled. If an error |
| 203 | // code is returned, do not enable the plugin. |
| 204 | ATL::CComBSTR bstrParentPath(p_ParentPath.c_str()); |
| 205 | ATL::CComBSTR bstrFile(p_File.c_str()); |
| 206 | VARIANT_BOOL bEnabled = VARIANT_FALSE; |
| 207 | const HRESULT hRes = m_cpPluginState->Enabled(bstrParentPath, bstrFile, &bEnabled); |
| 208 | enabled = SUCCEEDED(hRes) && hRes != S_FALSE && bEnabled != VARIANT_FALSE; |
| 209 | } |
| 210 | return enabled; |
| 211 | } |
| 212 | |
| 213 | // |
| 214 | // Transforms the given path using the plugin. |
nothing calls this directly
no outgoing calls
no test coverage detected