Back to index

lightning-sunbird  0.9+nobinonly
nsAccessibleEventData.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Kyle Yuan (kyle.yuan@sun.com)
00024  *   John Sun (john.sun@sun.com)
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #ifndef _nsAccessibleEventData_H_
00041 #define _nsAccessibleEventData_H_
00042 
00043 #include "nsCOMPtr.h"
00044 #include "nsIAccessibleEvent.h"
00045 #include "nsIAccessible.h"
00046 #include "nsIAccessibleDocument.h"
00047 #include "nsIDOMNode.h"
00048 
00049 class nsAccessibleEventData: public nsIAccessibleEvent
00050 {
00051   public:
00052     // Initialize with an nsIAccessible
00053     nsAccessibleEventData(PRUint32 aEventType, nsIAccessible *aAccessible, 
00054                           nsIAccessibleDocument *aDocAccessible, 
00055                           void *aEventData);
00056     // Initialize with an nsIDOMNode
00057     nsAccessibleEventData(PRUint32 aEventType, nsIDOMNode *aDOMNode,
00058                           nsIAccessibleDocument *aDocAccessible,
00059                           void *aEventData);
00060     virtual ~nsAccessibleEventData() {};
00061 
00062     NS_DECL_ISUPPORTS
00063 
00064     //nsIAccessibleEvent
00065     NS_IMETHOD GetEventType(PRUint32 *aEventType) {*aEventType = mEventType; return NS_OK;}
00066     NS_IMETHOD GetAccessible(nsIAccessible **aAccessible);
00067     NS_IMETHOD GetAccessibleDocument(nsIAccessibleDocument **aDocAccessible) 
00068       {NS_ADDREF(*aDocAccessible = mDocAccessible); return NS_OK;}
00069     NS_IMETHOD GetDOMNode(nsIDOMNode **aDOMNode);
00070 
00071   private:
00072     PRUint32 mEventType;
00073     nsCOMPtr<nsIAccessible> mAccessible;
00074     nsCOMPtr<nsIDOMNode> mDOMNode;
00075     nsCOMPtr<nsIAccessibleDocument> mDocAccessible;
00076     void *mEventData;
00077 };
00078 
00079 // XXX todo: We might want to use XPCOM interfaces instead of structs
00080 //     e.g., nsAccessibleTextChangeEvent: public nsIAccessibleTextChangeEvent
00081 //           
00082 
00083 struct AtkStateChange {
00084   PRUint32 state;
00085   PRUint32 extState;
00086   PRBool   enable;
00087   AtkStateChange() {
00088     state = 0;
00089     extState = 0;
00090     enable = PR_FALSE;
00091   }
00092 };
00093 
00094 enum AtkProperty {
00095   PROP_0,           // gobject convention
00096   PROP_NAME,
00097   PROP_DESCRIPTION,
00098   PROP_PARENT,      // ancestry has changed
00099   PROP_VALUE,
00100   PROP_ROLE,
00101   PROP_LAYER,
00102   PROP_MDI_ZORDER,
00103   PROP_TABLE_CAPTION,
00104   PROP_TABLE_COLUMN_DESCRIPTION,
00105   PROP_TABLE_COLUMN_HEADER,
00106   PROP_TABLE_ROW_DESCRIPTION,
00107   PROP_TABLE_ROW_HEADER,
00108   PROP_TABLE_SUMMARY,
00109   PROP_LAST         // gobject convention
00110 };
00111 
00112 struct AtkPropertyChange {
00113   PRInt32 type;     // property type as listed above 
00114   void *oldvalue;  
00115   void *newvalue;
00116 };
00117 
00118 struct AtkChildrenChange {
00119   PRInt32      index;  // index of child in parent 
00120   nsIAccessible *child;   
00121   PRBool        add;    // true for add, false for delete
00122 };
00123 
00124 struct AtkTextChange {
00125   PRInt32  start;
00126   PRUint32 length;
00127   PRBool   add;     // true for add, false for delete
00128 };
00129 
00130 struct AtkTableChange {
00131   PRUint32 index;   // the start row/column after which the rows are inserted/deleted.
00132   PRUint32 count;   // the number of inserted/deleted rows/columns
00133 };
00134 
00135 #endif