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_ACCESSIBLECELLBASE_HXX 26 #define _SC_ACCESSIBLECELLBASE_HXX 27 28 #include "AccessibleContextBase.hxx" 29 #include "global.hxx" 30 #include "address.hxx" 31 #include <com/sun/star/accessibility/XAccessibleValue.hpp> 32 #include <cppuhelper/implbase1.hxx> 33 34 class ScTabViewShell; 35 36 typedef cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleValue> 37 ScAccessibleCellBaseImpl; 38 39 class ScAccessibleCellBase 40 : public ScAccessibleContextBase, 41 public ScAccessibleCellBaseImpl 42 { 43 public: 44 //===== internal ======================================================== 45 ScAccessibleCellBase( 46 const ::com::sun::star::uno::Reference< 47 ::com::sun::star::accessibility::XAccessible>& rxParent, 48 ScDocument* pDoc, 49 const ScAddress& rCellAddress, 50 sal_Int32 nIndex); 51 protected: 52 virtual ~ScAccessibleCellBase(); 53 public: 54 55 ///===== XInterface ===================================================== 56 57 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 58 ::com::sun::star::uno::Type const & rType ) 59 throw (::com::sun::star::uno::RuntimeException); 60 61 virtual void SAL_CALL acquire() throw (); 62 63 virtual void SAL_CALL release() throw (); 64 65 ///===== XAccessibleComponent ============================================ 66 67 virtual sal_Bool SAL_CALL isVisible( ) 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 this objects index among the parents children. 79 virtual sal_Int32 SAL_CALL 80 getAccessibleIndexInParent(void) 81 throw (::com::sun::star::uno::RuntimeException); 82 83 protected: 84 /// Return this object's description. 85 virtual ::rtl::OUString SAL_CALL 86 createAccessibleDescription(void) 87 throw (::com::sun::star::uno::RuntimeException); 88 89 /// Return the object's current name. 90 virtual ::rtl::OUString SAL_CALL 91 createAccessibleName(void) 92 throw (::com::sun::star::uno::RuntimeException); 93 94 public: 95 ///===== XAccessibleValue ================================================ 96 97 virtual ::com::sun::star::uno::Any SAL_CALL 98 getCurrentValue( ) 99 throw (::com::sun::star::uno::RuntimeException); 100 101 virtual sal_Bool SAL_CALL 102 setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) 103 throw (::com::sun::star::uno::RuntimeException); 104 105 virtual ::com::sun::star::uno::Any SAL_CALL 106 getMaximumValue( ) 107 throw (::com::sun::star::uno::RuntimeException); 108 109 virtual ::com::sun::star::uno::Any SAL_CALL 110 getMinimumValue( ) 111 throw (::com::sun::star::uno::RuntimeException); 112 113 ///===== XServiceInfo ==================================================== 114 115 /** Returns an identifier for the implementation of this object. 116 */ 117 virtual ::rtl::OUString SAL_CALL 118 getImplementationName(void) 119 throw (::com::sun::star::uno::RuntimeException); 120 121 ///===== XTypeProvider =================================================== 122 123 /// returns the possible types 124 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL 125 getTypes() 126 throw (::com::sun::star::uno::RuntimeException); 127 128 /** Returns a implementation id. 129 */ 130 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL 131 getImplementationId(void) 132 throw (::com::sun::star::uno::RuntimeException); 133 134 protected: 135 ScAddress maCellAddress; 136 137 ScDocument* mpDoc; 138 139 sal_Int32 mnIndex; 140 141 private: 142 virtual sal_Bool IsEditable( 143 const com::sun::star::uno::Reference< 144 ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); 145 protected: 146 virtual ::rtl::OUString SAL_CALL GetNote(void) 147 throw (::com::sun::star::uno::RuntimeException); 148 149 virtual ::rtl::OUString SAL_CALL GetAllDisplayNote(void) 150 throw (::com::sun::star::uno::RuntimeException); 151 virtual ::rtl::OUString SAL_CALL getShadowAttrs(void) 152 throw (::com::sun::star::uno::RuntimeException); 153 virtual ::rtl::OUString SAL_CALL getBorderAttrs(void) 154 throw (::com::sun::star::uno::RuntimeException); 155 public: GetCellAddress() const156 const ScAddress& GetCellAddress() const { return maCellAddress; } 157 sal_Bool IsCellInChangeTrack(const ScAddress &cell,Color *pColCellBoder); 158 }; 159 160 161 162 #endif 163