本文整理汇总了C++中QWindowsAccessible::QueryInterface方法的典型用法代码示例。如果您正苦于以下问题:C++ QWindowsAccessible::QueryInterface方法的具体用法?C++ QWindowsAccessible::QueryInterface怎么用?C++ QWindowsAccessible::QueryInterface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWindowsAccessible
的用法示例。
在下文中一共展示了QWindowsAccessible::QueryInterface方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accHitTest
/*
IAccessible
*/
HRESULT STDMETHODCALLTYPE QWindowsAccessible::accHitTest(long xLeft, long yTop, VARIANT *pvarID)
{
showDebug(__FUNCTION__, accessible);
if (!accessible->isValid())
return E_FAIL;
int control = accessible->childAt(xLeft, yTop);
if (control == -1) {
(*pvarID).vt = VT_EMPTY;
return S_FALSE;
}
QAccessibleInterface *acc = 0;
if (control)
accessible->navigate(Child, control, &acc);
if (!acc) {
(*pvarID).vt = VT_I4;
(*pvarID).lVal = control;
return S_OK;
}
QWindowsAccessible* wacc = new QWindowsAccessible(acc);
IDispatch *iface = 0;
wacc->QueryInterface(IID_IDispatch, (void**)&iface);
if (iface) {
(*pvarID).vt = VT_DISPATCH;
(*pvarID).pdispVal = iface;
return S_OK;
} else {
delete wacc;
}
(*pvarID).vt = VT_EMPTY;
return S_FALSE;
}
示例2: get_accChild
HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accChild(VARIANT varChildID, IDispatch** ppdispChild)
{
showDebug(__FUNCTION__, accessible);
if (!accessible->isValid())
return E_FAIL;
if (varChildID.vt == VT_EMPTY)
return E_INVALIDARG;
int childIndex = varChildID.lVal;
QAccessibleInterface *acc = 0;
AccessibleElement elem(childIndex, accessible);
if (elem.iface) {
RelationFlag rel = elem.entry ? Child : Self;
int index = elem.iface->navigate(rel, elem.entry, &acc);
if (index == -1)
return E_INVALIDARG;
}
if (acc) {
QWindowsAccessible* wacc = new QWindowsAccessible(acc);
wacc->QueryInterface(IID_IDispatch, (void**)ppdispChild);
return S_OK;
}
*ppdispChild = 0;
return S_FALSE;
}
示例3: QWindowsAccessible
IAccessible *qt_createWindowsAccessible(QAccessibleInterface *access)
{
QWindowsAccessible *acc = new QWindowsAccessible(access);
IAccessible *iface;
acc->QueryInterface(IID_IAccessible, (void**)&iface);
return iface;
}
示例4: get_accParent
HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accParent(IDispatch** ppdispParent)
{
#ifdef DEBUG_SHOW_ATCLIENT_COMMANDS
showDebug(__FUNCTION__, accessible);
#endif //DEBUG_SHOW_ATCLIENT_COMMANDS
if (!accessible->isValid())
return E_FAIL;
QAccessibleInterface *acc = 0;
accessible->navigate(Ancestor, 1, &acc);
if (acc) {
QWindowsAccessible* wacc = new QWindowsAccessible(acc);
wacc->QueryInterface(IID_IDispatch, (void**)ppdispParent);
if (*ppdispParent)
return S_OK;
}
*ppdispParent = 0;
return S_FALSE;
}
示例5: get_accChild
HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accChild(VARIANT varChildID, IDispatch** ppdispChild)
{
#ifdef DEBUG_SHOW_ATCLIENT_COMMANDS
showDebug(__FUNCTION__, accessible);
#endif //DEBUG_SHOW_ATCLIENT_COMMANDS
if (!accessible->isValid())
return E_FAIL;
if (varChildID.vt == VT_EMPTY)
return E_INVALIDARG;
QAccessibleInterface *acc = 0;
RelationFlag rel = varChildID.lVal ? Child : Self;
accessible->navigate(rel, varChildID.lVal, &acc);
if (acc) {
QWindowsAccessible* wacc = new QWindowsAccessible(acc);
wacc->QueryInterface(IID_IDispatch, (void**)ppdispChild);
return S_OK;
}
*ppdispChild = 0;
return S_FALSE;
}
示例6: accNavigate
HRESULT STDMETHODCALLTYPE QWindowsAccessible::accNavigate(long navDir, VARIANT varStart, VARIANT *pvarEnd)
{
#ifdef DEBUG_SHOW_ATCLIENT_COMMANDS
showDebug(__FUNCTION__, accessible);
#endif //DEBUG_SHOW_ATCLIENT_COMMANDS
if (!accessible->isValid())
return E_FAIL;
QAccessibleInterface *acc = 0;
int control = -1;
switch(navDir) {
case NAVDIR_FIRSTCHILD:
control = accessible->navigate(Child, 1, &acc);
break;
case NAVDIR_LASTCHILD:
control = accessible->navigate(Child, accessible->childCount(), &acc);
break;
case NAVDIR_NEXT:
case NAVDIR_PREVIOUS:
if (!varStart.lVal){
QAccessibleInterface *parent = 0;
accessible->navigate(Ancestor, 1, &parent);
if (parent) {
int index = parent->indexOfChild(accessible);
index += (navDir == NAVDIR_NEXT) ? 1 : -1;
if (index > 0 && index <= parent->childCount())
control = parent->navigate(Child, index, &acc);
delete parent;
}
} else {
int index = varStart.lVal;
index += (navDir == NAVDIR_NEXT) ? 1 : -1;
if (index > 0 && index <= accessible->childCount())
control = accessible->navigate(Child, index, &acc);
}
break;
case NAVDIR_UP:
control = accessible->navigate(Up, varStart.lVal, &acc);
break;
case NAVDIR_DOWN:
control = accessible->navigate(Down, varStart.lVal, &acc);
break;
case NAVDIR_LEFT:
control = accessible->navigate(Left, varStart.lVal, &acc);
break;
case NAVDIR_RIGHT:
control = accessible->navigate(Right, varStart.lVal, &acc);
break;
default:
break;
}
if (control == -1) {
(*pvarEnd).vt = VT_EMPTY;
return S_FALSE;
}
if (!acc) {
(*pvarEnd).vt = VT_I4;
(*pvarEnd).lVal = control;
return S_OK;
}
QWindowsAccessible* wacc = new QWindowsAccessible(acc);
IDispatch *iface = 0;
wacc->QueryInterface(IID_IDispatch, (void**)&iface);
if (iface) {
(*pvarEnd).vt = VT_DISPATCH;
(*pvarEnd).pdispVal = iface;
return S_OK;
} else {
delete wacc;
}
(*pvarEnd).vt = VT_EMPTY;
return S_FALSE;
}