Back to index

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

Go to the source code of this file.

Functions

static G_BEGIN_DECLS void interfaceInitCB (AtkEditableTextIface *aIface)
static gboolean setRunAttributesCB (AtkEditableText *aText, AtkAttributeSet *aAttribSet, gint aStartOffset, gint aEndOffset)
static void setTextContentsCB (AtkEditableText *aText, const gchar *aString)
static void insertTextCB (AtkEditableText *aText, const gchar *aString, gint aLength, gint *aPosition)
static void copyTextCB (AtkEditableText *aText, gint aStartPos, gint aEndPos)
static void cutTextCB (AtkEditableText *aText, gint aStartPos, gint aEndPos)
static void deleteTextCB (AtkEditableText *aText, gint aStartPos, gint aEndPos)
static void pasteTextCB (AtkEditableText *aText, gint aPosition)

Function Documentation

void copyTextCB ( AtkEditableText *  aText,
gint  aStartPos,
gint  aEndPos 
) [static]

Definition at line 184 of file nsMaiInterfaceEditableText.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
    if (!accWrap)
        return;

    nsCOMPtr<nsIAccessibleEditableText> accText;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
                            getter_AddRefs(accText));
    if (!accText)
        return;

    MAI_LOG_DEBUG(("EditableText: copyTextCB, aStartPos=%d, aEndPos=%d",
                   aStartPos, aEndPos));
    nsresult rv = accText->CopyText(aStartPos, aEndPos);
    NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
                     "MaiInterfaceEditableText::CopyText, failed\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void cutTextCB ( AtkEditableText *  aText,
gint  aStartPos,
gint  aEndPos 
) [static]

Definition at line 204 of file nsMaiInterfaceEditableText.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
    if (!accWrap)
        return;

    nsCOMPtr<nsIAccessibleEditableText> accText;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
                            getter_AddRefs(accText));
    if (!accText)
        return;
    MAI_LOG_DEBUG(("EditableText: cutTextCB, aStartPos=%d, aEndPos=%d",
                   aStartPos, aEndPos));
    nsresult rv = accText->CutText(aStartPos, aEndPos);
    NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
                     "MaiInterfaceEditableText::CutText, failed\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void deleteTextCB ( AtkEditableText *  aText,
gint  aStartPos,
gint  aEndPos 
) [static]

Definition at line 223 of file nsMaiInterfaceEditableText.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
    if (!accWrap)
        return;

    nsCOMPtr<nsIAccessibleEditableText> accText;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
                            getter_AddRefs(accText));
    if (!accText)
        return;

    MAI_LOG_DEBUG(("EditableText: deleteTextCB, aStartPos=%d, aEndPos=%d",
                   aStartPos, aEndPos));
    nsresult rv = accText->DeleteText(aStartPos, aEndPos);
    NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
                     "MaiInterfaceEditableText::DeleteText, failed\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void insertTextCB ( AtkEditableText *  aText,
const gchar *  aString,
gint  aLength,
gint *  aPosition 
) [static]

Definition at line 154 of file nsMaiInterfaceEditableText.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
    if (!accWrap)
        return;

    nsCOMPtr<nsIAccessibleEditableText> accText;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
                            getter_AddRefs(accText));
    if (!accText)
        return;

    NS_ConvertUTF8toUCS2 strContent(aString);

    // interface changed in nsIAccessibleEditabelText.idl ???
    //
    // PRInt32 pos = *aPosition;
    // nsresult rv = accText->InsertText(strContent, aLength, &pos);
    // *aPosition = pos;

    nsresult rv = accText->InsertText(strContent, *aPosition);
    NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
                     "MaiInterfaceEditableText::InsertText, failed\n");

    MAI_LOG_DEBUG(("EditableText: insert aString=%s, aLength=%d, aPosition=%d",
                   aString, aLength, *aPosition));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void interfaceInitCB ( AtkEditableTextIface *  aIface) [static]

Definition at line 93 of file nsMaiInterfaceEditableText.cpp.

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

    aIface->set_run_attributes = setRunAttributesCB;
    aIface->set_text_contents = setTextContentsCB;
    aIface->insert_text = insertTextCB;
    aIface->copy_text = copyTextCB;
    aIface->cut_text = cutTextCB;
    aIface->delete_text = deleteTextCB;
    aIface->paste_text = pasteTextCB;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pasteTextCB ( AtkEditableText *  aText,
gint  aPosition 
) [static]

Definition at line 243 of file nsMaiInterfaceEditableText.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
    if (!accWrap)
        return;

    nsCOMPtr<nsIAccessibleEditableText> accText;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
                            getter_AddRefs(accText));
    if (!accText)
        return;

    MAI_LOG_DEBUG(("EditableText: pasteTextCB, aPosition=%d", aPosition));
    nsresult rv = accText->PasteText(aPosition);
    NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
                     "MaiInterfaceEditableText::PasteText, failed\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean setRunAttributesCB ( AtkEditableText *  aText,
AtkAttributeSet *  aAttribSet,
gint  aStartOffset,
gint  aEndOffset 
) [static]

Definition at line 111 of file nsMaiInterfaceEditableText.cpp.

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

    nsCOMPtr<nsIAccessibleEditableText> accText;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
                            getter_AddRefs(accText));
    NS_ENSURE_TRUE(accText, FALSE);

    nsCOMPtr<nsISupports> attrSet;
    /* how to insert attributes into nsISupports ??? */

    nsresult rv = accText->SetAttributes(aStartOffset, aEndOffset,
                                         attrSet);
    return NS_FAILED(rv) ? FALSE : TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void setTextContentsCB ( AtkEditableText *  aText,
const gchar *  aString 
) [static]

Definition at line 132 of file nsMaiInterfaceEditableText.cpp.

{
    nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
    if (!accWrap)
        return;

    nsCOMPtr<nsIAccessibleEditableText> accText;
    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
                            getter_AddRefs(accText));
    if (!accText)
        return;

    MAI_LOG_DEBUG(("EditableText: setTextContentsCB, aString=%s", aString));

    NS_ConvertUTF8toUCS2 strContent(aString);
    nsresult rv = accText->SetTextContents(strContent);

    NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
                     "MaiInterfaceEditableText::SetTextContents, failed\n");
}

Here is the call graph for this function:

Here is the caller graph for this function: