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 60 virtual void SAL_CALL acquire() throw (); 61 62 virtual void SAL_CALL release() throw (); 63 64 ///===== XAccessibleComponent ============================================ 65 66 virtual sal_Bool SAL_CALL isVisible( ); 67 68 virtual sal_Int32 SAL_CALL getForeground( ); 69 70 virtual sal_Int32 SAL_CALL getBackground( ); 71 72 ///===== XAccessibleContext ============================================== 73 74 /// Return this objects index among the parents children. 75 virtual sal_Int32 SAL_CALL 76 getAccessibleIndexInParent(void); 77 78 protected: 79 /// Return this object's description. 80 virtual ::rtl::OUString SAL_CALL 81 createAccessibleDescription(void); 82 83 /// Return the object's current name. 84 virtual ::rtl::OUString SAL_CALL 85 createAccessibleName(void); 86 87 public: 88 ///===== XAccessibleValue ================================================ 89 90 virtual ::com::sun::star::uno::Any SAL_CALL 91 getCurrentValue( ); 92 93 virtual sal_Bool SAL_CALL 94 setCurrentValue( const ::com::sun::star::uno::Any& aNumber ); 95 96 virtual ::com::sun::star::uno::Any SAL_CALL 97 getMaximumValue( ); 98 99 virtual ::com::sun::star::uno::Any SAL_CALL 100 getMinimumValue( ); 101 102 ///===== XServiceInfo ==================================================== 103 104 /** Returns an identifier for the implementation of this object. 105 */ 106 virtual ::rtl::OUString SAL_CALL 107 getImplementationName(void); 108 109 ///===== XTypeProvider =================================================== 110 111 /// returns the possible types 112 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL 113 getTypes(); 114 115 /** Returns a implementation id. 116 */ 117 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL 118 getImplementationId(void); 119 120 protected: 121 ScAddress maCellAddress; 122 123 ScDocument* mpDoc; 124 125 sal_Int32 mnIndex; 126 127 private: 128 virtual sal_Bool IsEditable( 129 const com::sun::star::uno::Reference< 130 ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); 131 protected: 132 virtual ::rtl::OUString SAL_CALL GetNote(void); 133 134 virtual ::rtl::OUString SAL_CALL GetAllDisplayNote(void); 135 virtual ::rtl::OUString SAL_CALL getShadowAttrs(void); 136 virtual ::rtl::OUString SAL_CALL getBorderAttrs(void); 137 public: GetCellAddress() const138 const ScAddress& GetCellAddress() const { return maCellAddress; } 139 sal_Bool IsCellInChangeTrack(const ScAddress &cell,Color *pColCellBoder); 140 }; 141 142 143 144 #endif 145