Exemplo n.º 1
0
// @pymethod |PyIShellItemArray|GetPropertyDescriptionList|Description of GetPropertyDescriptionList.
PyObject *PyIShellItemArray::GetPropertyDescriptionList(PyObject *self, PyObject *args)
{
	IShellItemArray *pISIA = GetI(self);
	if ( pISIA == NULL )
		return NULL;
	PROPERTYKEY keyType;
	PyObject *obkeyType;
	// @pyparm <o PyREFPROPERTYKEY>|keyType||Description for keyType
	// @pyparm <o PyIID>|riid||Description for riid
	PyObject *obriid;
	IID riid;
	void *pv;
	if ( !PyArg_ParseTuple(args, "OO:GetPropertyDescriptionList", &obkeyType, &obriid) )
		return NULL;
	BOOL bPythonIsHappy = TRUE;
	if (bPythonIsHappy && !PyObject_AsSHCOLUMNID(obkeyType, &keyType)) bPythonIsHappy = FALSE;
	if (bPythonIsHappy && !PyWinObject_AsIID(obriid, &riid)) bPythonIsHappy = FALSE;
	if (!bPythonIsHappy) return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pISIA->GetPropertyDescriptionList( keyType, riid, &pv );
	PY_INTERFACE_POSTCALL;
	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pISIA, IID_IShellItemArray );
	return PyCom_PyObjectFromIUnknown((IUnknown *)pv, riid, FALSE);
}
Exemplo n.º 2
0
STDMETHODIMP PyGCategoryProvider::GetDefaultCategory(
		/* [out] */ __RPC__out GUID * pguid,
		/* [out] */ __RPC__out SHCOLUMNID * pscid)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetDefaultCategory", &result);
	if (FAILED(hr)) return hr;
	// GUID is documented by MSDN as unused - but the FolderView MSDN
	// only sets *pguid (it sets 'pscid' - without the '*' - which has
	// no effect!
	PyObject *obguid, *obscid;
	if (!PyArg_ParseTuple(result, "OO:GetDefaultCategory result", &obguid, &obscid))
		hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetDefaultCategory");
	else {
		if (!PyWinObject_AsIID(obguid , pguid) || !PyObject_AsSHCOLUMNID(obscid, pscid))
			hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetDefaultCategory");
	}
	Py_DECREF(result);
	return hr;
}
Exemplo n.º 3
0
// @pymethod |PyICategoryProvider|GetCategoryForSCID|Description of GetCategoryForSCID.
PyObject *PyICategoryProvider::GetCategoryForSCID(PyObject *self, PyObject *args)
{
	ICategoryProvider *pICP = GetI(self);
	if ( pICP == NULL )
		return NULL;
	SHCOLUMNID scid;
	PyObject *obpscid;
	// @pyparm <o SHCOLUMNID>|pscid||Description for pscid
	if ( !PyArg_ParseTuple(args, "O:GetCategoryForSCID", &obpscid) )
		return NULL;
	BOOL bPythonIsHappy = TRUE;
	if (!PyObject_AsSHCOLUMNID( obpscid, &scid ))
		return NULL;
	HRESULT hr;
	GUID guid;
	PY_INTERFACE_PRECALL;
	hr = pICP->GetCategoryForSCID( &scid, &guid );
	PY_INTERFACE_POSTCALL;

	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pICP, IID_ICategoryProvider );
	return PyWinObject_FromIID(guid);
}
Exemplo n.º 4
0
// @pymethod |PyICategoryProvider|CanCategorizeOnSCID|Description of CanCategorizeOnSCID.
PyObject *PyICategoryProvider::CanCategorizeOnSCID(PyObject *self, PyObject *args)
{
	ICategoryProvider *pICP = GetI(self);
	if ( pICP == NULL )
		return NULL;
	SHCOLUMNID scid;
	PyObject *obpscid;
	// @pyparm <o SHCOLUMNID>|pscid||Description for pscid
	if ( !PyArg_ParseTuple(args, "O:CanCategorizeOnSCID", &obpscid) )
		return NULL;
	BOOL bPythonIsHappy = TRUE;
	if (!PyObject_AsSHCOLUMNID(obpscid, &scid ))
		return NULL;
	HRESULT hr;
	PY_INTERFACE_PRECALL;
	hr = pICP->CanCategorizeOnSCID( &scid );
	PY_INTERFACE_POSTCALL;
	if ( FAILED(hr) )
		return PyCom_BuildPyException(hr, pICP, IID_ICategoryProvider );
	PyObject *ret = (hr==S_OK) ? Py_True : Py_False;
	Py_INCREF(ret);
	return ret;
}