1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 25 #ifndef _SC_ACCESSIBLEDATAPILOTCONTROL_HXX 26 #define _SC_ACCESSIBLEDATAPILOTCONTROL_HXX 27 28 #include "AccessibleContextBase.hxx" 29 30 class ScPivotFieldWindow; 31 class ScAccessibleDataPilotButton; 32 33 class ScAccessibleDataPilotControl 34 : public ScAccessibleContextBase 35 { 36 public: 37 //===== internal ======================================================== 38 ScAccessibleDataPilotControl( 39 const ::com::sun::star::uno::Reference< 40 ::com::sun::star::accessibility::XAccessible>& rxParent, 41 ScPivotFieldWindow* pFieldWindow); 42 43 virtual void Init(); 44 45 using ScAccessibleContextBase::disposing; 46 virtual void SAL_CALL disposing(); 47 48 void AddField(sal_Int32 nNewIndex); 49 void RemoveField(sal_Int32 nOldIndex); 50 void FieldFocusChange(sal_Int32 nOldIndex, sal_Int32 nNewIndex); 51 void FieldNameChange(sal_Int32 nIndex); 52 void GotFocus(); 53 void LostFocus(); 54 protected: 55 virtual ~ScAccessibleDataPilotControl(void); 56 public: 57 ///===== XAccessibleComponent ============================================ 58 59 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > 60 SAL_CALL getAccessibleAtPoint( 61 const ::com::sun::star::awt::Point& rPoint ) 62 throw (::com::sun::star::uno::RuntimeException); 63 64 virtual sal_Bool SAL_CALL isVisible( ) 65 throw (::com::sun::star::uno::RuntimeException); 66 67 virtual void SAL_CALL grabFocus( ) 68 throw (::com::sun::star::uno::RuntimeException); 69 70 virtual sal_Int32 SAL_CALL getForeground( ) 71 throw (::com::sun::star::uno::RuntimeException); 72 73 virtual sal_Int32 SAL_CALL getBackground( ) 74 throw (::com::sun::star::uno::RuntimeException); 75 76 ///===== XAccessibleContext ============================================== 77 78 /// Return the number of currently visible children. 79 virtual sal_Int32 SAL_CALL 80 getAccessibleChildCount(void) throw (::com::sun::star::uno::RuntimeException); 81 82 /// Return the specified child or NULL if index is invalid. 83 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL 84 getAccessibleChild(sal_Int32 nIndex) 85 throw (::com::sun::star::uno::RuntimeException, 86 ::com::sun::star::lang::IndexOutOfBoundsException); 87 88 /// Return the set of current states. 89 virtual ::com::sun::star::uno::Reference< 90 ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL 91 getAccessibleStateSet(void) 92 throw (::com::sun::star::uno::RuntimeException); 93 94 ///===== XServiceInfo ==================================================== 95 96 /** Returns an identifier for the implementation of this object. 97 */ 98 virtual ::rtl::OUString SAL_CALL 99 getImplementationName(void) 100 throw (::com::sun::star::uno::RuntimeException); 101 102 ///===== XTypeProvider =================================================== 103 104 /** Returns a implementation id. 105 */ 106 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL 107 getImplementationId(void) 108 throw (::com::sun::star::uno::RuntimeException); 109 110 protected: 111 /// Return this object's description. 112 virtual ::rtl::OUString SAL_CALL 113 createAccessibleDescription(void) 114 throw (::com::sun::star::uno::RuntimeException); 115 116 /// Return the object's current name. 117 virtual ::rtl::OUString SAL_CALL 118 createAccessibleName(void) 119 throw (::com::sun::star::uno::RuntimeException); 120 121 /// Return the object's current bounding box relative to the desktop. 122 virtual Rectangle GetBoundingBoxOnScreen(void) const 123 throw (::com::sun::star::uno::RuntimeException); 124 125 /// Return the object's current bounding box relative to the parent object. 126 virtual Rectangle GetBoundingBox(void) const 127 throw (::com::sun::star::uno::RuntimeException); 128 129 private: 130 ScPivotFieldWindow* mpFieldWindow; 131 struct AccessibleWeak 132 { 133 ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xWeakAcc; 134 ScAccessibleDataPilotButton* pAcc; AccessibleWeakScAccessibleDataPilotControl::AccessibleWeak135 AccessibleWeak() : pAcc(NULL) {} 136 }; 137 ::std::vector< AccessibleWeak > maChildren; 138 }; 139 140 141 #endif 142