diff options
author | Sascha Ballach <sab@openoffice.org> | 2002-03-01 07:38:25 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2002-03-01 07:38:25 +0000 |
commit | 26073ba87d90c97cdd49eb64b588c0091d54738d (patch) | |
tree | 4ef6bf420a3c378e836a5ee8539bb25995169563 /sc/source/ui | |
parent | 6384399612b8ac71fdbfeed00e3a1d4caabc1987 (diff) |
#95584#; add XAccessibleText support; copy getImplementationId method
Diffstat (limited to 'sc/source/ui')
20 files changed, 744 insertions, 136 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index d4837ae68225..5866f92f04f8 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleCell.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: sab $ $Date: 2002-02-25 13:27:43 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,6 +61,9 @@ #include "AccessibleCell.hxx" +#ifndef _SC_ACCESSIBLETEXT_HXX +#include "AccessibleText.hxx" +#endif #ifndef SC_TABVWSH_HXX #include "tabvwsh.hxx" #endif @@ -79,6 +82,9 @@ #ifndef SC_UNOGUARD_HXX #include "unoguard.hxx" #endif +#ifndef SC_EDITSRC_HXX +#include "editsrc.hxx" +#endif #ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX #include <unotools/accessiblestatesethelper.hxx> @@ -99,6 +105,9 @@ #ifndef _SVX_BRSHITEM_HXX #include <svx/brshitem.hxx> #endif +#ifndef _SVX_UNOEDACC_HXX_ +#include <svx/unoedacc.hxx> +#endif #include <float.h> @@ -116,12 +125,15 @@ ScAccessibleCell::ScAccessibleCell( : ScAccessibleCellBase(rxParent, GetDocument(pViewShell), rCellAddress, nIndex), mpViewShell(pViewShell), - meSplitPos(eSplitPos) + meSplitPos(eSplitPos), + mpTextHelper(NULL) { } ScAccessibleCell::~ScAccessibleCell() { + if (mpTextHelper) + delete mpTextHelper; } //===== XAccessibleComponent ============================================ @@ -130,32 +142,17 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleCell::getAccessibleAt( const awt::Point& rPoint ) throw (uno::RuntimeException) { - uno::Reference< XAccessible > xAccessible = NULL; - // should be implemented in the Accessible Text helper - return xAccessible; -} + ScUnoGuard aGuard; + if(!mpTextHelper) + CreateTextHelper(); -sal_Bool SAL_CALL ScAccessibleCell::isVisible( ) - throw (uno::RuntimeException) -{ - ScUnoGuard aGuard(); - // test whether the cell is hidden (column/row - hidden/filtered) - sal_Bool bVisible(sal_True); - if (mpDoc) - { - BYTE nColFlags = mpDoc->GetColFlags(maCellAddress.Col(), maCellAddress.Tab()); - BYTE nRowFlags = mpDoc->GetRowFlags(maCellAddress.Row(), maCellAddress.Tab()); - if (((nColFlags & CR_HIDDEN) == CR_HIDDEN) || ((nColFlags & CR_FILTERED) == CR_FILTERED) || - ((nRowFlags & CR_HIDDEN) == CR_HIDDEN) || ((nRowFlags & CR_FILTERED) == CR_FILTERED)) - bVisible = sal_False; - } - return bVisible; + return mpTextHelper->GetAt(rPoint); } void SAL_CALL ScAccessibleCell::grabFocus( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (getAccessibleParent().is() && mpViewShell) { uno::Reference<XAccessibleComponent> xAccessibleComponent(getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY); @@ -205,9 +202,10 @@ sal_Int32 SAL_CALL ScAccessibleCell::getAccessibleChildCount(void) throw (uno::RuntimeException) { - sal_Int32 nCount(0); - // should call the Helper class of Thorsten Behrens to get the child count - return nCount; + ScUnoGuard aGuard; + if (!mpTextHelper) + CreateTextHelper(); + return mpTextHelper->GetChildCount(); } uno::Reference< XAccessible > SAL_CALL @@ -215,15 +213,18 @@ uno::Reference< XAccessible > SAL_CALL throw (uno::RuntimeException, lang::IndexOutOfBoundsException) { - DBG_ERROR("not implemented yet"); - return uno::Reference< XAccessible >(); + ScUnoGuard aGuard; + if (!mpTextHelper) + CreateTextHelper(); + return mpTextHelper->GetChild(nIndex); +// return uno::Reference< XAccessible >(); } uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleCell::getAccessibleStateSet(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Reference<XAccessibleStateSet> xParentStates; if (getAccessibleParent().is()) { @@ -276,6 +277,22 @@ uno::Sequence< ::rtl::OUString> SAL_CALL return aSequence; } +//===== XTypeProvider ======================================================= + +uno::Sequence<sal_Int8> SAL_CALL + ScAccessibleCell::getImplementationId(void) + throw (uno::RuntimeException) +{ + ScUnoGuard aGuard; + static uno::Sequence<sal_Int8> aId; + if (aId.getLength() == 0) + { + aId.realloc (16); + rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True); + } + return aId; +} + //==== internal ========================================================= sal_Bool ScAccessibleCell::IsDefunc( @@ -311,7 +328,7 @@ sal_Bool ScAccessibleCell::IsOpaque( { const SvxBrushItem* pItem = (const SvxBrushItem*)mpDoc->GetAttr( maCellAddress.Col(), maCellAddress.Row(), - maCellAddress.Tab(), ATTR_PROTECTION); + maCellAddress.Tab(), ATTR_BACKGROUND); if (pItem) bOpaque = pItem->GetColor() != COL_TRANSPARENT; } @@ -331,3 +348,14 @@ ScDocument* ScAccessibleCell::GetDocument(ScTabViewShell* pViewShell) return pDoc; } +void ScAccessibleCell::CreateTextHelper() +{ + if (!mpTextHelper) + { + ::std::auto_ptr < ScAccessibleCellTextData > pAccessibleCellTextData + (new ScAccessibleCellTextData(mpViewShell, maCellAddress, meSplitPos)); + ::std::auto_ptr< SvxEditSource > pEditSource (new ScAccessibilityEditSource(pAccessibleCellTextData)); + + mpTextHelper = new SvxAccessibleTextHelper(this, pEditSource ); + } +} diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx index 7c6d22405e0e..65322e8c3ecf 100644 --- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleCellBase.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: sab $ $Date: 2002-02-25 13:27:43 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,9 @@ #ifndef _SVX_BRSHITEM_HXX #include <svx/brshitem.hxx> #endif +#ifndef _RTL_UUID_H_ +#include <rtl/uuid.h> +#endif #include <float.h> @@ -107,7 +110,7 @@ using namespace ::drafts::com::sun::star::accessibility; ScAccessibleCellBase::ScAccessibleCellBase( const uno::Reference<XAccessible>& rxParent, ScDocument* pDoc, - ScAddress& rCellAddress, + const ScAddress& rCellAddress, sal_Int32 nIndex) : ScAccessibleContextBase(rxParent, AccessibleRole::TABLE_CELL), @@ -156,7 +159,7 @@ void SAL_CALL sal_Bool SAL_CALL ScAccessibleCellBase::isVisible( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; // test whether the cell is hidden (column/row - hidden/filtered) sal_Bool bVisible(sal_True); if (mpDoc) @@ -176,10 +179,17 @@ sal_Int32 ScAccessibleCellBase::getAccessibleIndexInParent(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; return mnIndex; } +lang::Locale SAL_CALL getLocale(void) + throw (uno::RuntimeException, IllegalAccessibleComponentStateException) +{ + lang::Locale aLocale; + return aLocale; +} + ::rtl::OUString SAL_CALL ScAccessibleCellBase::createAccessibleDescription(void) throw (uno::RuntimeException) @@ -217,7 +227,7 @@ uno::Any SAL_CALL ScAccessibleCellBase::getCurrentValue( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Any aAny; if (mpDoc) aAny <<= mpDoc->GetValue(maCellAddress); @@ -229,7 +239,7 @@ sal_Bool SAL_CALL ScAccessibleCellBase::setCurrentValue( const uno::Any& aNumber ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; double fValue; sal_Bool bResult(sal_False); if((aNumber >>= fValue) && mpDoc && mpDoc->GetDocumentShell()) @@ -283,7 +293,7 @@ uno::Any SAL_CALL uno::Sequence< uno::Type> SAL_CALL ScAccessibleCellBase::getTypes(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Sequence< uno::Type> aTypeSequence = ScAccessibleContextBase::getTypes(); sal_Int32 nOldSize(aTypeSequence.getLength()); @@ -296,6 +306,19 @@ uno::Sequence< uno::Type> SAL_CALL ScAccessibleCellBase::getTypes(void) return aTypeSequence; } +uno::Sequence<sal_Int8> SAL_CALL + ScAccessibleCellBase::getImplementationId(void) + throw (uno::RuntimeException) +{ + ScUnoGuard aGuard; + static uno::Sequence<sal_Int8> aId; + if (aId.getLength() == 0) + { + aId.realloc (16); + rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True); + } + return aId; +} sal_Bool ScAccessibleCellBase::IsEditable( const uno::Reference<XAccessibleStateSet>& rxParentStates) diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 2cd1bc003568..557efb2b89cf 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleContextBase.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: sab $ $Date: 2002-02-25 13:27:43 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -118,6 +118,15 @@ ScAccessibleContextBase::ScAccessibleContextBase( ScAccessibleContextBase::~ScAccessibleContextBase(void) { +} + +void ScAccessibleContextBase::SetDefunc() +{ + CommitDefunc(); + + // hold reference to make sure that the destructor is not called + uno::Reference< XAccessibleContext > xOwnContext(this); + if (mpEventListeners || mpFocusListeners) { lang::EventObject aEvent; @@ -125,25 +134,14 @@ ScAccessibleContextBase::~ScAccessibleContextBase(void) if (mpEventListeners) { mpEventListeners->disposeAndClear(aEvent); - delete mpEventListeners; + DELETEZ( mpEventListeners ); } if (mpFocusListeners) { mpFocusListeners->disposeAndClear(aEvent); - delete mpFocusListeners; + DELETEZ( mpFocusListeners ); } } - if (mxParent.is()) - { - uno::Reference< XAccessibleEventBroadcaster > xBroadcaster (mxParent->getAccessibleContext(), uno::UNO_QUERY); - if (xBroadcaster.is()) - xBroadcaster->removeEventListener(this); - } -} - -void ScAccessibleContextBase::SetDefunc() -{ - CommitDefunc(); if (mxParent.is()) { @@ -174,7 +172,7 @@ uno::Reference< XAccessibleContext> SAL_CALL sal_Bool SAL_CALL ScAccessibleContextBase::contains(const awt::Point& rPoint ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; Rectangle aBounds(GetBoundingBox()); return !((rPoint.X < aBounds.getX()) || (rPoint.X > (aBounds.getX() + aBounds.getWidth())) || (rPoint.Y < aBounds.getY()) || (rPoint.Y > (aBounds.getY() + aBounds.getHeight()))); @@ -191,7 +189,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleContextBase::getAccessibleAt( awt::Rectangle SAL_CALL ScAccessibleContextBase::getBounds( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; Rectangle aCoreBounds(GetBoundingBox()); awt::Rectangle aBounds; aBounds.X = aCoreBounds.getX(); @@ -204,7 +202,7 @@ awt::Rectangle SAL_CALL ScAccessibleContextBase::getBounds( ) awt::Point SAL_CALL ScAccessibleContextBase::getLocation( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; awt::Point aLocation; Rectangle aRect(GetBoundingBox()); aLocation.X = aRect.getX(); @@ -215,7 +213,7 @@ awt::Point SAL_CALL ScAccessibleContextBase::getLocation( ) awt::Point SAL_CALL ScAccessibleContextBase::getLocationOnScreen( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; awt::Point aPoint; Rectangle aRect(GetBoundingBoxOnScreen()); aPoint.X = aRect.getX(); @@ -226,7 +224,7 @@ awt::Point SAL_CALL ScAccessibleContextBase::getLocationOnScreen( ) awt::Size SAL_CALL ScAccessibleContextBase::getSize( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; awt::Size aSize; Rectangle aRect(GetBoundingBox()); aSize.Width = aRect.getWidth(); @@ -237,7 +235,7 @@ awt::Size SAL_CALL ScAccessibleContextBase::getSize( ) sal_Bool SAL_CALL ScAccessibleContextBase::isShowing( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Bool bShowing(sal_False); uno::Reference<XAccessibleComponent> xParentComponent (mxParent->getAccessibleContext(), uno::UNO_QUERY); if (xParentComponent.is()) @@ -269,7 +267,7 @@ void SAL_CALL ScAccessibleContextBase::addFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (xListener.is()) { if (!mpFocusListeners) @@ -282,7 +280,7 @@ void SAL_CALL ScAccessibleContextBase::removeFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (xListener.is() && mpFocusListeners) mpFocusListeners->removeInterface(xListener); } @@ -329,7 +327,7 @@ sal_Int32 SAL_CALL ScAccessibleContextBase::getAccessibleIndexInParent(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; // Use a simple but slow solution for now. Optimize later. // Return -1 to indicate that this object's parent does not know about the // object. @@ -370,7 +368,7 @@ sal_Int16 SAL_CALL ScAccessibleContextBase::getAccessibleDescription(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (!msDescription.getLength()) { OUString sDescription(createAccessibleDescription()); @@ -392,7 +390,7 @@ OUString SAL_CALL ScAccessibleContextBase::getAccessibleName(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (!msName.getLength()) { OUString sName(createAccessibleName()); @@ -429,7 +427,7 @@ lang::Locale SAL_CALL throw (IllegalAccessibleComponentStateException, uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (mxParent.is()) { uno::Reference<XAccessibleContext> xParentContext ( @@ -450,7 +448,7 @@ void SAL_CALL const uno::Reference<XAccessibleEventListener>& xListener) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (xListener.is()) { if (!mpEventListeners) @@ -464,7 +462,7 @@ void SAL_CALL const uno::Reference<XAccessibleEventListener>& xListener) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (xListener.is() && mpEventListeners) mpEventListeners->removeInterface(xListener); } @@ -554,7 +552,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleContextBase::getImplementationId(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; static uno::Sequence<sal_Int8> aId; if (aId.getLength() == 0) { diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 94720ae2b25a..c550111f1185 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleDocument.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: sab $ $Date: 2002-02-25 13:27:43 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -201,7 +201,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocument::getAccessibleAt( const awt::Point& rPoint ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Reference<XAccessible> xAccessible = NULL; SdrPage* pDrawPage = GetDrawPage(); if (pDrawPage) @@ -216,7 +216,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDocument::getAccessibleAt( void SAL_CALL ScAccessibleDocument::grabFocus( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; if (getAccessibleParent().is()) { uno::Reference<XAccessibleComponent> xAccessibleComponent(getAccessibleParent()->getAccessibleContext(), uno::UNO_QUERY); @@ -241,7 +241,7 @@ long SAL_CALL ScAccessibleDocument::getAccessibleChildCount(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Int32 nShapes (0); SdrPage* pDrawPage = GetDrawPage(); if (pDrawPage) @@ -263,7 +263,7 @@ uno::Reference<XAccessible> SAL_CALL throw (uno::RuntimeException, lang::IndexOutOfBoundsException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Reference<XAccessible> xAccessible;// = GetChild(nIndex); if (!xAccessible.is()) { @@ -286,7 +286,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDocument::getAccessibleStateSet(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Reference<XAccessibleStateSet> xParentStates; if (getAccessibleParent().is()) { @@ -330,6 +330,22 @@ uno::Sequence< ::rtl::OUString> SAL_CALL return aSequence; } +//===== XTypeProvider ======================================================= + +uno::Sequence<sal_Int8> SAL_CALL + ScAccessibleDocument::getImplementationId(void) + throw (uno::RuntimeException) +{ + ScUnoGuard aGuard; + static uno::Sequence<sal_Int8> aId; + if (aId.getLength() == 0) + { + aId.realloc (16); + rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True); + } + return aId; +} + //===== internal ======================================================== ::rtl::OUString SAL_CALL @@ -343,7 +359,7 @@ uno::Sequence< ::rtl::OUString> SAL_CALL ScAccessibleDocument::createAccessibleName(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; rtl::OUString sName(RTL_CONSTASCII_USTRINGPARAM ("Spreadsheet Document View ")); sal_Int32 nNumber(sal_Int32(meSplitPos) + 1); sName += rtl::OUString::valueOf(nNumber); diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 47d7062c46be..30ecb9556958 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleDocumentPagePreview.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: nn $ $Date: 2002-02-27 19:41:47 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -302,6 +302,22 @@ uno::Sequence< ::rtl::OUString> SAL_CALL ScAccessibleDocumentPagePreview::getSup return aSequence; } +//===== XTypeProvider ======================================================= + +uno::Sequence<sal_Int8> SAL_CALL + ScAccessibleDocumentPagePreview::getImplementationId(void) + throw (uno::RuntimeException) +{ + ScUnoGuard aGuard; + static uno::Sequence<sal_Int8> aId; + if (aId.getLength() == 0) + { + aId.realloc (16); + rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True); + } + return aId; +} + //===== internal ======================================================== ::rtl::OUString SAL_CALL ScAccessibleDocumentPagePreview::createAccessibleDescription(void) diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index 3d29a4dcbfd3..6982f2678ce1 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePreviewCell.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: nn $ $Date: 2002-02-27 19:41:47 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -177,6 +177,22 @@ uno::Sequence<rtl::OUString> SAL_CALL ScAccessiblePreviewCell::getSupportedServi return aSequence; } +//===== XTypeProvider ======================================================= + +uno::Sequence<sal_Int8> SAL_CALL + ScAccessiblePreviewCell::getImplementationId(void) + throw (uno::RuntimeException) +{ + ScUnoGuard aGuard; + static uno::Sequence<sal_Int8> aId; + if (aId.getLength() == 0) + { + aId.realloc (16); + rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True); + } + return aId; +} + //==== internal ========================================================= Rectangle ScAccessiblePreviewCell::GetBoundingBoxOnScreen() throw (uno::RuntimeException) diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index f47b4efa3258..4b2c90481d0d 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePreviewHeaderCell.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: nn $ $Date: 2002-02-28 19:34:29 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -264,6 +264,22 @@ uno::Sequence<rtl::OUString> SAL_CALL ScAccessiblePreviewHeaderCell::getSupporte return aSequence; } +//===== XTypeProvider ======================================================= + +uno::Sequence<sal_Int8> SAL_CALL + ScAccessiblePreviewHeaderCell::getImplementationId(void) + throw (uno::RuntimeException) +{ + ScUnoGuard aGuard; + static uno::Sequence<sal_Int8> aId; + if (aId.getLength() == 0) + { + aId.realloc (16); + rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True); + } + return aId; +} + //==== internal ========================================================= Rectangle ScAccessiblePreviewHeaderCell::GetBoundingBoxOnScreen() throw (uno::RuntimeException) diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index 0af639ab1cae..37f7ebdb8ecc 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleSpreadsheet.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sab $ $Date: 2002-02-25 13:27:43 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -167,7 +167,7 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& rBC, const SfxHint& rHint uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessibleRows( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Sequence<sal_Int32> aSequence; if (mpViewShell && mpViewShell->GetViewData()) { @@ -193,7 +193,7 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessib uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessibleColumns( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Sequence<sal_Int32> aSequence; if (mpViewShell && mpViewShell->GetViewData()) { @@ -219,7 +219,7 @@ uno::Sequence< sal_Int32 > SAL_CALL ScAccessibleSpreadsheet::getSelectedAccessib sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleRowSelected( sal_Int32 nRow ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Bool bResult(sal_False); if (mpViewShell && mpViewShell->GetViewData()) { @@ -232,7 +232,7 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleRowSelected( sal_Int32 nR sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleColumnSelected( sal_Int32 nColumn ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Bool bResult(sal_False); if (mpViewShell && mpViewShell->GetViewData()) { @@ -245,7 +245,7 @@ sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleColumnSelected( sal_Int32 uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; ScAddress aCellAddress(static_cast<sal_uInt16>(maRange.aStart.Col() + nColumn), static_cast<sal_uInt16>(maRange.aStart.Row() + nRow), maRange.aStart.Tab()); ScAccessibleCell* pAccessibleCell = new ScAccessibleCell(this, mpViewShell, aCellAddress, getAccessibleIndex(nRow, nColumn), meSplitPos); @@ -255,7 +255,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleCel sal_Bool SAL_CALL ScAccessibleSpreadsheet::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Bool bResult(sal_False); if (mpViewShell && mpViewShell->GetViewData()) { @@ -271,7 +271,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleSpreadsheet::getAccessibleAt( const awt::Point& rPoint ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Reference< XAccessible > xAccessible; if (mpViewShell) { @@ -299,7 +299,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleSpreadsheet::getAccessibleStateSet(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Reference<XAccessibleStateSet> xParentStates; if (getAccessibleParent().is()) { @@ -346,6 +346,22 @@ uno::Sequence< ::rtl::OUString> SAL_CALL return aSequence; } +//===== XTypeProvider ======================================================= + +uno::Sequence<sal_Int8> SAL_CALL + ScAccessibleSpreadsheet::getImplementationId(void) + throw (uno::RuntimeException) +{ + ScUnoGuard aGuard; + static uno::Sequence<sal_Int8> aId; + if (aId.getLength() == 0) + { + aId.realloc (16); + rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True); + } + return aId; +} + //==== internal ========================================================= Rectangle ScAccessibleSpreadsheet::GetBoundingBoxOnScreen() diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx index c1a94f13857a..faba377867dc 100644 --- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleTableBase.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: sab $ $Date: 2002-02-25 13:27:43 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -145,14 +145,14 @@ void SAL_CALL sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRowCount( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; return maRange.aEnd.Row() - maRange.aStart.Row() + 1; } sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnCount( ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; return maRange.aEnd.Col() - maRange.aStart.Col() + 1; } @@ -175,7 +175,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnCount( ) sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Int32 nCount(1); // the same cell nRow += maRange.aStart.Row(); nColumn += maRange.aStart.Col(); @@ -195,7 +195,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRowExtentAt( sal_Int32 nR sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Int32 nCount(1); // the same cell nRow += maRange.aStart.Row(); nColumn += maRange.aStart.Col(); @@ -296,7 +296,7 @@ sal_Bool SAL_CALL ScAccessibleTableBase::isAccessibleSelected( sal_Int32 nRow, s sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; nRow -= maRange.aStart.Row(); nColumn -= maRange.aStart.Col(); return (nRow * maRange.aEnd.Col() + 1) + nColumn; @@ -305,7 +305,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleIndex( sal_Int32 nRow, sa sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRow( sal_Int32 nChildIndex ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Int32 nRow(-1); if (maRange.aEnd.Col() > 0) nRow = nChildIndex / (maRange.aEnd.Col() - maRange.aStart.Col() + 1); @@ -315,7 +315,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRow( sal_Int32 nChildInde sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumn( sal_Int32 nChildIndex ) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Int32 nColumn(-1); if (maRange.aEnd.Col() > 0) nColumn = nChildIndex % (maRange.aEnd.Col() - maRange.aStart.Col() + 1); @@ -328,7 +328,7 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleChildCount(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; /* return (maRange.aEnd.Row() - maRange.aStart.Row() + 1) * (maRange.aEnd.Col() - maRange.aStart.Col() + 1);*/ return 1; @@ -339,15 +339,12 @@ uno::Reference< XAccessible > SAL_CALL throw (uno::RuntimeException, lang::IndexOutOfBoundsException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; sal_Int32 nRow(0); sal_Int32 nColumn(0); - if (maRange.aEnd.Col() > 0) - { - sal_Int32 nTemp(maRange.aEnd.Col() - maRange.aStart.Col() + 1); - nRow = nIndex / nTemp; - nColumn = nIndex % nTemp; - } + sal_Int32 nTemp(maRange.aEnd.Col() - maRange.aStart.Col() + 1); + nRow = nIndex / nTemp; + nColumn = nIndex % nTemp; return getAccessibleCellAt(nRow, nColumn); } @@ -362,7 +359,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleTableBase::createAccessibleName(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; rtl::OUString sName; String sCoreName; if (mpDoc && mpDoc->GetName( maRange.aStart.Tab(), sCoreName )) @@ -400,7 +397,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL uno::Sequence< uno::Type> SAL_CALL ScAccessibleTableBase::getTypes(void) throw (uno::RuntimeException) { - ScUnoGuard aGuard(); + ScUnoGuard aGuard; uno::Sequence< uno::Type> aTypeSequence = ScAccessibleContextBase::getTypes(); sal_Int32 nOldSize(aTypeSequence.getLength()); @@ -412,3 +409,18 @@ uno::Sequence< uno::Type> SAL_CALL ScAccessibleTableBase::getTypes(void) return aTypeSequence; } + +uno::Sequence<sal_Int8> SAL_CALL + ScAccessibleTableBase::getImplementationId(void) + throw (uno::RuntimeException) +{ + ScUnoGuard aGuard; + static uno::Sequence<sal_Int8> aId; + if (aId.getLength() == 0) + { + aId.realloc (16); + rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True); + } + return aId; +} + diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx new file mode 100644 index 000000000000..766575c6bc1e --- /dev/null +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -0,0 +1,292 @@ +/************************************************************************* + * + * $RCSfile: AccessibleText.cxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "AccessibleText.hxx" +#ifndef SC_TABVWSH_HXX +#include "tabvwsh.hxx" +#endif +#ifndef SC_EDITUTIL_HXX +#include "editutil.hxx" +#endif +#ifndef SC_DOCUMENT_HXX +#include "document.hxx" +#endif + +#ifndef _SVX_UNOFORED_HXX +#include <svx/unofored.hxx> +#endif +#ifndef _MyEDITVIEW_HXX +#include <svx/editview.hxx> +#endif + +class ScViewForwarder : public SvxViewForwarder +{ + ScTabViewShell* mpViewShell; + ScSplitPos meSplitPos; +public: + ScViewForwarder(ScTabViewShell* pViewShell, ScSplitPos eSplitPos); + virtual ~ScViewForwarder(); + + virtual BOOL IsValid() const; + virtual Rectangle GetVisArea() const; + virtual Point LogicToPixel( const Point& rPoint ) const; + virtual Point PixelToLogic( const Point& rPoint ) const; +}; + +ScViewForwarder::ScViewForwarder(ScTabViewShell* pViewShell, ScSplitPos eSplitPos) + : + mpViewShell(pViewShell), + meSplitPos(eSplitPos) +{ +} + +ScViewForwarder::~ScViewForwarder() +{ +} + +BOOL ScViewForwarder::IsValid() const +{ + return mpViewShell != NULL; +} + +Rectangle ScViewForwarder::GetVisArea() const +{ + Rectangle aVisArea; + if (mpViewShell) + { + Window* pWindow = mpViewShell->GetWindowByPos(meSplitPos); + if (pWindow) + aVisArea.SetSize(pWindow->GetSizePixel()); + if(mpViewShell->GetViewData()) + aVisArea.SetPos(Point(mpViewShell->GetViewData()->GetPixPos(meSplitPos))); + } + return aVisArea; +} + +Point ScViewForwarder::LogicToPixel( const Point& rPoint ) const +{ + return rPoint; +} + +Point ScViewForwarder::PixelToLogic( const Point& rPoint ) const +{ + MapMode aMapMode(MAP_100TH_MM); + Point aPoint(rPoint); + if (mpViewShell) + { + Window* pWindow = mpViewShell->GetWindowByPos(meSplitPos); + if (pWindow) + aPoint = pWindow->PixelToLogic( rPoint, aMapMode ); + } + return rPoint; +} + +class ScEditViewForwarder : public SvxEditViewForwarder +{ +public: + ScEditViewForwarder(); + virtual ~ScEditViewForwarder(); + + virtual BOOL IsValid() const; + virtual Rectangle GetVisArea() const; + virtual Point LogicToPixel( const Point& rPoint ) const; + virtual Point PixelToLogic( const Point& rPoint ) const; + virtual sal_Bool GetSelection( ESelection& rSelection ) const; + virtual sal_Bool SetSelection( const ESelection& rSelection ); + virtual sal_Bool Copy(); + virtual sal_Bool Cut(); + virtual sal_Bool Paste(); +}; + +ScEditViewForwarder::ScEditViewForwarder() +{ +} + +ScEditViewForwarder::~ScEditViewForwarder() +{ +} + +BOOL ScEditViewForwarder::IsValid() const +{ + return sal_False; +} + +Rectangle ScEditViewForwarder::GetVisArea() const +{ + Rectangle aVisArea; + return aVisArea; +} + +Point ScEditViewForwarder::LogicToPixel( const Point& rPoint ) const +{ + return rPoint; +} + +Point ScEditViewForwarder::PixelToLogic( const Point& rPoint ) const +{ + return rPoint; +} + +sal_Bool ScEditViewForwarder::GetSelection( ESelection& rSelection ) const +{ + return sal_False; +} + +sal_Bool ScEditViewForwarder::SetSelection( const ESelection& rSelection ) +{ + return sal_False; +} + +sal_Bool ScEditViewForwarder::Copy() +{ + return sal_False; +} + +sal_Bool ScEditViewForwarder::Cut() +{ + return sal_False; +} + +sal_Bool ScEditViewForwarder::Paste() +{ + return sal_False; +} + +// ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object + +ScAccessibleCellTextData::ScAccessibleCellTextData(ScTabViewShell* pViewShell, + const ScAddress& rP, ScSplitPos eSplitPos) + : ScCellTextData(GetDocShell(pViewShell), rP), + mpViewShell(pViewShell), + meSplitPos(eSplitPos), + mpViewForwarder(NULL) +{ +} + +ScAccessibleCellTextData::~ScAccessibleCellTextData() +{ + if (mpViewForwarder) + delete mpViewForwarder; +} + +void ScAccessibleCellTextData::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) +{ + if ( rHint.ISA( SfxSimpleHint ) ) + { + ULONG nId = ((const SfxSimpleHint&)rHint).GetId(); + if ( nId == SFX_HINT_DYING ) + { + mpViewShell = NULL; // invalid now + } + } + ScCellTextData::Notify(rBC, rHint); +} + +SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder() +{ + SvxEditEngineForwarder* pTempForwarder = NULL; + if (mpViewShell && mpViewShell->GetViewData() && + (mpViewShell->GetViewData()->GetCurPos() == aCellPos) && + (mpViewShell->GetViewData()->HasEditView(meSplitPos)) && + (mpViewShell->GetViewData()->GetEditViewCol() == aCellPos.Col()) && + (mpViewShell->GetViewData()->GetEditViewRow() == aCellPos.Row())) + { + if (pForwarder) + DELETEZ( pForwarder ); + if (pEditEngine) + DELETEZ( pEditEngine ); + + sal_uInt16 nCol, nRow; + EditView* pEditView; + mpViewShell->GetViewData()->GetEditView( meSplitPos, pEditView, nCol, nRow ); + if (pEditView) + { + pTempForwarder = new SvxEditEngineForwarder(*(pEditView->GetEditEngine())); + pForwarder = pTempForwarder; + } + } + + if (pTempForwarder) + return pTempForwarder; + else + return ScCellTextData::GetTextForwarder(); +} + +SvxViewForwarder* ScAccessibleCellTextData::GetViewForwarder() +{ + if (!mpViewForwarder) + mpViewForwarder = new ScViewForwarder(mpViewShell, meSplitPos); + return mpViewForwarder; +} + +SvxEditViewForwarder* ScAccessibleCellTextData::GetEditViewForwarder( sal_Bool bCreate ) +{ + return new ScEditViewForwarder; +} + +ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell) +{ + ScDocShell* pDocSh = NULL; + if (pViewShell && pViewShell->GetViewData() && pViewShell->GetViewData()->GetDocument()) + pDocSh = (ScDocShell*) pViewShell->GetViewData()->GetDocument()->GetDocumentShell(); + return pDocSh; +} + diff --git a/sc/source/ui/Accessibility/makefile.mk b/sc/source/ui/Accessibility/makefile.mk index dc8edfc70c08..db79c2a61f4f 100644 --- a/sc/source/ui/Accessibility/makefile.mk +++ b/sc/source/ui/Accessibility/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.8 $ +# $Revision: 1.9 $ # -# last change: $Author: nn $ $Date: 2002-02-28 19:34:29 $ +# last change: $Author: sab $ $Date: 2002-03-01 08:38:25 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -91,10 +91,11 @@ CXXFILES = \ AccessibilityHints.cxx \ AccessibleDocumentBase.cxx \ AccessibleCellBase.cxx \ - AccessibleDocumentPagePreview.cxx \ + AccessibleDocumentPagePreview.cxx \ AccessiblePreviewTable.cxx \ AccessiblePreviewCell.cxx \ - AccessiblePreviewHeaderCell.cxx + AccessiblePreviewHeaderCell.cxx \ + AccessibleText.cxx EXCEPTIONSFILES=\ $(SLO)$/AccessibleContextBase.obj \ @@ -121,7 +122,8 @@ SLOFILES = \ $(SLO)$/AccessibleDocumentPagePreview.obj \ $(SLO)$/AccessiblePreviewTable.obj \ $(SLO)$/AccessiblePreviewCell.obj \ - $(SLO)$/AccessiblePreviewHeaderCell.obj + $(SLO)$/AccessiblePreviewHeaderCell.obj \ + $(SLO)$/AccessibleText.obj # --- Tagets ------------------------------------------------------- diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx index 9b8c09f3e0f4..ccb7196c6953 100644 --- a/sc/source/ui/inc/AccessibleCell.hxx +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleCell.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sab $ $Date: 2002-02-25 11:45:34 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,7 @@ #endif class ScTabViewShell; +class SvxAccessibleTextHelper; /** @descr This base class provides an implementation of the @@ -106,9 +107,6 @@ public: const ::com::sun::star::awt::Point& rPoint ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isVisible( ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); @@ -156,9 +154,19 @@ public: getSupportedServiceNames(void) throw (::com::sun::star::uno::RuntimeException); + ///===== XTypeProvider =================================================== + + /** Returns a implementation id. + */ + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL + getImplementationId(void) + throw (::com::sun::star::uno::RuntimeException); + private: ScTabViewShell* mpViewShell; + SvxAccessibleTextHelper* mpTextHelper; + ScSplitPos meSplitPos; sal_Bool IsDefunc( @@ -175,6 +183,8 @@ private: ::drafts::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); ScDocument* GetDocument(ScTabViewShell* mpViewShell); + + void CreateTextHelper(); }; diff --git a/sc/source/ui/inc/AccessibleCellBase.hxx b/sc/source/ui/inc/AccessibleCellBase.hxx index e5922a2577f5..441921874f13 100644 --- a/sc/source/ui/inc/AccessibleCellBase.hxx +++ b/sc/source/ui/inc/AccessibleCellBase.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleCellBase.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: sab $ $Date: 2002-02-25 11:45:34 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,7 +86,7 @@ public: const ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible>& rxParent, ScDocument* pDoc, - ScAddress& rCellAddress, + const ScAddress& rCellAddress, sal_Int32 nIndex); protected: virtual ~ScAccessibleCellBase(); @@ -122,6 +122,13 @@ public: getAccessibleIndexInParent(void) throw (::com::sun::star::uno::RuntimeException); + /** Return the locale of the cell. + */ + virtual ::com::sun::star::lang::Locale SAL_CALL + getLocale(void) + throw (::com::sun::star::uno::RuntimeException, + ::drafts::com::sun::star::accessibility::IllegalAccessibleComponentStateException); + protected: /// Return this object's description. virtual ::rtl::OUString SAL_CALL @@ -168,6 +175,12 @@ public: getTypes(void) throw (::com::sun::star::uno::RuntimeException); + /** Returns a implementation id. + */ + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL + getImplementationId(void) + throw (::com::sun::star::uno::RuntimeException); + protected: ScAddress maCellAddress; diff --git a/sc/source/ui/inc/AccessibleDocument.hxx b/sc/source/ui/inc/AccessibleDocument.hxx index 96a7f40b6d8f..2f4bc2ee30bd 100644 --- a/sc/source/ui/inc/AccessibleDocument.hxx +++ b/sc/source/ui/inc/AccessibleDocument.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleDocument.hxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: sab $ $Date: 2002-02-25 11:45:34 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,6 +142,14 @@ public: getSupportedServiceNames(void) throw (::com::sun::star::uno::RuntimeException); + ///===== XTypeProvider =================================================== + + /** Returns a implementation id. + */ + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL + getImplementationId(void) + throw (::com::sun::star::uno::RuntimeException); + protected: /// Return this object's description. virtual ::rtl::OUString SAL_CALL diff --git a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx index 180acea423b7..69a5a101dc26 100644 --- a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx +++ b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleDocumentPagePreview.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: nn $ $Date: 2002-02-27 19:34:18 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -131,6 +131,14 @@ public: getSupportedServiceNames(void) throw (::com::sun::star::uno::RuntimeException); + ///===== XTypeProvider =================================================== + + /** Returns a implementation id. + */ + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL + getImplementationId(void) + throw (::com::sun::star::uno::RuntimeException); + protected: /// Return this object's description. virtual ::rtl::OUString SAL_CALL diff --git a/sc/source/ui/inc/AccessiblePreviewCell.hxx b/sc/source/ui/inc/AccessiblePreviewCell.hxx index bc65d94bfa4a..61102dc9127d 100644 --- a/sc/source/ui/inc/AccessiblePreviewCell.hxx +++ b/sc/source/ui/inc/AccessiblePreviewCell.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePreviewCell.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: nn $ $Date: 2002-02-27 19:34:18 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -109,6 +109,14 @@ public: virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + ///===== XTypeProvider =================================================== + + /** Returns a implementation id. + */ + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL + getImplementationId(void) + throw (::com::sun::star::uno::RuntimeException); + protected: virtual Rectangle GetBoundingBoxOnScreen(void) throw(::com::sun::star::uno::RuntimeException); virtual Rectangle GetBoundingBox(void) throw (::com::sun::star::uno::RuntimeException); diff --git a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx index ad98d638e60d..26b8aec6353f 100644 --- a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx +++ b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessiblePreviewHeaderCell.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: nn $ $Date: 2002-02-28 19:28:48 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,6 +147,14 @@ public: virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + ///===== XTypeProvider =================================================== + + /** Returns a implementation id. + */ + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL + getImplementationId(void) + throw (::com::sun::star::uno::RuntimeException); + protected: virtual ::rtl::OUString SAL_CALL createAccessibleDescription(void) throw(::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL createAccessibleName(void) throw (::com::sun::star::uno::RuntimeException); diff --git a/sc/source/ui/inc/AccessibleSpreadsheet.hxx b/sc/source/ui/inc/AccessibleSpreadsheet.hxx index 2ca2889134ce..2a69b89088d7 100644 --- a/sc/source/ui/inc/AccessibleSpreadsheet.hxx +++ b/sc/source/ui/inc/AccessibleSpreadsheet.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleSpreadsheet.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: sab $ $Date: 2002-02-25 11:45:34 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -159,6 +159,14 @@ public: getSupportedServiceNames(void) throw (::com::sun::star::uno::RuntimeException); + ///===== XTypeProvider =================================================== + + /** Returns a implementation id. + */ + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL + getImplementationId(void) + throw (::com::sun::star::uno::RuntimeException); + protected: /// Return the object's current bounding box relative to the desktop. virtual Rectangle GetBoundingBoxOnScreen(void) diff --git a/sc/source/ui/inc/AccessibleTableBase.hxx b/sc/source/ui/inc/AccessibleTableBase.hxx index 744b5f530460..b2f75eab82ec 100644 --- a/sc/source/ui/inc/AccessibleTableBase.hxx +++ b/sc/source/ui/inc/AccessibleTableBase.hxx @@ -2,9 +2,9 @@ * * $RCSfile: AccessibleTableBase.hxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: sab $ $Date: 2002-02-25 11:45:34 $ + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -274,6 +274,12 @@ public: getTypes(void) throw (::com::sun::star::uno::RuntimeException); + /** Returns a implementation id. + */ + virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL + getImplementationId(void) + throw (::com::sun::star::uno::RuntimeException); + protected: /// contains the range of the table, because it could be a subrange of the complete table ScRange maRange; diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx new file mode 100644 index 000000000000..2b090a227020 --- /dev/null +++ b/sc/source/ui/inc/AccessibleText.hxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * $RCSfile: AccessibleText.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: sab $ $Date: 2002-03-01 08:36:32 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SC_ACCESSIBLETEXT_HXX +#define _SC_ACCESSIBLETEXT_HXX + +#ifndef SC_TEXTSUNO_HXX +#include "textuno.hxx" +#endif +#ifndef SC_SCGLOB_HXX +#include "global.hxx" +#endif +#ifndef SC_VIEWDATA_HXX +#include "viewdata.hxx" +#endif + +class ScCellTextData; +class ScDocShell; +class ScViewForwarder; + +// ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object + +class ScAccessibleCellTextData : public ScCellTextData +{ +public: + ScAccessibleCellTextData(ScTabViewShell* pViewShell, + const ScAddress& rP, ScSplitPos eSplitPos); + virtual ~ScAccessibleCellTextData(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate ); +private: + ScViewForwarder* mpViewForwarder; + ScTabViewShell* mpViewShell; + ScSplitPos meSplitPos; + + // prevent the using of this method of the base class + ScSharedCellEditSource* GetOriginalSource() { return NULL; } + + ScDocShell* GetDocShell(ScTabViewShell* pViewShell); +}; + +#endif |