Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsMaiInterfaceSelection.cpp File Reference
#include "nsMaiInterfaceSelection.h"

Go to the source code of this file.

Functions

static G_BEGIN_DECLS void interfaceInitCB (AtkSelectionIface *aIface)
static gboolean addSelectionCB (AtkSelection *aSelection, gint i)
static gboolean clearSelectionCB (AtkSelection *aSelection)
static AtkObject * refSelectionCB (AtkSelection *aSelection, gint i)
static gint getSelectionCountCB (AtkSelection *aSelection)
static gboolean isChildSelectedCB (AtkSelection *aSelection, gint i)
static gboolean removeSelectionCB (AtkSelection *aSelection, gint i)
static gboolean selectAllSelectionCB (AtkSelection *aSelection)

Function Documentation

gboolean addSelectionCB ( AtkSelection *  aSelection,
gint  i 
) [static]

Definition at line 108 of file nsMaiInterfaceSelection.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
    NS_ENSURE_TRUE(accWrap, FALSE);

    nsCOMPtr<nsIAccessibleSelectable> accSelection;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
                            getter_AddRefs(accSelection));
    NS_ENSURE_TRUE(accSelection, FALSE);

    return NS_SUCCEEDED(accSelection->AddChildToSelection(i));
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean clearSelectionCB ( AtkSelection *  aSelection) [static]

Definition at line 122 of file nsMaiInterfaceSelection.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
    NS_ENSURE_TRUE(accWrap, FALSE);

    nsCOMPtr<nsIAccessibleSelectable> accSelection;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
                            getter_AddRefs(accSelection));
    NS_ENSURE_TRUE(accSelection, FALSE);

    return NS_SUCCEEDED(accSelection->ClearSelection());
}

Here is the call graph for this function:

Here is the caller graph for this function:

gint getSelectionCountCB ( AtkSelection *  aSelection) [static]

Definition at line 161 of file nsMaiInterfaceSelection.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
    NS_ENSURE_TRUE(accWrap, -1);

    nsCOMPtr<nsIAccessibleSelectable> accSelection;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
                            getter_AddRefs(accSelection));
    NS_ENSURE_TRUE(accSelection, -1);

    PRInt32 num = 0;
    nsresult rv = accSelection->GetSelectionCount(&num);
    return (NS_FAILED(rv)) ? -1 : num;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void interfaceInitCB ( AtkSelectionIface *  aIface) [static]

Definition at line 92 of file nsMaiInterfaceSelection.cpp.

{
    NS_ASSERTION(aIface, "Invalid aIface");
    if (!aIface)
        return;

    aIface->add_selection = addSelectionCB;
    aIface->clear_selection = clearSelectionCB;
    aIface->ref_selection = refSelectionCB;
    aIface->get_selection_count = getSelectionCountCB;
    aIface->is_child_selected = isChildSelectedCB;
    aIface->remove_selection = removeSelectionCB;
    aIface->select_all_selection = selectAllSelectionCB;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean isChildSelectedCB ( AtkSelection *  aSelection,
gint  i 
) [static]

Definition at line 177 of file nsMaiInterfaceSelection.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
    NS_ENSURE_TRUE(accWrap, FALSE);

    nsCOMPtr<nsIAccessibleSelectable> accSelection;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
                            getter_AddRefs(accSelection));
    NS_ENSURE_TRUE(accSelection, FALSE);

    PRBool result = FALSE;
    nsresult rv = accSelection->IsChildSelected(i, &result);
    return (NS_FAILED(rv)) ? FALSE : result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

AtkObject * refSelectionCB ( AtkSelection *  aSelection,
gint  i 
) [static]

Definition at line 136 of file nsMaiInterfaceSelection.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
    NS_ENSURE_TRUE(accWrap, nsnull);

    nsCOMPtr<nsIAccessibleSelectable> accSelection;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
                            getter_AddRefs(accSelection));
    NS_ENSURE_TRUE(accSelection, nsnull);

    AtkObject *atkObj = nsnull;
    nsCOMPtr<nsIAccessible> accSelect;
    nsresult rv = accSelection->RefSelection(i, getter_AddRefs(accSelect));
    if (NS_SUCCEEDED(rv) && accSelect) {
        nsIAccessible *tmpAcc = accSelect;
        nsAccessibleWrap *refAccWrap =
            NS_STATIC_CAST(nsAccessibleWrap *, tmpAcc);
        atkObj = refAccWrap->GetAtkObject();
        if (atkObj)
            g_object_ref(atkObj);
    }
    return atkObj;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean removeSelectionCB ( AtkSelection *  aSelection,
gint  i 
) [static]

Definition at line 193 of file nsMaiInterfaceSelection.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
    NS_ENSURE_TRUE(accWrap, FALSE);

    nsCOMPtr<nsIAccessibleSelectable> accSelection;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
                            getter_AddRefs(accSelection));
    NS_ENSURE_TRUE(accSelection, FALSE);

    nsresult rv = accSelection->RemoveChildFromSelection(i);
    return (NS_FAILED(rv)) ? FALSE : TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean selectAllSelectionCB ( AtkSelection *  aSelection) [static]

Definition at line 208 of file nsMaiInterfaceSelection.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
    NS_ENSURE_TRUE(accWrap, FALSE);

    nsCOMPtr<nsIAccessibleSelectable> accSelection;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
                            getter_AddRefs(accSelection));
    NS_ENSURE_TRUE(accSelection, FALSE);

    PRBool result = FALSE;
    nsresult rv = accSelection->SelectAllSelection(&result);
    return (NS_FAILED(rv)) ? FALSE : result;
}

Here is the call graph for this function:

Here is the caller graph for this function: