Back to index

lightning-sunbird  0.9+nobinonly
nsDocAccessibleWrap.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* vim:expandtab:shiftwidth=4:tabstop=4:
00003  */
00004 /* ***** BEGIN LICENSE BLOCK *****
00005  * Version: NPL 1.1/GPL 2.0/LGPL 2.1
00006  *
00007  *
00008  * The contents of this file are subject to the Mozilla Public
00009  * License Version 1.1 (the "License"); you may not use this file
00010  * except in compliance with the License. You may obtain a copy of
00011  * the License at http://www.mozilla.org/MPL/
00012  *
00013  * Software distributed under the License is distributed on an "AS
00014  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
00015  * implied. See the License for the specific language governing
00016  * rights and limitations under the License.
00017  *
00018  * The Original Code is mozilla.org code.
00019  *
00020  * The Initial Developer of the Original Code is Sun Microsystems, Inc.
00021  * Portions created by Sun Microsystems are Copyright (C) 2002 Sun
00022  * Microsystems, Inc. All Rights Reserved.
00023  *
00024  * Original Author: Bolian Yin (bolian.yin@sun.com)
00025  *
00026  * Contributor(s): John Sun (john.sun@sun.com)
00027  *
00028  * Alternatively, the contents of this file may be used under the terms of
00029  * either the GNU General Public License Version 2 or later (the "GPL"), or
00030  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00031  * in which case the provisions of the GPL or the LGPL are applicable instead
00032  * of those above. If you wish to allow use of your version of this file only
00033  * under the terms of either the GPL or the LGPL, and not to allow others to
00034  * use your version of this file under the terms of the NPL, indicate your
00035  * decision by deleting the provisions above and replace them with the notice
00036  * and other provisions required by the GPL or the LGPL. If you do not delete
00037  * the provisions above, a recipient may use your version of this file under
00038  * the terms of any one of the NPL, the GPL or the LGPL.
00039  *
00040  * ***** END LICENSE BLOCK ***** */
00041 
00042 #include "nsMai.h"
00043 #include "nsDocAccessibleWrap.h"
00044 #include "nsAccessibleEventData.h"
00045 
00046 #include <atk/atk.h>
00047 #include <glib.h>
00048 #include <glib-object.h>
00049 
00050 //----- nsDocAccessibleWrap -----
00051 
00052 /*
00053  * Must keep sychronization with enumerate AtkProperty in 
00054  * accessible/src/base/nsAccessibleEventData.h
00055  */
00056 static char * sAtkPropertyNameArray[PROP_LAST] = {
00057     0,
00058     "accessible_name",
00059     "accessible_description",
00060     "accessible_parent",
00061     "accessible_value",
00062     "accessible_role",
00063     "accessible_layer",
00064     "accessible_mdi_zorder",
00065     "accessible_table_caption",
00066     "accessible_table_column_description",
00067     "accessible_table_column_header",
00068     "accessible_table_row_description",
00069     "accessible_table_row_header",
00070     "accessible_table_summary"
00071 };
00072 
00073 static  AtkStateType TranslateAState(PRUint32 aState, PRUint32 aExtState);
00074 
00075 NS_IMPL_ISUPPORTS_INHERITED2(nsDocAccessibleWrap, nsDocAccessible, nsIAccessibleText, nsIAccessibleEditableText)
00076 
00077 nsDocAccessibleWrap::nsDocAccessibleWrap(nsIDOMNode *aDOMNode,
00078                                          nsIWeakReference *aShell): 
00079   nsDocAccessible(aDOMNode, aShell), nsAccessibleEditableText(aDOMNode)
00080 {
00081 }
00082 
00083 nsDocAccessibleWrap::~nsDocAccessibleWrap()
00084 {
00085 }
00086 
00087 NS_IMETHODIMP nsDocAccessibleWrap::FireToolkitEvent(PRUint32 aEvent,
00088                                                     nsIAccessible* aAccessible,
00089                                                     void* aEventData)
00090 {
00091     NS_ENSURE_ARG_POINTER(aAccessible);
00092 
00093     // First fire nsIObserver event for internal xpcom accessibility clients
00094     nsDocAccessible::FireToolkitEvent(aEvent, aAccessible, aEventData);
00095 
00096     nsresult rv = NS_ERROR_FAILURE;
00097 
00098     nsAccessibleWrap *accWrap =
00099         NS_STATIC_CAST(nsAccessibleWrap *, aAccessible);
00100     MAI_LOG_DEBUG(("\n\nReceived event: aEvent=%u, obj=0x%x, data=0x%x \n",
00101                    aEvent, aAccessible, aEventData));
00102 
00103     nsAccessibleWrap *oldAccWrap = nsnull, *newAccWrap = nsnull;
00104     AtkTableChange * pAtkTableChange = nsnull;
00105 
00106     switch (aEvent) {
00107     case nsIAccessibleEvent::EVENT_FOCUS:
00108         MAI_LOG_DEBUG(("\n\nReceived: EVENT_FOCUS\n"));
00109         atk_focus_tracker_notify(accWrap->GetAtkObject());
00110         rv = NS_OK;
00111         break;
00112 
00113     case nsIAccessibleEvent::EVENT_STATE_CHANGE:
00114         AtkStateChange *pAtkStateChange;
00115         AtkStateType atkState;
00116 
00117         MAI_LOG_DEBUG(("\n\nReceived: EVENT_STATE_CHANGE\n"));
00118         if (!aEventData)
00119             break;
00120 
00121         pAtkStateChange = NS_REINTERPRET_CAST(AtkStateChange *, aEventData);
00122 
00123         switch (pAtkStateChange->state) {
00124         case nsIAccessible::STATE_INVISIBLE:
00125             atkState = ATK_STATE_VISIBLE;
00126             pAtkStateChange->enable = !pAtkStateChange->enable;
00127             break;
00128         case nsIAccessible::STATE_UNAVAILABLE:
00129             atkState = ATK_STATE_ENABLED;
00130             pAtkStateChange->enable = !pAtkStateChange->enable;
00131             break;
00132         case nsIAccessible::STATE_READONLY:
00133             atkState = ATK_STATE_EDITABLE;
00134             pAtkStateChange->enable = !pAtkStateChange->enable;
00135             break;
00136         default:
00137             atkState = TranslateAState(pAtkStateChange->state, pAtkStateChange->extState);
00138         }
00139 
00140         atk_object_notify_state_change(accWrap->GetAtkObject(),
00141                                        atkState, pAtkStateChange->enable);
00142         rv = NS_OK;
00143         break;
00144       
00145         /*
00146          * More complex than I ever thought.
00147          * Need handle them separately.
00148          */
00149     case nsIAccessibleEvent::EVENT_ATK_PROPERTY_CHANGE :
00150         AtkPropertyChange *pAtkPropChange;
00151         AtkPropertyValues values;
00152 
00153         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_PROPERTY_CHANGE\n"));
00154         if (!aEventData)
00155             break;
00156 
00157         pAtkPropChange = NS_REINTERPRET_CAST(AtkPropertyChange *, aEventData);
00158         values.property_name = sAtkPropertyNameArray[pAtkPropChange->type];
00159         
00160         MAI_LOG_DEBUG(("\n\nthe type of EVENT_ATK_PROPERTY_CHANGE: %d\n\n",
00161                        pAtkPropChange->type));
00162 
00163         switch (pAtkPropChange->type) {
00164         case PROP_TABLE_CAPTION:
00165         case PROP_TABLE_SUMMARY:
00166 
00167             if (pAtkPropChange->oldvalue)
00168                 oldAccWrap = NS_REINTERPRET_CAST(nsAccessibleWrap *,
00169                                                  pAtkPropChange->oldvalue);
00170 
00171             if (pAtkPropChange->newvalue)
00172                 newAccWrap = NS_REINTERPRET_CAST(nsAccessibleWrap *,
00173                                                  pAtkPropChange->newvalue);
00174 
00175             if (oldAccWrap && newAccWrap) {
00176                 g_value_init(&values.old_value, G_TYPE_POINTER);
00177                 g_value_set_pointer(&values.old_value,
00178                                     oldAccWrap->GetAtkObject());
00179                 g_value_init(&values.new_value, G_TYPE_POINTER);
00180                 g_value_set_pointer(&values.new_value,
00181                                     newAccWrap->GetAtkObject());
00182                 rv = NS_OK;
00183             }
00184             break;
00185 
00186         case PROP_TABLE_COLUMN_DESCRIPTION:
00187         case PROP_TABLE_COLUMN_HEADER:
00188         case PROP_TABLE_ROW_HEADER:
00189         case PROP_TABLE_ROW_DESCRIPTION:
00190             g_value_init(&values.new_value, G_TYPE_INT);
00191             g_value_set_int(&values.new_value,
00192                             *NS_REINTERPRET_CAST(gint *,
00193                                                  pAtkPropChange->newvalue));
00194             rv = NS_OK;
00195             break;
00196   
00197             //Perhaps need more cases in the future
00198         default:
00199             g_value_init (&values.old_value, G_TYPE_POINTER);
00200             g_value_set_pointer (&values.old_value, pAtkPropChange->oldvalue);
00201             g_value_init (&values.new_value, G_TYPE_POINTER);
00202             g_value_set_pointer (&values.new_value, pAtkPropChange->newvalue);
00203             rv = NS_OK;
00204         }
00205         if (NS_SUCCEEDED(rv)) {
00206             char *signal_name = g_strconcat("property_change::",
00207                                             values.property_name, NULL);
00208             g_signal_emit_by_name(accWrap->GetAtkObject(), signal_name,
00209                                   &values, NULL);
00210             g_free (signal_name);
00211         }
00212 
00213         break;
00214 
00215     case nsIAccessibleEvent::EVENT_ATK_SELECTION_CHANGE:
00216         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_SELECTION_CHANGE\n"));
00217         g_signal_emit_by_name(accWrap->GetAtkObject(),
00218                               "selection_changed");
00219         rv = NS_OK;
00220         break;
00221 
00222     case nsIAccessibleEvent::EVENT_ATK_TEXT_CHANGE:
00223         AtkTextChange *pAtkTextChange;
00224 
00225         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TEXT_CHANGE\n"));
00226         if (!aEventData)
00227             break;
00228 
00229         pAtkTextChange = NS_REINTERPRET_CAST(AtkTextChange *, aEventData);
00230         g_signal_emit_by_name (accWrap->GetAtkObject(),
00231                                pAtkTextChange->add ? \
00232                                "text_changed::insert":"text_changed::delete",
00233                                pAtkTextChange->start,
00234                                pAtkTextChange->length);
00235         rv = NS_OK;
00236         break;
00237 
00238     case nsIAccessibleEvent::EVENT_ATK_TEXT_SELECTION_CHANGE:
00239         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TEXT_SELECTION_CHANGE\n"));
00240         g_signal_emit_by_name(accWrap->GetAtkObject(),
00241                               "text_selection_changed");
00242         rv = NS_OK;
00243         break;
00244 
00245     case nsIAccessibleEvent::EVENT_ATK_TEXT_CARET_MOVE:
00246         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TEXT_CARET_MOVE\n"));
00247         if (!aEventData)
00248             break;
00249 
00250         MAI_LOG_DEBUG(("\n\nCaret postion: %d", *(gint *)aEventData ));
00251         g_signal_emit_by_name(accWrap->GetAtkObject(),
00252                               "text_caret_moved",
00253                               // Curent caret position
00254                               *(gint *)aEventData);
00255         rv = NS_OK;
00256         break;
00257 
00258     case nsIAccessibleEvent::EVENT_ATK_TABLE_MODEL_CHANGE:
00259         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TABLE_MODEL_CHANGE\n"));
00260         g_signal_emit_by_name(accWrap->GetAtkObject(),
00261                               "model_changed");
00262         rv = NS_OK;
00263         break;
00264 
00265     case nsIAccessibleEvent::EVENT_ATK_TABLE_ROW_INSERT:
00266         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TABLE_ROW_INSERT\n"));
00267         if (!aEventData)
00268             break;
00269 
00270         pAtkTableChange = NS_REINTERPRET_CAST(AtkTableChange *, aEventData);
00271 
00272         g_signal_emit_by_name(accWrap->GetAtkObject(),
00273                               "row_inserted",
00274                               // After which the rows are inserted
00275                               pAtkTableChange->index,
00276                               // The number of the inserted
00277                               pAtkTableChange->count);
00278         rv = NS_OK;
00279         break;
00280         
00281     case nsIAccessibleEvent::EVENT_ATK_TABLE_ROW_DELETE:
00282         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TABLE_ROW_DELETE\n"));
00283         if (!aEventData)
00284             break;
00285 
00286         pAtkTableChange = NS_REINTERPRET_CAST(AtkTableChange *, aEventData);
00287 
00288         g_signal_emit_by_name(accWrap->GetAtkObject(),
00289                               "row_deleted",
00290                               // After which the rows are deleted
00291                               pAtkTableChange->index,
00292                               // The number of the deleted
00293                               pAtkTableChange->count);
00294         rv = NS_OK;
00295         break;
00296         
00297     case nsIAccessibleEvent::EVENT_ATK_TABLE_ROW_REORDER:
00298         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TABLE_ROW_REORDER\n"));
00299         g_signal_emit_by_name(accWrap->GetAtkObject(),
00300                               "row_reordered");
00301         rv = NS_OK;
00302         break;
00303 
00304     case nsIAccessibleEvent::EVENT_ATK_TABLE_COLUMN_INSERT:
00305         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TABLE_COLUMN_INSERT\n"));
00306         if (!aEventData)
00307             break;
00308 
00309         pAtkTableChange = NS_REINTERPRET_CAST(AtkTableChange *, aEventData);
00310 
00311         g_signal_emit_by_name(accWrap->GetAtkObject(),
00312                               "column_inserted",
00313                               // After which the columns are inserted
00314                               pAtkTableChange->index,
00315                               // The number of the inserted
00316                               pAtkTableChange->count);
00317         rv = NS_OK;
00318         break;
00319 
00320     case nsIAccessibleEvent::EVENT_ATK_TABLE_COLUMN_DELETE:
00321         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TABLE_COLUMN_DELETE\n"));
00322         if (!aEventData)
00323             break;
00324 
00325         pAtkTableChange = NS_REINTERPRET_CAST(AtkTableChange *, aEventData);
00326 
00327         g_signal_emit_by_name(accWrap->GetAtkObject(),
00328                               "column_deleted",
00329                               // After which the columns are deleted
00330                               pAtkTableChange->index,
00331                               // The number of the deleted
00332                               pAtkTableChange->count);
00333         rv = NS_OK;
00334         break;
00335 
00336     case nsIAccessibleEvent::EVENT_ATK_TABLE_COLUMN_REORDER:
00337         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_TABLE_COLUMN_REORDER\n"));
00338         g_signal_emit_by_name(accWrap->GetAtkObject(),
00339                               "column_reordered");
00340         rv = NS_OK;
00341         break;
00342 
00343     case nsIAccessibleEvent::EVENT_ATK_VISIBLE_DATA_CHANGE:
00344         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_VISIBLE_DATA_CHANGE\n"));
00345         g_signal_emit_by_name(accWrap->GetAtkObject(),
00346                               "visible_data_changed");
00347         rv = NS_OK;
00348         break;
00349 
00350     case nsIAccessibleEvent::EVENT_ATK_LINK_SELECTED:
00351         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_LINK_SELECTED\n"));
00352         atk_focus_tracker_notify(accWrap->GetAtkObject());
00353         g_signal_emit_by_name(accWrap->GetAtkObject(),
00354                               "link_selected",
00355                               // Selected link index 
00356                               *(gint *)aEventData);
00357         rv = NS_OK;
00358         break;
00359 
00360         // Is a superclass of ATK event children_changed
00361     case nsIAccessibleEvent::EVENT_REORDER:
00362         AtkChildrenChange *pAtkChildrenChange;
00363 
00364         MAI_LOG_DEBUG(("\n\nReceived: EVENT_REORDER(children_change)\n"));
00365 
00366         pAtkChildrenChange = NS_REINTERPRET_CAST(AtkChildrenChange *,
00367                                                  aEventData);
00368         nsAccessibleWrap *childAccWrap;
00369         if (pAtkChildrenChange && pAtkChildrenChange->child) {
00370             childAccWrap = NS_STATIC_CAST(nsAccessibleWrap *,
00371                                           pAtkChildrenChange->child);
00372             g_signal_emit_by_name (accWrap->GetAtkObject(),
00373                                    pAtkChildrenChange->add ? \
00374                                    "children_changed::add" : \
00375                                    "children_changed::remove",
00376                                    pAtkChildrenChange->index,
00377                                    childAccWrap->GetAtkObject(),
00378                                    NULL);
00379         }
00380         else {
00381             //
00382             // EVENT_REORDER is normally fired by "HTML Document".
00383             //
00384             // In GOK, [only] "children_changed::add" can cause foreground
00385             // window accessible to update it children, which will
00386             // refresh "UI-Grab" window.
00387             //
00388             g_signal_emit_by_name (accWrap->GetAtkObject(),
00389                                    "children_changed::add",
00390                                    -1, NULL, NULL);
00391         }
00392 
00393         rv = NS_OK;
00394         break;
00395 
00396         /*
00397          * Because dealing with menu is very different between nsIAccessible
00398          * and ATK, and the menu activity is important, specially transfer the
00399          * following two event.
00400          * Need more verification by AT test.
00401          */
00402     case nsIAccessibleEvent::EVENT_MENUSTART:
00403         MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENUSTART\n"));
00404         atk_focus_tracker_notify(accWrap->GetAtkObject());
00405         g_signal_emit_by_name(accWrap->GetAtkObject(),
00406                               "selection_changed");
00407         rv = NS_OK;
00408         break;
00409 
00410     case nsIAccessibleEvent::EVENT_MENUEND:
00411         MAI_LOG_DEBUG(("\n\nReceived: EVENT_MENUEND\n"));
00412         g_signal_emit_by_name(accWrap->GetAtkObject(),
00413                               "selection_changed");
00414         rv = NS_OK;
00415         break;
00416 
00417     case nsIAccessibleEvent::EVENT_ATK_WINDOW_ACTIVATE:
00418       {
00419         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_WINDOW_ACTIVATED\n"));
00420         AtkObject *accessible = accWrap->GetAtkObject();
00421         guint id = g_signal_lookup ("activate", MAI_TYPE_ATK_OBJECT);
00422         g_signal_emit(accessible, id, 0);
00423         rv = NS_OK;
00424       } break;
00425 
00426     case nsIAccessibleEvent::EVENT_ATK_WINDOW_DEACTIVATE:
00427       {
00428         MAI_LOG_DEBUG(("\n\nReceived: EVENT_ATK_WINDOW_DEACTIVATED\n"));
00429         AtkObject *accessible = accWrap->GetAtkObject();
00430         guint id = g_signal_lookup ("deactivate", MAI_TYPE_ATK_OBJECT);
00431         g_signal_emit(accessible, id, 0);
00432         rv = NS_OK;
00433       } break;
00434 
00435     default:
00436         // Don't transfer others
00437         MAI_LOG_DEBUG(("\n\nReceived an unknown event=0x%u\n", aEvent));
00438         break;
00439     }
00440 
00441     return rv;
00442 }
00443 
00444 /* static */
00445 AtkStateType
00446 TranslateAState(PRUint32 aState, PRUint32 aExtState)
00447 {
00448     switch (aState) {
00449     case nsIAccessible::STATE_SELECTED:
00450         return ATK_STATE_SELECTED;
00451     case nsIAccessible::STATE_FOCUSED:
00452         return ATK_STATE_FOCUSED;
00453     case nsIAccessible::STATE_PRESSED:
00454         return ATK_STATE_PRESSED;
00455     case nsIAccessible::STATE_CHECKED:
00456         return ATK_STATE_CHECKED;
00457     case nsIAccessible::STATE_EXPANDED:
00458         return ATK_STATE_EXPANDED;
00459     case nsIAccessible::STATE_COLLAPSED:
00460         return ATK_STATE_EXPANDABLE;
00461         // The control can't accept input at this time
00462     case nsIAccessible::STATE_BUSY:
00463         return ATK_STATE_BUSY;
00464     case nsIAccessible::STATE_FOCUSABLE:
00465         return ATK_STATE_FOCUSABLE;
00466     case nsIAccessible::STATE_SELECTABLE:
00467         return ATK_STATE_SELECTABLE;
00468     case nsIAccessible::STATE_SIZEABLE:
00469         return ATK_STATE_RESIZABLE;
00470     case nsIAccessible::STATE_MULTISELECTABLE:
00471         return ATK_STATE_MULTISELECTABLE;
00472 
00473 #if 0
00474         // The following states are opposite the MSAA states.
00475         // We need to deal with them specially
00476     case nsIAccessible::STATE_INVISIBLE:
00477         return !ATK_STATE_VISIBLE;
00478 
00479     case nsIAccessible::STATE_UNAVAILABLE:
00480         return !ATK_STATE_ENABLED;
00481 
00482     case nsIAccessible::STATE_READONLY:
00483         return !ATK_STATE_EDITABLE;
00484 #endif
00485     }
00486 
00487     // The following state is
00488     // Extended state flags (for non-MSAA, for Java and Gnome/ATK support)
00489     switch (aExtState) {
00490     case nsIAccessible::EXT_STATE_ACTIVE:
00491         return ATK_STATE_ACTIVE;
00492     case nsIAccessible::EXT_STATE_EXPANDABLE:
00493         return ATK_STATE_EXPANDABLE;
00494 #if 0
00495         // Need change definitions in nsIAccessible.idl to avoid
00496         // duplicate value
00497     case nsIAccessible::EXT_STATE_MODAL:
00498         return ATK_STATE_MODAL;
00499 #endif
00500     case nsIAccessible::EXT_STATE_MULTI_LINE:
00501         return ATK_STATE_MULTI_LINE;
00502     case nsIAccessible::EXT_STATE_SENSITIVE:
00503         return ATK_STATE_SENSITIVE;
00504     case nsIAccessible::EXT_STATE_SHOWING:
00505         return ATK_STATE_SHOWING;
00506     case nsIAccessible::EXT_STATE_SINGLE_LINE:
00507         return ATK_STATE_SINGLE_LINE;
00508     case nsIAccessible::EXT_STATE_TRANSIENT:
00509         return ATK_STATE_TRANSIENT;
00510     case nsIAccessible::EXT_STATE_VERTICAL:
00511         return ATK_STATE_VERTICAL;
00512     }
00513     return ATK_STATE_INVALID;
00514 }
00515 
00516 NS_IMETHODIMP nsDocAccessibleWrap::Shutdown()
00517 {
00518     nsAccessibleEditableText::ShutdownEditor();
00519     return nsDocAccessible::Shutdown();
00520 }
00521 
00522 NS_IMETHODIMP nsDocAccessibleWrap::GetRole(PRUint32 *_retval)
00523 {
00524     PRBool isEditable;
00525     GetIsEditable(&isEditable);
00526 
00527     if (isEditable)
00528         *_retval = ROLE_TEXT;
00529     else
00530         *_retval = ROLE_HTML_CONTAINER;
00531 
00532     return NS_OK;
00533 }
00534 
00535 void nsDocAccessibleWrap::CheckForEditor()
00536 {
00537     nsDocAccessible::CheckForEditor();
00538     if (mEditor)
00539         SetEditor(mEditor); // set editor for nsAccessibleEditableText
00540 }
00541 
00542 NS_IMETHODIMP nsDocAccessibleWrap::FireDocLoadingEvent(PRBool aIsFinished)
00543 {
00544   if (!mDocument || !mWeakShell)
00545     return NS_OK;  // Document has been shut down
00546 
00547   if (!aIsFinished) {
00548     // Load has been verified, it will occur, about to commence
00549     AtkChildrenChange childrenData;
00550     childrenData.index = -1;
00551     childrenData.child = 0;
00552     childrenData.add = PR_FALSE;
00553     FireToolkitEvent(nsIAccessibleEvent::EVENT_REORDER, this, &childrenData);
00554   }
00555 
00556   return nsDocAccessible::FireDocLoadingEvent(aIsFinished);
00557 }