diff options
Diffstat (limited to 'sc/source/ui/inc')
252 files changed, 33942 insertions, 0 deletions
diff --git a/sc/source/ui/inc/AccessibilityHints.hxx b/sc/source/ui/inc/AccessibilityHints.hxx new file mode 100644 index 000000000000..dee0c99d4861 --- /dev/null +++ b/sc/source/ui/inc/AccessibilityHints.hxx @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBILITYHINTS_HXX +#define SC_ACCESSIBILITYHINTS_HXX + +#include "viewdata.hxx" +#include <com/sun/star/uno/XInterface.hpp> +#include <svl/smplhint.hxx> +#include <svl/hint.hxx> + +#define SC_HINT_ACC_SIMPLE_START SFX_HINT_USER00 +#define SC_HINT_ACC_TABLECHANGED SC_HINT_ACC_SIMPLE_START + 1 +#define SC_HINT_ACC_CURSORCHANGED SC_HINT_ACC_SIMPLE_START + 2 +#define SC_HINT_ACC_VISAREACHANGED SC_HINT_ACC_SIMPLE_START + 3 +#define SC_HINT_ACC_ENTEREDITMODE SC_HINT_ACC_SIMPLE_START + 4 +#define SC_HINT_ACC_LEAVEEDITMODE SC_HINT_ACC_SIMPLE_START + 5 +#define SC_HINT_ACC_MAKEDRAWLAYER SC_HINT_ACC_SIMPLE_START + 6 +#define SC_HINT_ACC_WINDOWRESIZED SC_HINT_ACC_SIMPLE_START + 7 + +class ScAccWinFocusLostHint : public SfxHint +{ + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + xOldAccessible; +public: + TYPEINFO(); + ScAccWinFocusLostHint( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xOld ); + ~ScAccWinFocusLostHint(); + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + GetOldAccessible() const { return xOldAccessible; } +}; + +class ScAccWinFocusGotHint : public SfxHint +{ + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + xNewAccessible; +public: + TYPEINFO(); + ScAccWinFocusGotHint( + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xNew ); + ~ScAccWinFocusGotHint(); + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + GetNewAccessible() const { return xNewAccessible; } +}; + +class ScAccGridWinFocusLostHint : public ScAccWinFocusLostHint +{ + ScSplitPos eOldGridWin; +public: + TYPEINFO(); + ScAccGridWinFocusLostHint( ScSplitPos eOldGridWin, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xOld ); + ~ScAccGridWinFocusLostHint(); + + ScSplitPos GetOldGridWin() const { return eOldGridWin; } +}; + +class ScAccGridWinFocusGotHint : public ScAccWinFocusGotHint +{ + ScSplitPos eNewGridWin; +public: + TYPEINFO(); + ScAccGridWinFocusGotHint( ScSplitPos eNewGridWin, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xNew ); + ~ScAccGridWinFocusGotHint(); + + ScSplitPos GetNewGridWin() const { return eNewGridWin; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx new file mode 100644 index 000000000000..6d0c1dfb524b --- /dev/null +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -0,0 +1,176 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLECELL_HXX +#define _SC_ACCESSIBLECELL_HXX + +#include "AccessibleCellBase.hxx" +#include "global.hxx" +#include "viewdata.hxx" +#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp> +#include <unotools/accessiblerelationsethelper.hxx> +#include <editeng/AccessibleStaticTextBase.hxx> +#include <comphelper/uno3.hxx> + +class ScTabViewShell; +class ScAccessibleDocument; + +/** @descr + This base class provides an implementation of the + <code>AccessibleCell</code> service. +*/ +class ScAccessibleCell + : public ScAccessibleCellBase, + public accessibility::AccessibleStaticTextBase +{ +public: + //===== internal ======================================================== + ScAccessibleCell( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScTabViewShell* pViewShell, + ScAddress& rCellAddress, + sal_Int32 nIndex, + ScSplitPos eSplitPos, + ScAccessibleDocument* pAccDoc); + + virtual void Init(); + + using ScAccessibleCellBase::disposing; + virtual void SAL_CALL disposing(); + +protected: + virtual ~ScAccessibleCell(); + + using ScAccessibleCellBase::IsDefunc; + +public: + ///===== XInterface ===================================================== + + DECLARE_XINTERFACE() + + ///===== XTypeProvider =================================================== + + DECLARE_XTYPEPROVIDER() + + ///===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( + const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL grabFocus( ) + throw (::com::sun::star::uno::RuntimeException); + +protected: + /// Return the object's current bounding box relative to the desktop. + virtual Rectangle GetBoundingBoxOnScreen(void) const + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the parent object. + virtual Rectangle GetBoundingBox(void) const + throw (::com::sun::star::uno::RuntimeException); + +public: + ///===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + // is overloaded to calculate this on demand + virtual sal_Int32 SAL_CALL + getAccessibleChildCount(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the specified child or NULL if index is invalid. + // is overloaded to calculate this on demand + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Return the set of current states. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL + getAccessibleRelationSet(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(void) + throw (::com::sun::star::uno::RuntimeException); + + /** Returns a list of all supported services. + */ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL + getSupportedServiceNames(void) + throw (::com::sun::star::uno::RuntimeException); + +private: + ScTabViewShell* mpViewShell; + ScAccessibleDocument* mpAccDoc; + + ScSplitPos meSplitPos; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + virtual sal_Bool IsEditable( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + sal_Bool IsOpaque( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + sal_Bool IsSelected(); + + ScDocument* GetDocument(ScTabViewShell* mpViewShell); + + ::std::auto_ptr< SvxEditSource > CreateEditSource(ScTabViewShell* pViewShell, ScAddress aCell, ScSplitPos eSplitPos); + + void FillDependends(utl::AccessibleRelationSetHelper* pRelationSet); + void FillPrecedents(utl::AccessibleRelationSetHelper* pRelationSet); + void AddRelation(const ScAddress& rCell, + const sal_uInt16 aRelationType, + ::utl::AccessibleRelationSetHelper* pRelationSet); + void AddRelation(const ScRange& rRange, + const sal_uInt16 aRelationType, + ::utl::AccessibleRelationSetHelper* pRelationSet); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleCellBase.hxx b/sc/source/ui/inc/AccessibleCellBase.hxx new file mode 100644 index 000000000000..fb79d76c91a1 --- /dev/null +++ b/sc/source/ui/inc/AccessibleCellBase.hxx @@ -0,0 +1,156 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLECELLBASE_HXX +#define _SC_ACCESSIBLECELLBASE_HXX + +#include "AccessibleContextBase.hxx" +#include "global.hxx" +#include "address.hxx" +#include <com/sun/star/accessibility/XAccessibleValue.hpp> +#include <cppuhelper/implbase1.hxx> + +class ScTabViewShell; + +typedef cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleValue> + ScAccessibleCellBaseImpl; + +class ScAccessibleCellBase + : public ScAccessibleContextBase, + public ScAccessibleCellBaseImpl +{ +public: + //===== internal ======================================================== + ScAccessibleCellBase( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScDocument* pDoc, + const ScAddress& rCellAddress, + sal_Int32 nIndex); +protected: + virtual ~ScAccessibleCellBase(); +public: + + ///===== XInterface ===================================================== + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + + virtual void SAL_CALL release() throw (); + + ///===== XAccessibleComponent ============================================ + + virtual sal_Bool SAL_CALL isVisible( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getForeground( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground( ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleContext ============================================== + + /// Return this objects index among the parents children. + virtual sal_Int32 SAL_CALL + getAccessibleIndexInParent(void) + throw (::com::sun::star::uno::RuntimeException); + +protected: + /// Return this object's description. + virtual ::rtl::OUString SAL_CALL + createAccessibleDescription(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + createAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); + +public: + ///===== XAccessibleValue ================================================ + + virtual ::com::sun::star::uno::Any SAL_CALL + getCurrentValue( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Any SAL_CALL + getMaximumValue( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Any SAL_CALL + getMinimumValue( ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XTypeProvider =================================================== + + /// returns the possible types + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL + getTypes() + 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; + + ScDocument* mpDoc; + + sal_Int32 mnIndex; + +private: + virtual sal_Bool IsEditable( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx b/sc/source/ui/inc/AccessibleContextBase.hxx new file mode 100644 index 000000000000..245122f5b73a --- /dev/null +++ b/sc/source/ui/inc/AccessibleContextBase.hxx @@ -0,0 +1,345 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLECONTEXTBASE_HXX +#define _SC_ACCESSIBLECONTEXTBASE_HXX + +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/accessibility/XAccessibleComponent.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +#include <com/sun/star/uno/Reference.hxx> +#include <cppuhelper/weak.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XServiceName.hpp> +#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> +#include <osl/mutex.hxx> +#include <cppuhelper/interfacecontainer.h> + + +#include <svl/lstner.hxx> +#include <cppuhelper/compbase5.hxx> +#include <cppuhelper/implbase1.hxx> +#include <comphelper/servicehelper.hxx> +#include <comphelper/broadcasthelper.hxx> + +class Rectangle; + +/** @descr + This base class provides an implementation of the + <code>AccessibleContext</code> service. +*/ + +typedef cppu::WeakAggComponentImplHelper5< + ::com::sun::star::accessibility::XAccessible, + ::com::sun::star::accessibility::XAccessibleComponent, + ::com::sun::star::accessibility::XAccessibleContext, + ::com::sun::star::accessibility::XAccessibleEventBroadcaster, + ::com::sun::star::lang::XServiceInfo + > ScAccessibleContextBaseWeakImpl; + +typedef cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessibleEventListener + > ScAccessibleContextBaseImplEvent; + +class ScAccessibleContextBase + : public comphelper::OBaseMutex, + public ScAccessibleContextBaseWeakImpl, + public ScAccessibleContextBaseImplEvent, + public SfxListener +{ +public: + //===== internal ======================================================== + ScAccessibleContextBase( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + const sal_Int16 aRole); + + virtual void Init(); + virtual void SAL_CALL disposing(); +protected: + virtual ~ScAccessibleContextBase(void); +public: + using WeakAggComponentImplHelperBase::addEventListener; + using WeakAggComponentImplHelperBase::removeEventListener; + + ///===== SfxListener ===================================================== + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + ///===== XInterface ===================================================== + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + + virtual void SAL_CALL release() throw (); + + ///===== XAccessible ===================================================== + + /// Return the XAccessibleContext. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext> SAL_CALL + getAccessibleContext(void) throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleComponent ============================================ + + virtual sal_Bool SAL_CALL containsPoint( + const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( + const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::awt::Rectangle SAL_CALL getBounds( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::awt::Point SAL_CALL getLocation( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isShowing( ) + 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); + + virtual sal_Int32 SAL_CALL getForeground( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground( ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + virtual sal_Int32 SAL_CALL + getAccessibleChildCount(void) throw (::com::sun::star::uno::RuntimeException); + + /// Return the specified child or NULL if index is invalid. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Return a reference to the parent. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleParent(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return this objects index among the parents children. + virtual sal_Int32 SAL_CALL + getAccessibleIndexInParent(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return this object's role. + virtual sal_Int16 SAL_CALL + getAccessibleRole(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return this object's description. + virtual ::rtl::OUString SAL_CALL + getAccessibleDescription(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + getAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return NULL to indicate that an empty relation set. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL + getAccessibleRelationSet(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the set of current states. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + + /** Return the parents locale or throw exception if this object has no + parent yet/anymore. + */ + virtual ::com::sun::star::lang::Locale SAL_CALL + getLocale(void) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::accessibility::IllegalAccessibleComponentStateException); + + ///===== XAccessibleEventBroadcaster ===================================== + + /** Add listener that is informed of future changes of name, + description and so on events. + */ + virtual void SAL_CALL + addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + + // Remove an existing event listener. + virtual void SAL_CALL + removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + + ///===== XAccessibleEventListener ======================================== + + virtual void SAL_CALL + disposing( const ::com::sun::star::lang::EventObject& Source ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + notifyEvent( + const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(void) + throw (::com::sun::star::uno::RuntimeException); + + /** Return whether the specified service is supported by this class. + */ + virtual sal_Bool SAL_CALL + supportsService(const ::rtl::OUString& sServiceName) + throw (::com::sun::star::uno::RuntimeException); + + /** Returns a list of all supported services. In this case that is just + the AccessibleContext and Accessible service. + */ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL + getSupportedServiceNames(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XTypeProvider =================================================== + + /// returns the possible types + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL + getTypes() + 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: + /// Return this object's description. + virtual ::rtl::OUString SAL_CALL + createAccessibleDescription(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + createAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the desktop. + virtual Rectangle GetBoundingBoxOnScreen(void) const + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the parent object. + virtual Rectangle GetBoundingBox(void) const + throw (::com::sun::star::uno::RuntimeException); + +public: + /// Calls all Listener to tell they the change. + void + CommitChange(const com::sun::star::accessibility::AccessibleEventObject& rEvent) const; + + /// change the name and call the listener to tell they the change + void + ChangeName(); + +protected: + /// Calls all FocusListener to tell they that the focus is gained. + void CommitFocusGained() const; + + /// Calls all FocusListener to tell they that the focus is lost. + void CommitFocusLost() const; + + sal_Bool IsDefunc() const { return rBHelper.bDisposed; } + + virtual void IsObjectValid() const + throw (::com::sun::star::lang::DisposedException); + + /// Use this method to set initial Name without notification + void SetName(const rtl::OUString& rName) { msName = rName; } + /// Use this method to set initial Description without notification + void SetDescription(const rtl::OUString& rDesc) { msDescription = rDesc; } + + /// Reference to the parent object. + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible> mxParent; + +private: + /** Description of this object. This is not a constant because it can + be set from the outside. Furthermore, it changes according the the + draw page's display mode. + */ + ::rtl::OUString msDescription; + + /** Name of this object. It changes according the the draw page's + display mode. + */ + ::rtl::OUString msName; + + /// client id in the AccessibleEventNotifier queue + sal_uInt32 mnClientId; + + /** This is the role of this object. + */ + sal_Int16 maRole; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx new file mode 100644 index 000000000000..87cd4f8d7d26 --- /dev/null +++ b/sc/source/ui/inc/AccessibleCsvControl.hxx @@ -0,0 +1,668 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ============================================================================ + +#ifndef _SC_ACCESSIBLECSVCONTROL_HXX +#define _SC_ACCESSIBLECSVCONTROL_HXX + +#include <com/sun/star/accessibility/XAccessibleText.hpp> +#include <com/sun/star/accessibility/XAccessibleTable.hpp> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> +#include <tools/gen.hxx> +#include <tools/string.hxx> +#include <rtl/ustrbuf.hxx> +#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/implbase2.hxx> +#include <editeng/AccessibleStaticTextBase.hxx> +#include <comphelper/uno3.hxx> +#include "AccessibleContextBase.hxx" + + +// ============================================================================ + +class ScCsvControl; +namespace utl { class AccessibleStateSetHelper; } + +/** Accessible base class used for CSV controls. */ +class ScAccessibleCsvControl : public ScAccessibleContextBase +{ +protected: + typedef ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > XAccessibleRef; + typedef ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleRelationSet > XAccessibleRelationSetRef; + typedef ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet > XAccessibleStateSetRef; + + typedef ::com::sun::star::awt::Point AwtPoint; + typedef ::com::sun::star::awt::Size AwtSize; + typedef ::com::sun::star::awt::Rectangle AwtRectangle; + +private: + ScCsvControl* mpControl; /// Pointer to the VCL control. + +public: + explicit ScAccessibleCsvControl( + const XAccessibleRef& rxParent, + ScCsvControl& rControl, + sal_uInt16 nRole ); + virtual ~ScAccessibleCsvControl(); + + using ScAccessibleContextBase::disposing; + virtual void SAL_CALL disposing(); + + // XAccessibleComponent --------------------------------------------------- + + /** Returns the child at the specified point (cell returns NULL). */ + virtual XAccessibleRef SAL_CALL getAccessibleAtPoint( const AwtPoint& rPoint ) + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns true, if the control is visible. */ + virtual sal_Bool SAL_CALL isVisible() throw( ::com::sun::star::uno::RuntimeException ); + + /** Sets the focus to this control. */ + virtual void SAL_CALL grabFocus() throw( ::com::sun::star::uno::RuntimeException ); + + // events ----------------------------------------------------------------- +public: + /** Sends a GetFocus or LoseFocus event to all listeners. */ + virtual void SendFocusEvent( bool bFocused ); + /** Sends a caret changed event to all listeners. */ + virtual void SendCaretEvent(); + /** Sends a visible area changed event to all listeners. */ + virtual void SendVisibleEvent(); + /** Sends a selection changed event to all listeners. */ + virtual void SendSelectionEvent(); + /** Sends a table model changed event for changed cell contents to all listeners. */ + virtual void SendTableUpdateEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn, bool bAllRows ); + /** Sends a table model changed event for an inserted column to all listeners. */ + virtual void SendInsertColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); + /** Sends a table model changed event for a removed column to all listeners. */ + virtual void SendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); + + // helpers ---------------------------------------------------------------- +protected: + /** Returns this object's current bounding box relative to the desktop. */ + virtual Rectangle GetBoundingBoxOnScreen() const throw( ::com::sun::star::uno::RuntimeException ); + /** Returns this object's current bounding box relative to the parent object. */ + virtual Rectangle GetBoundingBox() const throw( ::com::sun::star::uno::RuntimeException ); + + /** Creates a new UUID in rSeq, if it is empty. Locks mutex internally. */ + void getUuid( ::com::sun::star::uno::Sequence< sal_Int8 >& rSeq ); + + /** Returns whether the object is alive. Must be called with locked mutex. */ + inline bool implIsAlive() const { return !rBHelper.bDisposed && !rBHelper.bInDispose && mpControl; } + /** Throws an exception, if the object is disposed/disposing or any pointer + is missing. Should be used with locked mutex! */ + void ensureAlive() const throw( ::com::sun::star::lang::DisposedException ); + + /** Returns the VCL control. Assumes a living object. */ + ScCsvControl& implGetControl() const; + + /** Returns the first child of rxParentObj, which has the role nRole. */ + XAccessibleRef implGetChildByRole( const XAccessibleRef& rxParentObj, sal_uInt16 nRole ) + throw( ::com::sun::star::uno::RuntimeException ); + /** Creates a StateSetHelper and fills it with DEFUNC, OPAQUE, ENABLED, SHOWING and VISIBLE. */ + ::utl::AccessibleStateSetHelper* implCreateStateSet(); + + /** Disposes the object. This is a helper called from destructors only. */ + void implDispose(); + + /** Converts the control-relative position to an absolute screen position. */ + Point implGetAbsPos( const Point& rPos ) const; +}; + + +// ============================================================================ + +class ScCsvRuler; + +typedef ::cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessibleText > + ScAccessibleCsvRulerImpl; + +/** Accessible class representing the CSV ruler control. */ +class ScAccessibleCsvRuler : public ScAccessibleCsvControl, public ScAccessibleCsvRulerImpl +{ +protected: + typedef ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > PropertyValueSeq; + +private: + ::rtl::OUStringBuffer maBuffer; /// Contains the text representation of the ruler. + +public: + explicit ScAccessibleCsvRuler( ScCsvRuler& rRuler ); + virtual ~ScAccessibleCsvRuler(); + + // XAccessibleComponent ----------------------------------------------------- + + virtual sal_Int32 SAL_CALL getForeground( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground( ) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext ----------------------------------------------------- + + /** Returns the child count (the ruler does not have children). */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Throws an exception (the ruler does not have childern). */ + virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the relation to the grid control. */ + virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the current set of states. */ + virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet() + throw( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleText -------------------------------------------------------- + + /** Return the position of the caret. */ + virtual sal_Int32 SAL_CALL getCaretPosition() throw( ::com::sun::star::uno::RuntimeException ); + + /** Sets the position of the caret. */ + virtual sal_Bool SAL_CALL setCaretPosition( sal_Int32 nIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the specified character. */ + virtual sal_Unicode SAL_CALL getCharacter( sal_Int32 nIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the attributes of the specified character. */ + virtual PropertyValueSeq SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the screen coordinates of the specified character. */ + virtual AwtRectangle SAL_CALL getCharacterBounds( sal_Int32 nIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the count of characters. */ + virtual sal_Int32 SAL_CALL getCharacterCount() throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the character index at the specified coordinate (object's coordinate system). */ + virtual sal_Int32 SAL_CALL getIndexAtPoint( const AwtPoint& rPoint ) + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the selected text (ruler returns empty string). */ + virtual ::rtl::OUString SAL_CALL getSelectedText() throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the start index of the selection (ruler returns -1). */ + virtual sal_Int32 SAL_CALL getSelectionStart() throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the end index of the selection (ruler returns -1). */ + virtual sal_Int32 SAL_CALL getSelectionEnd() throw( ::com::sun::star::uno::RuntimeException ); + + /** Selects a part of the text (ruler does nothing). */ + virtual sal_Bool SAL_CALL setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the entire text. */ + virtual ::rtl::OUString SAL_CALL getText() throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the specified range [Start,End) of the text. */ + virtual ::rtl::OUString SAL_CALL getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the specified text portion. */ + virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + /** Copies the specified text range into the clipboard (ruler does nothing). */ + virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + // XInterface ------------------------------------------------------------- + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL acquire() throw(); + + virtual void SAL_CALL release() throw(); + + // XServiceInfo ----------------------------------------------------------- + + /** Returns an identifier for the implementation of this object. */ + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + + // XTypeProvider ---------------------------------------------------------- + + /** Returns a sequence with all supported interface types. */ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns an implementation ID. */ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // events ----------------------------------------------------------------- +public: + /** Sends a caret changed event to all listeners. */ + virtual void SendCaretEvent(); + + // helpers ---------------------------------------------------------------- +private: + /** Returns this object's name. */ + virtual ::rtl::OUString SAL_CALL createAccessibleName() + throw( ::com::sun::star::uno::RuntimeException ); + /** Returns this object's description. */ + virtual ::rtl::OUString SAL_CALL createAccessibleDescription() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Throws an exception, if the specified character position is invalid (outside 0..len-1). */ + void ensureValidIndex( sal_Int32 nIndex ) const + throw( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** Throws an exception, if the specified character position is invalid (outside 0..len). */ + void ensureValidIndexWithEnd( sal_Int32 nIndex ) const + throw( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** Throws an exception, if the specified character range [Start,End) is invalid. + @descr If Start>End, swaps Start and End before checking. */ + void ensureValidRange( sal_Int32& rnStartIndex, sal_Int32& rnEndIndex ) const + throw( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Returns the VCL ruler control. Assumes a living object. */ + ScCsvRuler& implGetRuler() const; + + /** Builds the entire string buffer. */ + void constructStringBuffer() throw( ::com::sun::star::uno::RuntimeException ); + /** Returns the character count of the text. */ + sal_Int32 implGetTextLength() const; + + /** Returns true, if the character at the specified index has a split. */ + bool implHasSplit( sal_Int32 nApiPos ); + + /** Returns the first character index with equal formatting as at nApiPos. */ + sal_Int32 implGetFirstEqualFormatted( sal_Int32 nApiPos ); + /** Returns the last character index with equal formatting as at nApiPos. */ + sal_Int32 implGetLastEqualFormatted( sal_Int32 nApiPos ); +}; + + +// ============================================================================ + +class ScCsvGrid; + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessibleTable, + ::com::sun::star::accessibility::XAccessibleSelection > + ScAccessibleCsvGridImpl; + +/** Accessible class representing the CSV grid control. */ +class ScAccessibleCsvGrid : public ScAccessibleCsvControl, public ScAccessibleCsvGridImpl +{ +protected: + typedef ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleTable > XAccessibleTableRef; + +public: + explicit ScAccessibleCsvGrid( ScCsvGrid& rGrid ); + virtual ~ScAccessibleCsvGrid(); + + // XAccessibleComponent --------------------------------------------------- + + /** Returns the cell at the specified point. */ + virtual XAccessibleRef SAL_CALL getAccessibleAtPoint( const AwtPoint& rPoint ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Int32 SAL_CALL getForeground( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground( ) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext ----------------------------------------------------- + + /** Returns the child count (count of cells in the table). */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the specified child cell. */ + virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the relation to the ruler control. */ + virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the current set of states. */ + virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet() + throw( ::com::sun::star::uno::RuntimeException ); + + // XAccessibleTable ------------------------------------------------------- + + /** Returns the number of rows in the table. */ + virtual sal_Int32 SAL_CALL getAccessibleRowCount() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the number of columns in the table. */ + virtual sal_Int32 SAL_CALL getAccessibleColumnCount() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the description of the specified row in the table. */ + virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the description text of the specified column in the table. */ + virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the number of rows occupied at a specified row and column. + @descr Returns always 1 (Merged cells not supported). */ + virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the number of rows occupied at a specified row and column. + @descr Returns always 1 (Merged cells not supported). */ + virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the row headers as an AccessibleTable. */ + virtual XAccessibleTableRef SAL_CALL getAccessibleRowHeaders() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the column headers as an AccessibleTable. */ + virtual XAccessibleTableRef SAL_CALL getAccessibleColumnHeaders() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the selected rows as a sequence. */ + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the selected columns as a sequence. */ + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns true, if the specified row is selected. */ + virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns true, if the specified column is selected. */ + virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the accessible cell object at the specified position. */ + virtual XAccessibleRef SAL_CALL getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the caption object of the table. */ + virtual XAccessibleRef SAL_CALL getAccessibleCaption() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the summary description object of the table. */ + virtual XAccessibleRef SAL_CALL getAccessibleSummary() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns true, if the cell at a specified position is selected. */ + virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the child index of the cell at the specified position. */ + virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the row index of the specified child. */ + virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the column index of the specified child. */ + virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + // XAccessibleSelection --------------------------------------------------- + + /** Selects the specified child (selects the entire column or the entire table). */ + virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns true, if the specified child is selected. */ + virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Deselects all cells. */ + virtual void SAL_CALL clearAccessibleSelection() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Selects all cells. */ + virtual void SAL_CALL selectAllAccessibleChildren() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the count of selected children. */ + virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the child with the specified index in all selected children. */ + virtual XAccessibleRef SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Deselects the child with the specified index in all selected children. */ + virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + // XInterface ------------------------------------------------------------- + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& rType ) + throw( ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL acquire() throw(); + + virtual void SAL_CALL release() throw(); + + // XServiceInfo ----------------------------------------------------------- + + /** Returns an identifier for the implementation of this object. */ + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + + // XTypeProvider ---------------------------------------------------------- + + /** Returns a sequence with all supported interface types. */ + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns an implementation ID. */ + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // events ----------------------------------------------------------------- +public: + /** Sends a GetFocus or LoseFocus event to all listeners. */ + virtual void SendFocusEvent( bool bFocused ); + /** Sends a table model changed event for changed cell contents to all listeners. */ + virtual void SendTableUpdateEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn, bool bAllRows ); + /** Sends a table model changed event for an inserted column to all listeners. */ + virtual void SendInsertColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); + /** Sends a table model changed event for a removed column to all listeners. */ + virtual void SendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); + + // helpers ---------------------------------------------------------------- +private: + /** Returns this object's name. */ + virtual ::rtl::OUString SAL_CALL createAccessibleName() + throw( ::com::sun::star::uno::RuntimeException ); + /** Returns this object's description. */ + virtual ::rtl::OUString SAL_CALL createAccessibleDescription() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Throws an exception, if nIndex is not a valid child index. */ + void ensureValidIndex( sal_Int32 nIndex ) const + throw( ::com::sun::star::lang::IndexOutOfBoundsException ); + /** Throws an exception, if the specified position is invalid. */ + void ensureValidPosition( sal_Int32 nRow, sal_Int32 nColumn ) const + throw( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Returns the VCL grid control. Assumes a living object. */ + ScCsvGrid& implGetGrid() const; + + /** Returns true, if the specified column (including header) is selected. */ + bool implIsColumnSelected( sal_Int32 nColumn ) const; + /** Selects the specified column (including header). */ + void implSelectColumn( sal_Int32 nColumn, bool bSelect ); + + /** Returns the count of visible rows in the table (including header). */ + sal_Int32 implGetRowCount() const; + /** Returns the total column count in the table (including header). */ + sal_Int32 implGetColumnCount() const; + /** Returns the count of selected columns in the table. */ + sal_Int32 implGetSelColumnCount() const; + /** Returns the total cell count in the table (including header). */ + inline sal_Int32 implGetCellCount() const { return implGetRowCount() * implGetColumnCount(); } + + /** Returns the row index from cell index (including header). */ + inline sal_Int32 implGetRow( sal_Int32 nIndex ) const { return nIndex / implGetColumnCount(); } + /** Returns the column index from cell index (including header). */ + inline sal_Int32 implGetColumn( sal_Int32 nIndex ) const { return nIndex % implGetColumnCount(); } + /** Returns the absolute column index of the nSelColumn-th selected column. */ + sal_Int32 implGetSelColumn( sal_Int32 nSelColumn ) const; + /** Returns the child index from cell position (including header). */ + inline sal_Int32 implGetIndex( sal_Int32 nRow, sal_Int32 nColumn ) const { return nRow * implGetColumnCount() + nColumn; } + + /** Returns the contents of the specified cell (including header). Indexes must be valid. */ + String implGetCellText( sal_Int32 nRow, sal_Int32 nColumn ) const; + /** Creates a new accessible object of the specified cell. Indexes must be valid. */ + ScAccessibleCsvControl* implCreateCellObj( sal_Int32 nRow, sal_Int32 nColumn ) const; +}; + + +// ============================================================================ + +/** Accessible class representing a cell of the CSV grid control. */ +class ScAccessibleCsvCell : public ScAccessibleCsvControl, public accessibility::AccessibleStaticTextBase +{ +protected: + typedef ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > PropertyValueSeq; + typedef ::std::auto_ptr< SvxEditSource > SvxEditSourcePtr; + +private: + String maCellText; /// The text contents of this cell. + sal_Int32 mnLine; /// The grid line index (core index). + sal_uInt32 mnColumn; /// The grid column index (core index). + sal_Int32 mnIndex; /// The index of the cell in the table. + +public: + explicit ScAccessibleCsvCell( + ScCsvGrid& rGrid, + const String& rCellText, + sal_Int32 nRow, sal_Int32 nColumn ); + virtual ~ScAccessibleCsvCell(); + + using ScAccessibleCsvControl::disposing; + virtual void SAL_CALL disposing(); + + // XAccessibleComponent --------------------------------------------------- + + /** Sets the focus to the column of this cell. */ + virtual void SAL_CALL grabFocus() throw( ::com::sun::star::uno::RuntimeException ); + + virtual sal_Int32 SAL_CALL getForeground( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground( ) + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext ----------------------------------------------------- + + /** Returns the child count. */ + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the specified child. */ + virtual XAccessibleRef SAL_CALL getAccessibleChild( sal_Int32 nIndex ) + throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException ); + + /** Returns the index of this cell in the table. */ + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the relation to the ruler control. */ + virtual XAccessibleRelationSetRef SAL_CALL getAccessibleRelationSet() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the current set of states. */ + virtual XAccessibleStateSetRef SAL_CALL getAccessibleStateSet() + throw( ::com::sun::star::uno::RuntimeException ); + + // XInterface ------------------------------------------------------------- + + DECLARE_XINTERFACE() + + // XTypeProvider ---------------------------------------------------------- + + DECLARE_XTYPEPROVIDER() + + // XServiceInfo ----------------------------------------------------------- + + /** Returns an identifier for the implementation of this object. */ + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + + // helpers ---------------------------------------------------------------- +protected: + /** Returns this object's current bounding box relative to the desktop. */ + virtual Rectangle GetBoundingBoxOnScreen() const throw( ::com::sun::star::uno::RuntimeException ); + /** Returns this object's current bounding box relative to the parent object. */ + virtual Rectangle GetBoundingBox() const throw( ::com::sun::star::uno::RuntimeException ); + +private: + /** Returns this object's name. */ + virtual ::rtl::OUString SAL_CALL createAccessibleName() + throw( ::com::sun::star::uno::RuntimeException ); + /** Returns this object's description. */ + virtual ::rtl::OUString SAL_CALL createAccessibleDescription() + throw( ::com::sun::star::uno::RuntimeException ); + + /** Returns the VCL grid control. Assumes a living object. */ + ScCsvGrid& implGetGrid() const; + /** Returns the pixel position of the cell (rel. to parent), regardless of visibility. */ + Point implGetRealPos() const; + /** Returns the width of the character count */ + sal_uInt32 implCalcPixelWidth(sal_uInt32 nChars) const; + /** Returns the pixel size of the cell, regardless of visibility. */ + Size implGetRealSize() const; + /** Returns the bounding box of the cell relative in the table. */ + Rectangle implGetBoundingBox() const; + + /** Creates the edit source the text helper needs. */ + ::std::auto_ptr< SvxEditSource > implCreateEditSource(); +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleDataPilotControl.hxx b/sc/source/ui/inc/AccessibleDataPilotControl.hxx new file mode 100644 index 000000000000..fb0e0f40ecd6 --- /dev/null +++ b/sc/source/ui/inc/AccessibleDataPilotControl.hxx @@ -0,0 +1,148 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEDATAPILOTCONTROL_HXX +#define _SC_ACCESSIBLEDATAPILOTCONTROL_HXX + +#include "AccessibleContextBase.hxx" + +class ScDPFieldControlBase; +class ScAccessibleDataPilotButton; + +class ScAccessibleDataPilotControl + : public ScAccessibleContextBase +{ +public: + //===== internal ======================================================== + ScAccessibleDataPilotControl( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScDPFieldControlBase* pDPFieldWindow); + + virtual void Init(); + + using ScAccessibleContextBase::disposing; + virtual void SAL_CALL disposing(); + + void AddField(sal_Int32 nNewIndex); + void RemoveField(sal_Int32 nOldIndex); + void FieldFocusChange(sal_Int32 nOldIndex, sal_Int32 nNewIndex); + void FieldNameChange(sal_Int32 nIndex); + void GotFocus(); + void LostFocus(); +protected: + virtual ~ScAccessibleDataPilotControl(void); +public: + ///===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( + 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); + + virtual sal_Int32 SAL_CALL getForeground( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground( ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + virtual sal_Int32 SAL_CALL + getAccessibleChildCount(void) throw (::com::sun::star::uno::RuntimeException); + + /// Return the specified child or NULL if index is invalid. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Return the set of current states. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(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 + createAccessibleDescription(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + createAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the desktop. + virtual Rectangle GetBoundingBoxOnScreen(void) const + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the parent object. + virtual Rectangle GetBoundingBox(void) const + throw (::com::sun::star::uno::RuntimeException); + +private: + ScDPFieldControlBase* mpDPFieldWindow; + struct AccessibleWeak + { + ::com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xWeakAcc; + ScAccessibleDataPilotButton* pAcc; + AccessibleWeak() : pAcc(NULL) {} + }; + ::std::vector< AccessibleWeak > maChildren; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleDocument.hxx b/sc/source/ui/inc/AccessibleDocument.hxx new file mode 100644 index 000000000000..fbfa0667f68f --- /dev/null +++ b/sc/source/ui/inc/AccessibleDocument.hxx @@ -0,0 +1,331 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEDOCUMENT_HXX +#define _SC_ACCESSIBLEDOCUMENT_HXX + +#include "AccessibleDocumentBase.hxx" +#include "viewdata.hxx" +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> +#include <com/sun/star/view/XSelectionChangeListener.hpp> +#include <cppuhelper/implbase2.hxx> +#include <svx/IAccessibleViewForwarder.hxx> + +class ScTabViewShell; +class ScAccessibleSpreadsheet; +class ScChildrenShapes; +class ScAccessibleEditObject; + +namespace accessibility +{ + class AccessibleShape; +} +namespace utl +{ + class AccessibleRelationSetHelper; +} + +/** @descr + This base class provides an implementation of the + <code>AccessibleContext</code> service. +*/ + +typedef cppu::ImplHelper2< ::com::sun::star::accessibility::XAccessibleSelection, + ::com::sun::star::view::XSelectionChangeListener > + ScAccessibleDocumentImpl; + +class ScAccessibleDocument + : public ScAccessibleDocumentBase, + public ScAccessibleDocumentImpl, + public accessibility::IAccessibleViewForwarder +{ +public: + //===== internal ======================================================== + ScAccessibleDocument( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScTabViewShell* pViewShell, + ScSplitPos eSplitPos); + + virtual void Init(); + + + DECL_LINK( WindowChildEventListener, VclSimpleEvent* ); +protected: + virtual ~ScAccessibleDocument(void); + + using ScAccessibleDocumentBase::IsDefunc; + +public: + + virtual void SAL_CALL disposing(); + + ///===== SfxListener ===================================================== + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + ///===== XInterface ===================================================== + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + + virtual void SAL_CALL release() throw (); + + ///===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( + const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL grabFocus( ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + virtual sal_Int32 SAL_CALL + getAccessibleChildCount(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the specified child or NULL if index is invalid. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Return the set of current states. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleSelection =========================================== + + virtual void SAL_CALL + selectAccessibleChild( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + isAccessibleChildSelected( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + clearAccessibleSelection( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + selectAllAccessibleChildren( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL + getSelectedAccessibleChildCount( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + deselectAccessibleChild( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + ///===== XSelectionListener ============================================= + + virtual void SAL_CALL selectionChanged( const ::com::sun::star::lang::EventObject& aEvent ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo =================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(void) + throw (::com::sun::star::uno::RuntimeException); + + /** Returns a list of all supported services. + */ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL + getSupportedServiceNames(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XTypeProvider =================================================== + + /// returns the possible types + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL + getTypes() + 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); + + ///===== IAccessibleViewForwarder ======================================== + + /** This method informs you about the state of the forwarder. Do not + use it when the returned value is <false/>. + + @return + Return <true/> if the view forwarder is valid and <false/> else. + */ + virtual sal_Bool IsValid (void) const; + + /** Returns the area of the underlying document that is visible in the + * corresponding window. + + @return + The rectangle of the visible part of the document. The values + are, contrary to the base class, in internal coordinates. + */ + virtual Rectangle GetVisibleArea() const; + + /** Transform the specified point from internal coordinates to an + absolute screen position. + + @param rPoint + Point in internal coordinates. + + @return + The same point but in screen coordinates relative to the upper + left corner of the (current) screen. + */ + virtual Point LogicToPixel (const Point& rPoint) const; + + /** Transform the specified size from internal coordinates to a screen + * oriented pixel size. + + @param rSize + Size in internal coordinates. + + @return + The same size but in screen coordinates. + */ + virtual Size LogicToPixel (const Size& rSize) const; + + /** Transform the specified point from absolute screen coordinates to + internal coordinates. + + @param rPoint + Point in screen coordinates relative to the upper left corner of + the (current) screen. + + @return + The same point but in internal coordinates. + */ + virtual Point PixelToLogic (const Point& rPoint) const; + + /** Transform the specified size from screen coordinates to internal + coordinates. + + @param rSize + Size in screen coordinates. + + @return + The same size but in internal coordinates. + */ + virtual Size PixelToLogic (const Size& rSize) const; + + ///======== internal ===================================================== + + utl::AccessibleRelationSetHelper* GetRelationSet(const ScAddress* pAddress) const; + + ::com::sun::star::uno::Reference + < ::com::sun::star::accessibility::XAccessible > + GetAccessibleSpreadsheet(); + +protected: + /// Return this object's description. + virtual ::rtl::OUString SAL_CALL + createAccessibleDescription(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + createAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the desktop. + virtual Rectangle GetBoundingBoxOnScreen(void) const + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the parent object. + virtual Rectangle GetBoundingBox(void) const + throw (::com::sun::star::uno::RuntimeException); + +private: + ScTabViewShell* mpViewShell; + ScSplitPos meSplitPos; + ScAccessibleSpreadsheet* mpAccessibleSpreadsheet; + ScChildrenShapes* mpChildrenShapes; + ScAccessibleEditObject* mpTempAccEdit; + com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible> mxTempAcc; + Rectangle maVisArea; + sal_Bool mbCompleteSheetSelected; + +public: + SCTAB getVisibleTable() const; // use it in ScChildrenShapes + +private: + void FreeAccessibleSpreadsheet(); + + sal_Bool IsTableSelected() const; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + sal_Bool IsEditable( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + + void AddChild(const com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible>& xAcc, sal_Bool bFireEvent); + void RemoveChild(const com::sun::star::uno::Reference<com::sun::star::accessibility::XAccessible>& xAcc, sal_Bool bFireEvent); + + rtl::OUString GetCurrentCellName() const; + rtl::OUString GetCurrentCellDescription() const; + + Rectangle GetVisibleArea_Impl() const; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleDocumentBase.hxx b/sc/source/ui/inc/AccessibleDocumentBase.hxx new file mode 100644 index 000000000000..eeab25f7af1c --- /dev/null +++ b/sc/source/ui/inc/AccessibleDocumentBase.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEDOCUMENTBASE_HXX +#define _SC_ACCESSIBLEDOCUMENTBASE_HXX + +#include "AccessibleContextBase.hxx" + +class ScAccessibleDocumentBase + : public ScAccessibleContextBase +{ +public: + //===== internal ======================================================== + ScAccessibleDocumentBase( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent); +protected: + virtual ~ScAccessibleDocumentBase (void); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx new file mode 100644 index 000000000000..b524c6f5ffa3 --- /dev/null +++ b/sc/source/ui/inc/AccessibleDocumentPagePreview.hxx @@ -0,0 +1,157 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEDOCUMENTPAGEPREVIEW_HXX +#define _SC_ACCESSIBLEDOCUMENTPAGEPREVIEW_HXX + +#include "AccessibleDocumentBase.hxx" + +class ScPreviewShell; +class ScNotesChilds; +class ScShapeChilds; +class ScAccessiblePreviewTable; +class ScAccessiblePageHeader; + +class ScAccessibleDocumentPagePreview + : public ScAccessibleDocumentBase +{ +public: + //===== internal ======================================================== + ScAccessibleDocumentPagePreview( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScPreviewShell* pViewShell ); +protected: + virtual ~ScAccessibleDocumentPagePreview(void); + + using ScAccessibleDocumentBase::IsDefunc; + +public: + using ScAccessibleContextBase::disposing; + + virtual void SAL_CALL disposing(); + + ///===== SfxListener ===================================================== + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + ///===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( + const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL grabFocus( ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + virtual sal_Int32 SAL_CALL + getAccessibleChildCount(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the specified child or NULL if index is invalid. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Return the set of current states. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(void) + throw (::com::sun::star::uno::RuntimeException); + + /** Returns a list of all supported services. + */ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL + 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); + + ///===== internal ======================================================== + +protected: + /// Return this object's description. + virtual ::rtl::OUString SAL_CALL + createAccessibleDescription(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + createAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); + +public: // needed in ScShapeChilds + /// Return the object's current bounding box relative to the desktop. + virtual Rectangle GetBoundingBoxOnScreen(void) const + throw (::com::sun::star::uno::RuntimeException); + +protected: + /// Return the object's current bounding box relative to the parent object. + virtual Rectangle GetBoundingBox(void) const + throw (::com::sun::star::uno::RuntimeException); + +private: + ScPreviewShell* mpViewShell; + ScNotesChilds* mpNotesChilds; + ScShapeChilds* mpShapeChilds; + ScAccessiblePreviewTable* mpTable; + ScAccessiblePageHeader* mpHeader; + ScAccessiblePageHeader* mpFooter; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + + ScNotesChilds* GetNotesChilds(); + ScShapeChilds* GetShapeChilds(); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleEditObject.hxx b/sc/source/ui/inc/AccessibleEditObject.hxx new file mode 100644 index 000000000000..5dd40f7c0d62 --- /dev/null +++ b/sc/source/ui/inc/AccessibleEditObject.hxx @@ -0,0 +1,181 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEEDITOBJECT_HXX +#define _SC_ACCESSIBLEEDITOBJECT_HXX + +#include "AccessibleContextBase.hxx" + +namespace accessibility +{ + class AccessibleTextHelper; +} +class EditView; +class Window; + +enum EditObjectType +{ + CellInEditMode, + EditLine, + EditControl +}; + +/** @descr + This base class provides an implementation of the + <code>AccessibleCell</code> service. +*/ +class ScAccessibleEditObject + : public ScAccessibleContextBase +{ +public: + //===== internal ======================================================== + ScAccessibleEditObject( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + EditView* pEditView, Window* pWin, const rtl::OUString& rName, + const rtl::OUString& rDescription, EditObjectType eObjectType); + +protected: + virtual ~ScAccessibleEditObject(); + + using ScAccessibleContextBase::IsDefunc; + +public: + using ScAccessibleContextBase::addEventListener; + using ScAccessibleContextBase::removeEventListener; + using ScAccessibleContextBase::disposing; + + virtual void SAL_CALL disposing(); + + virtual void LostFocus(); + + virtual void GotFocus(); + + ///===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( + const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + +protected: + /// Return the object's current bounding box relative to the desktop. + virtual Rectangle GetBoundingBoxOnScreen(void) const + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the parent object. + virtual Rectangle GetBoundingBox(void) const + throw (::com::sun::star::uno::RuntimeException); + +public: + ///===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + // is overloaded to calculate this on demand + virtual sal_Int32 SAL_CALL + getAccessibleChildCount(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the specified child or NULL if index is invalid. + // is overloaded to calculate this on demand + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Return the set of current states. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + +protected: + /// Return this object's description. + virtual ::rtl::OUString SAL_CALL + createAccessibleDescription(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + createAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); + +public: + ///===== XAccessibleEventBroadcaster ===================================== + + /** Add listener that is informed of future changes of name, + description and so on events. + */ + virtual void SAL_CALL + addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + + // Remove an existing event listener. + virtual void SAL_CALL + removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(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: + accessibility::AccessibleTextHelper* mpTextHelper; + EditView* mpEditView; + Window* mpWindow; + EditObjectType meObjectType; + sal_Bool mbHasFocus; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + + void CreateTextHelper(); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessiblePageHeader.hxx b/sc/source/ui/inc/AccessiblePageHeader.hxx new file mode 100644 index 000000000000..b3598adf7469 --- /dev/null +++ b/sc/source/ui/inc/AccessiblePageHeader.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + /************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEPAGEHEADER_HXX +#define _SC_ACCESSIBLEPAGEHEADER_HXX + +#include "AccessibleContextBase.hxx" +#include <editeng/svxenum.hxx> + +class ScPreviewShell; +class EditTextObject; +class ScAccessiblePageHeaderArea; +class ScPreviewShell; + +class ScAccessiblePageHeader : public ScAccessibleContextBase +{ +public: + ScAccessiblePageHeader( const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScPreviewShell* pViewShell, sal_Bool bHeader, sal_Int32 nIndex ); + +protected: + virtual ~ScAccessiblePageHeader(); + + using ScAccessibleContextBase::IsDefunc; + +public: + using ScAccessibleContextBase::disposing; + virtual void SAL_CALL disposing(); + + //===== SfxListener ===================================================== + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + //===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus() throw (::com::sun::star::uno::RuntimeException); + + //===== XAccessibleContext ============================================== + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 i ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL + getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException); + + //===== XServiceInfo ==================================================== + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw(::com::sun::star::uno::RuntimeException); + + //===== internal ======================================================== + void SetCurrentIndexInParent(sal_Int32 nNew) { mnIndex = nNew; } + +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); + + virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException); + virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException); + +private: + ScPreviewShell* mpViewShell; + sal_Int32 mnIndex; + sal_Bool mbHeader; + typedef std::vector< ScAccessiblePageHeaderArea* > ScHFAreas; + ScHFAreas maAreas; + sal_Int32 mnChildCount; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + + void AddChild(const EditTextObject* pArea, sal_uInt32 nIndex, SvxAdjust eAdjust); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessiblePageHeaderArea.hxx b/sc/source/ui/inc/AccessiblePageHeaderArea.hxx new file mode 100644 index 000000000000..3f907e5609ed --- /dev/null +++ b/sc/source/ui/inc/AccessiblePageHeaderArea.hxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEPAGEHEADERAREA_HXX +#define _SC_ACCESSIBLEPAGEHEADERAREA_HXX + +#include "AccessibleContextBase.hxx" +#include <editeng/svxenum.hxx> + +class EditTextObject; +namespace accessibility +{ + class AccessibleTextHelper; +} +class ScPreviewShell; + +class ScAccessiblePageHeaderArea + : public ScAccessibleContextBase +{ +public: + //===== internal ======================================================== + ScAccessiblePageHeaderArea( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScPreviewShell* pViewShell, + const EditTextObject* pEditObj, + sal_Bool bHeader, + SvxAdjust eAdjust); +protected: + virtual ~ScAccessiblePageHeaderArea (void); +public: + const EditTextObject* GetEditTextObject() const { return mpEditObj; } + + using ScAccessibleContextBase::disposing; + virtual void SAL_CALL disposing(); + + ///===== SfxListener ===================================================== + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + ///===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( + const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + // is overloaded to calculate this on demand + virtual sal_Int32 SAL_CALL + getAccessibleChildCount(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the specified child or NULL if index is invalid. + // is overloaded to calculate this on demand + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Return the set of current states. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(void) + throw (::com::sun::star::uno::RuntimeException); + + /** Returns a list of all supported services. In this case that is just + the AccessibleContext and Accessible service. + */ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL + 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: + 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); + + virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException); + virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException); + +private: + EditTextObject* mpEditObj; + accessibility::AccessibleTextHelper* mpTextHelper; + ScPreviewShell* mpViewShell; + sal_Bool mbHeader; + SvxAdjust meAdjust; + + void CreateTextHelper(); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessiblePreviewCell.hxx b/sc/source/ui/inc/AccessiblePreviewCell.hxx new file mode 100644 index 000000000000..02090ad207f9 --- /dev/null +++ b/sc/source/ui/inc/AccessiblePreviewCell.hxx @@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEPREVIEWCELL_HXX +#define _SC_ACCESSIBLEPREVIEWCELL_HXX + +#include "AccessibleCellBase.hxx" + +class ScPreviewShell; + +namespace accessibility +{ + class AccessibleTextHelper; +} + +class ScAccessiblePreviewCell : public ScAccessibleCellBase +{ +public: + //===== internal ======================================================== + ScAccessiblePreviewCell( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScPreviewShell* pViewShell, /* const */ ScAddress& rCellAddress, sal_Int32 nIndex ); + +protected: + virtual ~ScAccessiblePreviewCell(); + + using ScAccessibleCellBase::IsDefunc; + +public: + using ScAccessibleCellBase::disposing; + virtual void SAL_CALL disposing(); + + ///===== SfxListener ===================================================== + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + //===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus() throw (::com::sun::star::uno::RuntimeException); + + //===== XAccessibleContext ============================================== + + // overloaded to calculate this on demand + virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 i ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL + getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException); + + //===== XServiceInfo ==================================================== + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw(::com::sun::star::uno::RuntimeException); + 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) const throw(::com::sun::star::uno::RuntimeException); + virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException); + +private: + ScPreviewShell* mpViewShell; + + accessibility::AccessibleTextHelper* mpTextHelper; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + virtual sal_Bool IsEditable( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + sal_Bool IsOpaque( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + + void CreateTextHelper(); + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx new file mode 100644 index 000000000000..f3e8d7b29ea3 --- /dev/null +++ b/sc/source/ui/inc/AccessiblePreviewHeaderCell.hxx @@ -0,0 +1,155 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEPREVIEWHEADERCELL_HXX +#define _SC_ACCESSIBLEPREVIEWHEADERCELL_HXX + +#include "AccessibleContextBase.hxx" +#include <com/sun/star/accessibility/XAccessibleValue.hpp> +#include <tools/gen.hxx> +#include "global.hxx" +#include "address.hxx" +#include <cppuhelper/implbase1.hxx> + +class ScPreviewShell; +class ScPreviewTableInfo; +namespace accessibility { + class AccessibleTextHelper; +} + +typedef cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleValue> + ScAccessiblePreviewHeaderCellImpl; + +class ScAccessiblePreviewHeaderCell : + public ScAccessibleContextBase, + public ScAccessiblePreviewHeaderCellImpl +{ +public: + ScAccessiblePreviewHeaderCell( const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScPreviewShell* pViewShell, + const ScAddress& rCellPos, sal_Bool bIsColHdr, sal_Bool bIsRowHdr, + sal_Int32 nIndex ); + +protected: + virtual ~ScAccessiblePreviewHeaderCell(); + + using ScAccessibleContextBase::IsDefunc; + +public: + using ScAccessibleContextBase::disposing; + virtual void SAL_CALL disposing(); + + //===== SfxListener ===================================================== + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + ///===== XInterface ===================================================== + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + + virtual void SAL_CALL release() throw (); + + //===== XAccessibleValue ================================================ + + virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue() throw (::com::sun::star::uno::RuntimeException); + + //===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus() throw (::com::sun::star::uno::RuntimeException); + + //===== XAccessibleContext ============================================== + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 i ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL + getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException); + + //===== XServiceInfo ==================================================== + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw(::com::sun::star::uno::RuntimeException); + + ///===== XTypeProvider =================================================== + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL + getTypes() + 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: + 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); + + virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException); + virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException); + +private: + ScPreviewShell* mpViewShell; + accessibility::AccessibleTextHelper* mpTextHelper; + sal_Int32 mnIndex; + ScAddress maCellPos; + sal_Bool mbColumnHeader; + sal_Bool mbRowHeader; + mutable ScPreviewTableInfo* mpTableInfo; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + + void CreateTextHelper(); + void FillTableInfo() const; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessiblePreviewTable.hxx b/sc/source/ui/inc/AccessiblePreviewTable.hxx new file mode 100644 index 000000000000..9dfbcfbd6662 --- /dev/null +++ b/sc/source/ui/inc/AccessiblePreviewTable.hxx @@ -0,0 +1,185 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLEPREVIEWTABLE_HXX +#define _SC_ACCESSIBLEPREVIEWTABLE_HXX + +#include "AccessibleContextBase.hxx" +#include <com/sun/star/accessibility/XAccessibleTable.hpp> +#include <cppuhelper/implbase1.hxx> + +class ScPreviewShell; +class ScPreviewTableInfo; + +typedef cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleTable> + ScAccessiblePreviewTableImpl; + +class ScAccessiblePreviewTable : + public ScAccessibleContextBase, + public ScAccessiblePreviewTableImpl +{ +public: + ScAccessiblePreviewTable( const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScPreviewShell* pViewShell, sal_Int32 nIndex ); + +protected: + virtual ~ScAccessiblePreviewTable(); + + using ScAccessibleContextBase::IsDefunc; + +public: + using ScAccessibleContextBase::disposing; + virtual void SAL_CALL disposing(); + + //===== SfxListener ===================================================== + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + ///===== XInterface ===================================================== + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + + virtual void SAL_CALL release() throw (); + + //===== XAccessibleTable ================================================ + + virtual sal_Int32 SAL_CALL getAccessibleRowCount() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleColumnCount() throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleRowDescription( sal_Int32 nRow ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleColumnDescription( sal_Int32 nColumn ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleRows() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getSelectedAccessibleColumns() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAccessibleRowSelected( sal_Int32 nRow ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAccessibleColumnSelected( sal_Int32 nColumn ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleCaption() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleSummary() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleRow( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleColumn( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + //===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus() throw (::com::sun::star::uno::RuntimeException); + + //===== XAccessibleContext ============================================== + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleChild( sal_Int32 i ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAccessibleIndexInParent() throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL + getAccessibleStateSet() throw (::com::sun::star::uno::RuntimeException); + + //===== XServiceInfo ==================================================== + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw(::com::sun::star::uno::RuntimeException); + + //===== XTypeProvider =================================================== + + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL + getTypes() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw(::com::sun::star::uno::RuntimeException); + + //===== internal ======================================================== + void SetCurrentIndexInParent(sal_Int32 nNew) { mnIndex = nNew; } + +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); + + virtual Rectangle GetBoundingBoxOnScreen(void) const throw(::com::sun::star::uno::RuntimeException); + virtual Rectangle GetBoundingBox(void) const throw (::com::sun::star::uno::RuntimeException); + +private: + ScPreviewShell* mpViewShell; + sal_Int32 mnIndex; + mutable ScPreviewTableInfo* mpTableInfo; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + + void FillTableInfo() const; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleSpreadsheet.hxx b/sc/source/ui/inc/AccessibleSpreadsheet.hxx new file mode 100644 index 000000000000..428e1744e622 --- /dev/null +++ b/sc/source/ui/inc/AccessibleSpreadsheet.hxx @@ -0,0 +1,288 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLESPREADSHEET_HXX +#define _SC_ACCESSIBLESPREADSHEET_HXX + +#include "AccessibleTableBase.hxx" +#include "viewdata.hxx" + +#include <vector> + +class ScMyAddress : public ScAddress +{ +public: + ScMyAddress() : ScAddress() {} + ScMyAddress(SCCOL nColP, SCROW nRowP, SCTAB nTabP) : ScAddress(nColP, nRowP, nTabP) {} + ScMyAddress(const ScAddress& rAddress) : ScAddress(rAddress) {} + + sal_Bool operator< ( const ScMyAddress& rAddress ) const + { + if( Row() != rAddress.Row() ) + return (Row() < rAddress.Row()); + else + return (Col() < rAddress.Col()); + } +}; + +class ScTabViewShell; +class ScAccessibleDocument; +class ScAccessibleCell; + +/** @descr + This base class provides an implementation of the + <code>AccessibleTable</code> service. +*/ +class ScAccessibleSpreadsheet + : public ScAccessibleTableBase +{ +public: + //===== internal ======================================================== + ScAccessibleSpreadsheet( + ScAccessibleDocument* pAccDoc, + ScTabViewShell* pViewShell, + SCTAB nTab, + ScSplitPos eSplitPos); +protected: + ScAccessibleSpreadsheet( + ScAccessibleSpreadsheet& rParent, + const ScRange& rRange ); + + virtual ~ScAccessibleSpreadsheet(); + + void ConstructScAccessibleSpreadsheet( + ScAccessibleDocument* pAccDoc, + ScTabViewShell* pViewShell, + SCTAB nTab, + ScSplitPos eSplitPos); + + using ScAccessibleTableBase::IsDefunc; + +public: + using ScAccessibleTableBase::addEventListener; + using ScAccessibleTableBase::disposing; + + virtual void SAL_CALL disposing(); + + void CompleteSelectionChanged(sal_Bool bNewState); + + virtual void LostFocus(); + virtual void GotFocus(); + + void BoundingBoxChanged(); + void VisAreaChanged(); + + ///===== SfxListener ===================================================== + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + ///===== XAccessibleTable ================================================ + + /// Returns the row headers as an AccessibleTable. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the column headers as an AccessibleTable. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the selected rows in a table. + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleRows( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the selected columns in a table. + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleColumns( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns a boolean value indicating whether the specified row is selected. + virtual sal_Bool SAL_CALL + isAccessibleRowSelected( sal_Int32 nRow ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns a boolean value indicating whether the specified column is selected. + virtual sal_Bool SAL_CALL + isAccessibleColumnSelected( sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns the Accessible at a specified row and column in the table. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + ScAccessibleCell* GetAccessibleCellAt(sal_Int32 nRow, sal_Int32 nColumn); + + /// Returns a boolean value indicating whether the accessible at a specified row and column is selected. + virtual sal_Bool SAL_CALL + isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + ///===== XAccessibleComponent ============================================ + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( + const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL grabFocus( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getForeground( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground( ) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleContext ============================================== + + /// Return NULL to indicate that an empty relation set. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL + getAccessibleRelationSet(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the set of current states. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleSelection =========================================== + + virtual void SAL_CALL + selectAccessibleChild( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + clearAccessibleSelection( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + selectAllAccessibleChildren( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL + getSelectedAccessibleChildCount( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + deselectAccessibleChild( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo ==================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(void) + throw (::com::sun::star::uno::RuntimeException); + + /** Returns a list of all supported services. + */ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL + 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); + + ///===== XAccessibleEventBroadcaster ===================================== + + /** Add listener that is informed of future changes of name, + description and so on events. + */ + virtual void SAL_CALL + addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + +protected: + /// Return the object's current bounding box relative to the desktop. + virtual Rectangle GetBoundingBoxOnScreen(void) const + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current bounding box relative to the parent object. + virtual Rectangle GetBoundingBox(void) const + throw (::com::sun::star::uno::RuntimeException); +private: + ScTabViewShell* mpViewShell; + ScRangeList* mpMarkedRanges; + std::vector<ScMyAddress>* mpSortedMarkedCells; + ScAccessibleDocument* mpAccDoc; + ScAccessibleCell* mpAccCell; + Rectangle maVisCells; + ScSplitPos meSplitPos; + ScAddress maActiveCell; + SCTAB mnTab; + sal_Bool mbIsSpreadsheet; + sal_Bool mbHasSelection; + sal_Bool mbDelIns; + sal_Bool mbIsFocusSend; + + sal_Bool IsDefunc( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + sal_Bool IsEditable( + const com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet>& rxParentStates); + sal_Bool IsFocused(); + sal_Bool IsCompleteSheetSelected(); + + void SelectCell(sal_Int32 nRow, sal_Int32 nCol, sal_Bool bDeselect); + void CreateSortedMarkedCells(); + void AddMarkedRange(const ScRange& rRange); + + ScDocument* GetDocument(ScTabViewShell* pViewShell); + Rectangle GetVisArea(ScTabViewShell* pViewShell, ScSplitPos eSplitPos); + Rectangle GetVisCells(const Rectangle& rVisArea); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleTableBase.hxx b/sc/source/ui/inc/AccessibleTableBase.hxx new file mode 100644 index 000000000000..e436b623397e --- /dev/null +++ b/sc/source/ui/inc/AccessibleTableBase.hxx @@ -0,0 +1,301 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef _SC_ACCESSIBLETABLEBASE_HXX +#define _SC_ACCESSIBLETABLEBASE_HXX + +#include "AccessibleContextBase.hxx" +#include "global.hxx" +#include "address.hxx" +#include <com/sun/star/accessibility/XAccessibleTable.hpp> +#include <com/sun/star/accessibility/XAccessibleSelection.hpp> +#include <cppuhelper/implbase2.hxx> + +class ScTabViewShell; + +/** @descr + This base class provides an implementation of the + <code>AccessibleTable</code> service. +*/ + +typedef cppu::ImplHelper2< ::com::sun::star::accessibility::XAccessibleTable, + ::com::sun::star::accessibility::XAccessibleSelection> + ScAccessibleTableBaseImpl; + +class ScAccessibleTableBase : + public ScAccessibleContextBase, + public ScAccessibleTableBaseImpl +{ +public: + //===== internal ======================================================== + ScAccessibleTableBase( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScDocument* pDoc, + const ScRange& rRange); +protected: + virtual ~ScAccessibleTableBase(); +public: + + using ScAccessibleContextBase::disposing; + virtual void SAL_CALL disposing(); + + ///===== XInterface ===================================================== + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + + virtual void SAL_CALL release() throw (); + + ///===== XAccessibleTable ================================================ + + /// Returns the number of rows in the table. + virtual sal_Int32 SAL_CALL + getAccessibleRowCount( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the number of columns in the table. + virtual sal_Int32 SAL_CALL + getAccessibleColumnCount( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the description of the specified row in the table. + virtual ::rtl::OUString SAL_CALL + getAccessibleRowDescription( sal_Int32 nRow ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns the description text of the specified column in the table. + virtual ::rtl::OUString SAL_CALL + getAccessibleColumnDescription( sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /** Returns the number of rows occupied by the Accessible at a specified row and column in the table. + Returns 1 if it is only a cell and the number of rows the cell is merged if the cell is a merged cell. + */ + virtual sal_Int32 SAL_CALL + getAccessibleRowExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /** Returns the number of columns occupied by the Accessible at a specified row and column in the table. + Returns 1 if it is only a cell and the number of columns the cell is merged if the cell is a merged cell. + */ + virtual sal_Int32 SAL_CALL + getAccessibleColumnExtentAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns the row headers as an AccessibleTable. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleRowHeaders( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the column headers as an AccessibleTable. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleTable > SAL_CALL + getAccessibleColumnHeaders( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the selected rows in a table. + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleRows( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the selected columns in a table. + virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL + getSelectedAccessibleColumns( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns a boolean value indicating whether the specified row is selected. + virtual sal_Bool SAL_CALL + isAccessibleRowSelected( sal_Int32 nRow ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns a boolean value indicating whether the specified column is selected. + virtual sal_Bool SAL_CALL + isAccessibleColumnSelected( sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns the Accessible at a specified row and column in the table. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleCellAt( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns the caption for the table. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleCaption( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns the summary description of the table. + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getAccessibleSummary( ) + throw (::com::sun::star::uno::RuntimeException); + + /// Returns a boolean value indicating whether the accessible at a specified row and column is selected. + virtual sal_Bool SAL_CALL + isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + ///===== XAccessibleExtendedTable ======================================== + + /// Returns the index of the cell on the given position. + virtual sal_Int32 SAL_CALL + getAccessibleIndex( sal_Int32 nRow, sal_Int32 nColumn ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns the row number of an index in the table. + virtual sal_Int32 SAL_CALL + getAccessibleRow( sal_Int32 nChildIndex ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + /// Returns the column number of an index in the table. + virtual sal_Int32 SAL_CALL + getAccessibleColumn( sal_Int32 nChildIndex ) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + + //===== XAccessibleContext ============================================== + + /// Return the number of currently visible children. + // is overloaded to calculate this on demand + virtual sal_Int32 SAL_CALL + getAccessibleChildCount(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the specified child or NULL if index is invalid. + // is overloaded to calculate this on demand + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException); + +protected: + /// Return this object's description. + virtual ::rtl::OUString SAL_CALL + createAccessibleDescription(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the object's current name. + virtual ::rtl::OUString SAL_CALL + createAccessibleName(void) + throw (::com::sun::star::uno::RuntimeException); + +public: + /// Return NULL to indicate that an empty relation set. + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL + getAccessibleRelationSet(void) + throw (::com::sun::star::uno::RuntimeException); + + /// Return the set of current states. + // perhaps sometimes to be implemented + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XAccessibleSelection =========================================== + + virtual void SAL_CALL + selectAccessibleChild( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL + isAccessibleChildSelected( sal_Int32 nChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + clearAccessibleSelection( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + selectAllAccessibleChildren( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL + getSelectedAccessibleChildCount( ) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL + getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL + deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + + ///===== XServiceInfo =================================================== + + /** Returns an identifier for the implementation of this object. + */ + virtual ::rtl::OUString SAL_CALL + getImplementationName(void) + throw (::com::sun::star::uno::RuntimeException); + + ///===== XTypeProvider =================================================== + + /// returns the possible types + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL + getTypes() + 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; + + ScDocument* mpDoc; + + void CommitTableModelChange(sal_Int32 nStartRow, sal_Int32 nStartCol, sal_Int32 nEndRow, sal_Int32 nEndCol, sal_uInt16 nId); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/AccessibleText.hxx b/sc/source/ui/inc/AccessibleText.hxx new file mode 100644 index 000000000000..43d3c1aba20d --- /dev/null +++ b/sc/source/ui/inc/AccessibleText.hxx @@ -0,0 +1,360 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SC_ACCESSIBLETEXT_HXX +#define _SC_ACCESSIBLETEXT_HXX + +#include "textuno.hxx" +#include "global.hxx" +#include "viewdata.hxx" +#include <editeng/svxenum.hxx> + +#include <memory> + +class ScDocShell; +class ScViewForwarder; +class ScEditObjectViewForwarder; +class ScPreviewViewForwarder; +class ScEditViewForwarder; +class ScPreviewShell; +class EditTextObject; +class ScCsvViewForwarder; +class ScAccessibleCell; + + +// ============================================================================ + +class ScAccessibleTextData : public SfxListener +{ +public: + ScAccessibleTextData() {} + virtual ~ScAccessibleTextData() {} + + virtual ScAccessibleTextData* Clone() const = 0; + + virtual void Notify( SfxBroadcaster& /* rBC */, const SfxHint& /* rHint */ ) {} + + virtual SvxTextForwarder* GetTextForwarder() = 0; + virtual SvxViewForwarder* GetViewForwarder() = 0; + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate ) = 0; + virtual SfxBroadcaster& GetBroadcaster() const { return maBroadcaster; } + + virtual void UpdateData() = 0; + virtual void SetDoUpdate(sal_Bool bValue) = 0; + virtual sal_Bool IsDirty() const = 0; + +private: + mutable SfxBroadcaster maBroadcaster; + + // prevent the using of this method of the base class + ScSharedCellEditSource* GetOriginalSource() { return NULL; } +}; + + +// ============================================================================ + +class ScAccessibleCellBaseTextData : public ScAccessibleTextData, + public ScCellTextData +{ +public: + ScAccessibleCellBaseTextData(ScDocShell* pDocShellP, + const ScAddress& rP) + : ScCellTextData(pDocShellP, rP) {} + virtual ~ScAccessibleCellBaseTextData() {} + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { ScCellTextData::Notify(rBC, rHint); } + + virtual void UpdateData() { ScCellTextData::UpdateData(); } + virtual void SetDoUpdate(sal_Bool bValue) { ScCellTextData::SetDoUpdate(bValue); } + virtual sal_Bool IsDirty() const { return ScCellTextData::IsDirty(); } +}; + + +// ============================================================================ + +// ScAccessibleCellTextData: shared data between sub objects of a accessible cell text object + +class ScAccessibleCellTextData : public ScAccessibleCellBaseTextData +{ +public: + ScAccessibleCellTextData(ScTabViewShell* pViewShell, + const ScAddress& rP, ScSplitPos eSplitPos, ScAccessibleCell* pAccCell); + virtual ~ScAccessibleCellTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate ); + + DECL_LINK( NotifyHdl, EENotify* ); +protected: + virtual void GetCellText(const ScAddress& rCellPos, String& rText); +private: + ScViewForwarder* mpViewForwarder; + ScEditViewForwarder* mpEditViewForwarder; + ScTabViewShell* mpViewShell; + ScSplitPos meSplitPos; + sal_Bool mbViewEditEngine; + ScAccessibleCell* mpAccessibleCell; + + // prevent the using of this method of the base class + ScSharedCellEditSource* GetOriginalSource() { return NULL; } + + using ScAccessibleCellBaseTextData::GetDocShell; + ScDocShell* GetDocShell(ScTabViewShell* pViewShell); +}; + + +// ============================================================================ + +class ScAccessibleEditObjectTextData : public ScAccessibleTextData +{ +public: + ScAccessibleEditObjectTextData(EditView* pEditView, Window* pWin); + virtual ~ScAccessibleEditObjectTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate ); + + virtual void UpdateData() { } + virtual void SetDoUpdate(sal_Bool /* bValue */) { } + virtual sal_Bool IsDirty() const { return false; } + + DECL_LINK( NotifyHdl, EENotify* ); +protected: + ScEditObjectViewForwarder* mpViewForwarder; + ScEditViewForwarder* mpEditViewForwarder; + EditView* mpEditView; + EditEngine* mpEditEngine; + SvxEditEngineForwarder* mpForwarder; + Window* mpWindow; +}; + + +// ============================================================================ + +class ScAccessibleEditLineTextData : public ScAccessibleEditObjectTextData +{ +public: + ScAccessibleEditLineTextData(EditView* pEditView, Window* pWin); + virtual ~ScAccessibleEditLineTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate ); + + void Dispose(); + void TextChanged(); + void StartEdit(); + void EndEdit(); +private: + void ResetEditMode(); + + sal_Bool mbEditEngineCreated; +}; + + +// ============================================================================ + +class ScAccessiblePreviewCellTextData : public ScAccessibleCellBaseTextData +{ +public: + ScAccessiblePreviewCellTextData(ScPreviewShell* pViewShell, + const ScAddress& rP); + virtual ~ScAccessiblePreviewCellTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool /* bCreate */ ) { return NULL; } + +private: + ScPreviewViewForwarder* mpViewForwarder; + ScPreviewShell* mpViewShell; + + // prevent the using of this method of the base class + ScSharedCellEditSource* GetOriginalSource() { return NULL; } + + using ScAccessibleCellBaseTextData::GetDocShell; + ScDocShell* GetDocShell(ScPreviewShell* pViewShell); +}; + + +// ============================================================================ + +class ScAccessiblePreviewHeaderCellTextData : public ScAccessibleCellBaseTextData +{ +public: + ScAccessiblePreviewHeaderCellTextData(ScPreviewShell* pViewShell, + const String& rText, const ScAddress& rP, sal_Bool bColHeader, sal_Bool bRowHeader); + virtual ~ScAccessiblePreviewHeaderCellTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool /* bCreate */ ) { return NULL; } + +private: + ScPreviewViewForwarder* mpViewForwarder; + ScPreviewShell* mpViewShell; + String maText; + sal_Bool mbColHeader; + sal_Bool mbRowHeader; + + // prevent the using of this method of the base class + ScSharedCellEditSource* GetOriginalSource() { return NULL; } + + using ScAccessibleCellBaseTextData::GetDocShell; + ScDocShell* GetDocShell(ScPreviewShell* pViewShell); +}; + + +// ============================================================================ + +class ScAccessibleHeaderTextData : public ScAccessibleTextData +{ +public: + ScAccessibleHeaderTextData(ScPreviewShell* pViewShell, + const EditTextObject* pEditObj, sal_Bool bHeader, SvxAdjust eAdjust); + virtual ~ScAccessibleHeaderTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool /* bCreate */ ) { return NULL; } + + virtual void UpdateData() { } + virtual void SetDoUpdate(sal_Bool /* bValue */) { } + virtual sal_Bool IsDirty() const { return false; } +private: + ScPreviewViewForwarder* mpViewForwarder; + ScPreviewShell* mpViewShell; + ScEditEngineDefaulter* mpEditEngine; + SvxEditEngineForwarder* mpForwarder; + ScDocShell* mpDocSh; + const EditTextObject* mpEditObj; + sal_Bool mbHeader; + sal_Bool mbDataValid; + SvxAdjust meAdjust; +}; + + +// ============================================================================ + +class ScAccessibleNoteTextData : public ScAccessibleTextData +{ +public: + ScAccessibleNoteTextData(ScPreviewShell* pViewShell, + const String& sText, const ScAddress& aCellPos, sal_Bool bMarkNote); + virtual ~ScAccessibleNoteTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool /* bCreate */ ) { return NULL; } + + virtual void UpdateData() { } + virtual void SetDoUpdate(sal_Bool /* bValue */) { } + virtual sal_Bool IsDirty() const { return false; } +private: + ScPreviewViewForwarder* mpViewForwarder; + ScPreviewShell* mpViewShell; + ScEditEngineDefaulter* mpEditEngine; + SvxEditEngineForwarder* mpForwarder; + ScDocShell* mpDocSh; + String msText; + ScAddress maCellPos; + sal_Bool mbMarkNote; + sal_Bool mbDataValid; +}; + + +// ============================================================================ + +class ScAccessibleCsvTextData : public ScAccessibleTextData +{ +private: + typedef ::std::auto_ptr< SvxTextForwarder > TextForwarderPtr; + typedef ::std::auto_ptr< ScCsvViewForwarder > ViewForwarderPtr; + + Window* mpWindow; + EditEngine* mpEditEngine; + TextForwarderPtr mpTextForwarder; + ViewForwarderPtr mpViewForwarder; + String maCellText; + Rectangle maBoundBox; + Size maCellSize; + +public: + explicit ScAccessibleCsvTextData( + Window* pWindow, + EditEngine* pEditEngine, + const String& rCellText, + const Rectangle& rBoundBox, + const Size& rCellSize ); + virtual ~ScAccessibleCsvTextData(); + + virtual ScAccessibleTextData* Clone() const; + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SvxTextForwarder* GetTextForwarder(); + virtual SvxViewForwarder* GetViewForwarder(); + virtual SvxEditViewForwarder* GetEditViewForwarder( sal_Bool bCreate ); + + virtual void UpdateData() {} + virtual void SetDoUpdate( sal_Bool /* bValue */ ) {} + virtual sal_Bool IsDirty() const { return false; } +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/ChartRangeSelectionListener.hxx b/sc/source/ui/inc/ChartRangeSelectionListener.hxx new file mode 100644 index 000000000000..45127b333983 --- /dev/null +++ b/sc/source/ui/inc/ChartRangeSelectionListener.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_CHARTRANGESELECTIONLISTENER_HXX +#define SC_CHARTRANGESELECTIONLISTENER_HXX + +#include <cppuhelper/compbase2.hxx> +#include <comphelper/broadcasthelper.hxx> +#include <com/sun/star/view/XSelectionChangeListener.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> + +class ScTabViewShell; + +typedef ::cppu::WeakComponentImplHelper2< + ::com::sun::star::view::XSelectionChangeListener, + ::com::sun::star::lang::XServiceInfo > + ScChartRangeSelectionListener_Base; + +class ScChartRangeSelectionListener : + public comphelper::OBaseMutex, + public ScChartRangeSelectionListener_Base +{ +public: + explicit ScChartRangeSelectionListener( ScTabViewShell * pViewShell ); + virtual ~ScChartRangeSelectionListener(); + +protected: + // ____ XSelectionChangeListener ____ + virtual void SAL_CALL selectionChanged( + const ::com::sun::star::lang::EventObject& aEvent ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ XEventListener (base of XSelectionChangeListener) ____ + virtual void SAL_CALL disposing( + const ::com::sun::star::lang::EventObject& Source ) + throw (::com::sun::star::uno::RuntimeException); + + // ____ WeakComponentImplHelperBase ____ + // is called when dispose() is called at this component + virtual void SAL_CALL disposing(); + + // ____ XServiceInfo ____ + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& ServiceName ) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + +private: + ScTabViewShell * m_pViewShell; +}; + +// SC_CHARTRANGESELECTIONLISTENER_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/DrawModelBroadcaster.hxx b/sc/source/ui/inc/DrawModelBroadcaster.hxx new file mode 100644 index 000000000000..a3c56b722d58 --- /dev/null +++ b/sc/source/ui/inc/DrawModelBroadcaster.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SC_DRAWMODELBROADCASTER_HXX +#define _SC_DRAWMODELBROADCASTER_HXX + + +#include <svl/lstner.hxx> +#include <cppuhelper/interfacecontainer.h> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/document/XEventBroadcaster.hpp> + +class SdrModel; + +class ScDrawModelBroadcaster : public SfxListener, + public ::cppu::WeakImplHelper1< com::sun::star::document::XEventBroadcaster > +{ + mutable ::osl::Mutex maListenerMutex; + ::cppu::OInterfaceContainerHelper maEventListeners; + SdrModel *mpDrawModel; + +public: + + ScDrawModelBroadcaster( SdrModel *pDrawModel ); + virtual ~ScDrawModelBroadcaster(); + + virtual void SAL_CALL addEventListener( const com::sun::star::uno::Reference< com::sun::star::document::XEventListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( const com::sun::star::uno::Reference< com::sun::star::document::XEventListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/IAnyRefDialog.hxx b/sc/source/ui/inc/IAnyRefDialog.hxx new file mode 100644 index 000000000000..afd90f5305f3 --- /dev/null +++ b/sc/source/ui/inc/IAnyRefDialog.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_IANYREFDIALOG_HXX_INCLUDED +#define SC_IANYREFDIALOG_HXX_INCLUDED + +#include <formula/IControlReferenceHandler.hxx> + +class ScRange; +class ScDocument; +class ScTabViewShell; +class SfxObjectShell; +namespace formula +{ + class RefEdit; + class RefButton; +} +class SAL_NO_VTABLE IAnyRefDialog : public formula::IControlReferenceHandler +{ +public: + virtual ~IAnyRefDialog(){} + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) = 0; + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) = 0; + virtual void RefInputDone( sal_Bool bForced = false ) = 0; + virtual sal_Bool IsTableLocked() const = 0; + virtual sal_Bool IsRefInputMode() const = 0; + + virtual sal_Bool IsDocAllowed( SfxObjectShell* pDocSh ) const = 0; + virtual void AddRefEntry() = 0; + virtual void SetActive() = 0; + virtual void ViewShellChanged( ScTabViewShell* pScViewShell ) = 0; +}; + +#endif // SC_IANYREFDIALOG_HXX_INCLUDED + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/ScDevChart.hxx b/sc/source/ui/inc/ScDevChart.hxx new file mode 100644 index 000000000000..5f60bcec9a3e --- /dev/null +++ b/sc/source/ui/inc/ScDevChart.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_DEVCHARTCONFIG_HXX +#define INCLUDED_DEVCHARTCONFIG_HXX + +#include <unotools/configitem.hxx> + +namespace ScDevChart +{ + +class DevChartConfigItem : public ::utl::ConfigItem +{ +public: + DevChartConfigItem() : + ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Internal" )), + CONFIG_MODE_IMMEDIATE_UPDATE ) + {} + + bool UseDevelopmentChart(); +}; + +bool DevChartConfigItem::UseDevelopmentChart() +{ + bool bResult = false; + + ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames( 1 ); + aNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DevelopmentChart" )); + + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aResult( GetProperties( aNames )); + + OSL_ASSERT( aResult.getLength()); + aResult[0] >>= bResult; + + return bResult; +} + +/** States whether the new chart implementation or the old one should be used. + If <TRUE/> is returned the newly developed chart (chart2) should be used. + If <FALSE/> is returned, the old chart (sch) should be used. + + Config-Item: Office.Common/Internal:DevelopmentChart + + This function (the complete header) is only for a transitional period. It + will be deprecated after the new chart is definitely integrated into the + product. + */ +bool UseDevChart() +{ +// static DevChartConfigItem aCfgItem; +// return aCfgItem.UseDevelopmentChart(); + + // ignore configuration + //@todo: get rid of this class + return true; +} + +} // namespace ScDevChart + +// INCLUDED_DEVCHARTCONFIG_HXX +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/acredlin.hrc b/sc/source/ui/inc/acredlin.hrc new file mode 100644 index 000000000000..54ad490291af --- /dev/null +++ b/sc/source/ui/inc/acredlin.hrc @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // -> RID_SCDLG_CHANGES + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 5 + +#define CTR_REDLINING 10 +#define TP_FILTER 11 +#define TP_VIEW 12 + +#define FT_ASSIGN 14 +#define ED_ASSIGN 15 +#define RB_ASSIGN 16 + +#define STR_INSERT_COLS 20 +#define STR_INSERT_ROWS 21 +#define STR_INSERT_TABS 22 +#define STR_DELETE_COLS 23 +#define STR_DELETE_ROWS 24 +#define STR_DELETE_TABS 25 +#define STR_MOVE 26 +#define STR_CONTENT 27 +#define STR_REJECT 28 +#define STR_ACCEPTED 29 +#define STR_REJECTED 30 +#define STR_NO_ENTRY 31 +#define STR_CONTENT_WITH_CHILD 32 +#define STR_CHILD_CONTENT 33 +#define STR_CHILD_ORGCONTENT 34 +#define STR_EMPTY 35 + +// Bitmaps +#define BMP_STR_CLOSE 41 +#define BMP_STR_OPEN 42 +#define BMP_STR_END 43 +#define BMP_STR_ERROR 44 + +#define SC_CHANGES_COMMENT 49 +#define SC_SUB_SORT 50 +#define SC_SORT_ACTION 51 +#define SC_SORT_POSITION 52 +#define SC_SORT_AUTHOR 53 +#define SC_SORT_DATE 54 +#define SC_SORT_COMMENT 55 diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx new file mode 100644 index 000000000000..f984c2347fe5 --- /dev/null +++ b/sc/source/ui/inc/acredlin.hxx @@ -0,0 +1,257 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACREDLIN_HXX +#define SC_ACREDLIN_HXX + +#include <vcl/morebtn.hxx> +#include <vcl/combobox.hxx> +#include <vcl/group.hxx> +#include <svtools/headbar.hxx> +#include <svtools/svtabbx.hxx> + + +#include "rangenam.hxx" +#include "anyrefdg.hxx" +#include <vcl/lstbox.hxx> + +#include <svx/ctredlin.hxx> +#include <svx/simptabl.hxx> + +#ifndef _SVARRAY_HXX +#define _SVARRAY_HXX +#include <svl/svarray.hxx> +#endif +#include "chgtrack.hxx" +#include "chgviset.hxx" +#include <vcl/timer.hxx> + +class ScViewData; +class ScDocument; + +#define FLT_DATE_BEFORE 0 +#define FLT_DATE_SINCE 1 +#define FLT_DATE_EQUAL 2 +#define FLT_DATE_NOTEQUAL 3 +#define FLT_DATE_BETWEEN 4 +#define FLT_DATE_SAVE 5 + + +class ScViewEntryPtr +{ +private: + String* pAction; + String* pPos; + String* pAuthor; + String* pDate; + String* pComment; + void* pData; + +public: + + String* GetpAction() {return pAction; } + String* GetpPos() {return pPos; } + String* GetpAuthor() {return pAuthor; } + String* GetpDate() {return pDate; } + String* GetpComment() {return pComment;} + void* GetpData() {return pData; } + + void SetpAction (String* pString) {pAction= pString;} + void SetpPos (String* pString) {pPos = pString;} + void SetpAuthor (String* pString) {pAuthor= pString;} + void SetpDate (String* pString) {pDate = pString;} + void SetpComment(String* pString) {pComment=pString;} + void SetpData (void* pdata) {pData =pdata;} +}; + +class ScViewEntryPtrList +{ + ScViewEntryPtrList* pNext; + ScViewEntryPtrList* pLast; + + ScViewEntryPtr* pData; +}; + + +class ScRedlinData : public RedlinData +{ +public: + + ScRedlinData(); + ~ScRedlinData(); + SCTAB nTable; + SCCOL nCol; + SCROW nRow; + sal_uLong nActionNo; + sal_uLong nInfo; + sal_Bool bIsRejectable; + sal_Bool bIsAcceptable; +}; + +typedef long LExpNum; + +//@ Expand-Entrys nicht eindeutig, daher gestrichen +//DECLARE_TABLE( ScChgTrackExps, LExpNum) +//================================================================== + +class ScAcceptChgDlg : public SfxModelessDialog +{ +private: + + Timer aSelectionTimer; + Timer aReOpenTimer; + SvxAcceptChgCtr aAcceptChgCtr; + ScViewData* pViewData; + ScDocument* pDoc; + ScRangeName aLocalRangeName; + Selection theCurSel; + SvxTPFilter* pTPFilter; + SvxTPView* pTPView; + SvxRedlinTable* pTheView; // PB 2006/02/02 #i48648 now SvHeaderTabListBox + Size MinSize; + ScRangeList aRangeList; + ScChangeViewSettings aChangeViewSet; + String aStrInsertCols; + String aStrInsertRows; + String aStrInsertTabs; + String aStrDeleteCols; + String aStrDeleteRows; + String aStrDeleteTabs; + String aStrMove; + String aStrContent; + String aStrReject; + String aUnknown; + String aStrAllAccepted; + String aStrAllRejected; + String aStrNoEntry; + String aStrContentWithChild; + String aStrChildContent; + String aStrChildOrgContent; + String aStrEmpty; + sal_uLong nAcceptCount; + sal_uLong nRejectCount; + sal_Bool bAcceptEnableFlag; + sal_Bool bRejectEnableFlag; + sal_Bool bNeedsUpdate; + sal_Bool bIgnoreMsg; + sal_Bool bNoSelection; + sal_Bool bHasFilterEntry; + sal_Bool bUseColor; + //ScChgTrackExps aExpandArray; + + void Init(); + void InitFilter(); + + DECL_LINK( FilterHandle, SvxTPFilter* ); + DECL_LINK( RefHandle, SvxTPFilter* ); + DECL_LINK( FilterModified, SvxTPFilter* ); + DECL_LINK( MinSizeHandle, SvxAcceptChgCtr*); + DECL_LINK( RejectHandle, SvxTPView*); + DECL_LINK( AcceptHandle, SvxTPView*); + DECL_LINK( RejectAllHandle, SvxTPView*); + DECL_LINK( AcceptAllHandle, SvxTPView*); + DECL_LINK( ExpandingHandle, SvxRedlinTable*); + DECL_LINK( SelectHandle, SvxRedlinTable*); + DECL_LINK( RefInfoHandle, String*); + + DECL_LINK( UpdateSelectionHdl, Timer*); + DECL_LINK( ChgTrackModHdl, ScChangeTrack*); + DECL_LINK( CommandHdl, Control*); + DECL_LINK( ReOpenTimerHdl, Timer*); + DECL_LINK( ColCompareHdl, SvSortData*); + + + +protected: + + virtual void Resize(); + virtual sal_Bool Close(); + + void RejectFiltered(); + void AcceptFiltered(); + + sal_Bool IsValidAction(const ScChangeAction* pScChangeAction); + + String* MakeTypeString(ScChangeActionType eType); + + SvLBoxEntry* InsertChangeAction(const ScChangeAction* pScChangeAction,ScChangeActionState eState, + SvLBoxEntry* pParent=NULL,sal_Bool bDelMaster=false, + sal_Bool bDisabled=false,sal_uLong nPos=LIST_APPEND); + + SvLBoxEntry* InsertFilteredAction(const ScChangeAction* pScChangeAction,ScChangeActionState eState, + SvLBoxEntry* pParent=NULL,sal_Bool bDelMaster=false, + sal_Bool bDisabled=false,sal_uLong nPos=LIST_APPEND); + + + SvLBoxEntry* InsertChangeActionContent(const ScChangeActionContent* pScChangeAction, + SvLBoxEntry* pParent,sal_uLong nSpecial); + + void GetDependents( const ScChangeAction* pScChangeAction, + ScChangeActionTable& aActionTable, + SvLBoxEntry* pEntry); + + sal_Bool InsertContentChilds(ScChangeActionTable* pActionTable,SvLBoxEntry* pParent); + + sal_Bool InsertAcceptedORejected(SvLBoxEntry* pParent); + + sal_Bool InsertDeletedChilds(const ScChangeAction *pChangeAction, ScChangeActionTable* pActionTable, + SvLBoxEntry* pParent); + + sal_Bool InsertChilds(ScChangeActionTable* pActionTable,SvLBoxEntry* pParent); + + void AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartAction, sal_uLong nEndAction, + sal_uLong nPos=LIST_APPEND); + + void RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction); + void UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartAction,sal_uLong nEndAction); + + void UpdateView(); + void ClearView(); + + sal_Bool Expand(ScChangeTrack* pChanges,const ScChangeAction* pScChangeAction, + SvLBoxEntry* pEntry, sal_Bool bFilter=false); + +public: + ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScViewData* ptrViewData); + + ~ScAcceptChgDlg(); + + void ReInit(ScViewData* ptrViewData); + + virtual long PreNotify( NotifyEvent& rNEvt ); + + void Initialize (SfxChildWinInfo* pInfo); + virtual void FillInfo(SfxChildWinInfo&) const; + +}; + + +#endif // SC_NAMEDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx new file mode 100644 index 000000000000..8bca700a9122 --- /dev/null +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -0,0 +1,267 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ANYREFDG_HXX +#define SC_ANYREFDG_HXX + +#include <vcl/button.hxx> +#include <vcl/edit.hxx> +#include <vcl/accel.hxx> +#include <sfx2/basedlgs.hxx> +#include <sfx2/tabdlg.hxx> +#include "address.hxx" +#include "cell.hxx" +#include "compiler.hxx" +#include "formula/funcutl.hxx" +#include "IAnyRefDialog.hxx" +#include "scresid.hxx" +#include "scmod.hxx" + +#include <memory> + +class SfxObjectShell; +class ScRange; +class ScDocument; +class ScTabViewShell; +class ScRefHandler; +class ScRangeList; +class SfxShell; + +class ScFormulaReferenceHelper +{ + IAnyRefDialog* m_pDlg; + ::std::auto_ptr<ScFormulaCell> pRefCell; + ::std::auto_ptr<ScCompiler> pRefComp; + formula::RefEdit* pRefEdit; // aktives Eingabefeld + formula::RefButton* pRefBtn; // Button dazu + Window* m_pWindow; + SfxBindings* m_pBindings; + ::std::auto_ptr<Accelerator> + pAccel; // fuer Enter/Escape + sal_Bool* pHiddenMarks; // Merkfeld fuer versteckte Controls + SCTAB nRefTab; // used for ShowReference + + String sOldDialogText; // Originaltitel des Dialogfensters + Size aOldDialogSize; // Originalgroesse Dialogfenster + Point aOldEditPos; // Originalposition des Eingabefeldes + Size aOldEditSize; // Originalgroesse des Eingabefeldes + Point aOldButtonPos; // Originalpositiuon des Buttons + + sal_Bool bEnableColorRef; + sal_Bool bHighLightRef; + sal_Bool bAccInserted; + + DECL_LINK( AccelSelectHdl, Accelerator* ); + +public: + ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings); + ~ScFormulaReferenceHelper(); + + void ShowSimpleReference( const XubString& rStr ); + void ShowFormulaReference( const XubString& rStr ); + bool ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc ); + void Init(); + + void ShowReference( const XubString& rStr ); + void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + void HideReference( sal_Bool bDoneRefMode = sal_True ); + void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + void RefInputDone( sal_Bool bForced = false ); + void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + + inline void SetWindow(Window* _pWindow) { m_pWindow = _pWindow; } + sal_Bool DoClose( sal_uInt16 nId ); + void SetDispatcherLock( sal_Bool bLock ); + void EnableSpreadsheets( sal_Bool bFlag = sal_True, sal_Bool bChilds = sal_True ); + void ViewShellChanged( ScTabViewShell* pScViewShell ); + + static void enableInput(sal_Bool _bInput); + +protected: + Window * GetWindow(){ return m_pWindow; } + +public: + bool CanInputStart( const formula::RefEdit *pEdit ){ return !!pEdit; } + bool CanInputDone( sal_Bool bForced ){ return pRefEdit && (bForced || !pRefBtn); } +}; + +//============================================================================ + +class SC_DLLPUBLIC ScRefHandler : //public SfxModelessDialog, + public IAnyRefDialog +{ + Window & m_rWindow; + bool m_bInRefMode; + +public: + operator Window *(){ return &m_rWindow; } + Window * operator ->() { return static_cast<Window *>(*this); } + template<class,bool> friend class ScRefHdlrImplBase; + friend class formula::RefButton; + friend class formula::RefEdit; + +private: + ScFormulaReferenceHelper + m_aHelper; + SfxBindings* pMyBindings; + + Window* pActiveWin; + Timer aTimer; + String aDocName; // document on which the dialog was opened + + DECL_LINK( UpdateFocusHdl, Timer* ); + + +protected: + virtual sal_Bool DoClose( sal_uInt16 nId ); + + void SetDispatcherLock( sal_Bool bLock ); + + //Overwrite TWindow will implemented by ScRefHdlrImplBase + //virtual long PreNotify( NotifyEvent& rNEvt ); + + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + virtual void RefInputDone( sal_Bool bForced = false ); + void ShowSimpleReference( const XubString& rStr ); + void ShowFormulaReference( const XubString& rStr ); + + bool ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc ); + +public: + ScRefHandler( Window &rWindow, SfxBindings* pB/*, SfxChildWindow* pCW, + Window* pParent, sal_uInt16 nResId*/, bool bBindRef ); + virtual ~ScRefHandler(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) = 0; + virtual void AddRefEntry(); + + virtual sal_Bool IsRefInputMode() const; + virtual sal_Bool IsTableLocked() const; + virtual sal_Bool IsDocAllowed( SfxObjectShell* pDocSh ) const; + + virtual void ShowReference( const XubString& rStr ); + virtual void HideReference( sal_Bool bDoneRefMode = sal_True ); + + virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + + virtual void ViewShellChanged( ScTabViewShell* pScViewShell ); + void SwitchToDocument(); + //SfxBindings& GetBindings(); + + virtual void SetActive() = 0; +// virtual sal_Bool Close(); + //Overwrite TWindow will implemented by ScRefHdlrImplBase + //virtual void StateChanged( StateChangedType nStateChange ); + +public: + bool EnterRefMode(); + bool LeaveRefMode(); + inline bool CanInputStart( const formula::RefEdit *pEdit ); + inline bool CanInputDone( sal_Bool bForced ); +}; + +//============================================================================ + +template< class TWindow, bool bBindRef = true > +class ScRefHdlrImplBase:public TWindow, public ScRefHandler +{ +public: + //Overwrite TWindow + virtual long PreNotify( NotifyEvent& rNEvt ); + virtual void StateChanged( StateChangedType nStateChange ); + +private: + template<class TBindings, class TChildWindow, class TParentWindow, class TResId> + ScRefHdlrImplBase( TBindings* pB, TChildWindow* pCW, + TParentWindow* pParent, TResId nResId); + + template<class TParentWindow, class TResId, class TArg> + ScRefHdlrImplBase( TParentWindow* pParent, TResId nResId, const TArg &rArg, SfxBindings *pB = NULL ); + + ~ScRefHdlrImplBase(); + + template<class, class, bool> friend struct ScRefHdlrImpl; +}; + +template<class TWindow, bool bBindRef> +template<class TBindings, class TChildWindow, class TParentWindow, class TResId> +ScRefHdlrImplBase<TWindow, bBindRef>::ScRefHdlrImplBase( TBindings* pB, TChildWindow* pCW, + TParentWindow* pParent, TResId nResId):TWindow(pB, pCW, pParent, ScResId(static_cast<sal_uInt16>( nResId ) ) ), ScRefHandler( *static_cast<TWindow*>(this), pB, bBindRef ){} + +template<class TWindow, bool bBindRef > +template<class TParentWindow, class TResId, class TArg> +ScRefHdlrImplBase<TWindow,bBindRef>::ScRefHdlrImplBase( TParentWindow* pParent, TResId nResIdP, const TArg &rArg, SfxBindings *pB /*= NULL*/ ) +:TWindow( pParent, ScResId(static_cast<sal_uInt16>( nResIdP )), rArg ), ScRefHandler( *static_cast<TWindow*>(this), pB, bBindRef ){} + +template<class TWindow, bool bBindRef > +ScRefHdlrImplBase<TWindow,bBindRef>::~ScRefHdlrImplBase(){} + +//============================================================================ +template<class TDerived, class TBase, bool bBindRef = true> +struct ScRefHdlrImpl: ScRefHdlrImplBase<TBase, bBindRef > +{ + enum { UNKNOWN_SLOTID = 0U, SLOTID = UNKNOWN_SLOTID }; + + template<class T1, class T2, class T3, class T4> + ScRefHdlrImpl( const T1 & rt1, const T2 & rt2, const T3 & rt3, const T4 & rt4 ):ScRefHdlrImplBase<TBase, bBindRef >(rt1, rt2, rt3, rt4 ) + { + SC_MOD()->RegisterRefWindow( static_cast<sal_uInt16>( static_cast<TDerived*>(this)->SLOTID ), this ); + } + + ~ScRefHdlrImpl() + { + SC_MOD()->UnregisterRefWindow( static_cast<sal_uInt16>( static_cast<TDerived*>(this)->SLOTID ), this ); + } +}; +//============================================================================ +struct ScAnyRefDlg : ::ScRefHdlrImpl< ScAnyRefDlg, SfxModelessDialog> +{ + template<class T1, class T2, class T3, class T4> + ScAnyRefDlg( const T1 & rt1, const T2 & rt2, const T3 & rt3, const T4 & rt4 ):ScRefHdlrImpl< ScAnyRefDlg, SfxModelessDialog>(rt1, rt2, rt3, rt4){} +}; +//============================================================================ + +inline bool ScRefHandler::CanInputStart( const formula::RefEdit *pEdit ) +{ + return m_aHelper.CanInputStart( pEdit ); +} + +inline bool ScRefHandler::CanInputDone( sal_Bool bForced ) +{ + return m_aHelper.CanInputDone( bForced ); +} + +template <> SC_DLLPUBLIC void ScRefHdlrImplBase<SfxModelessDialog,true>::StateChanged( StateChangedType nStateChange ); +template <> SC_DLLPUBLIC long ScRefHdlrImplBase<SfxModelessDialog,true>::PreNotify( NotifyEvent& rNEvt ); +template <> SC_DLLPUBLIC void ScRefHdlrImplBase<SfxTabDialog,false>::StateChanged( StateChangedType nStateChange ); +template <> SC_DLLPUBLIC long ScRefHdlrImplBase<SfxTabDialog,false>::PreNotify( NotifyEvent& rNEvt ); + +#endif // SC_ANYREFDG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/areasave.hxx b/sc/source/ui/inc/areasave.hxx new file mode 100644 index 000000000000..c1a7eeb9aa65 --- /dev/null +++ b/sc/source/ui/inc/areasave.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_AREASAVE_HXX +#define SC_AREASAVE_HXX + +#include "collect.hxx" +#include "global.hxx" +#include "address.hxx" + +class ScDocument; +class ScAreaLink; + + +class ScAreaLinkSaver : public ScDataObject +{ +private: + String aFileName; + String aFilterName; + String aOptions; + String aSourceArea; + ScRange aDestArea; + sal_uLong nRefresh; + +public: + ScAreaLinkSaver( const ScAreaLink& rSource ); + ScAreaLinkSaver( const ScAreaLinkSaver& rCopy ); + virtual ~ScAreaLinkSaver(); + + virtual ScDataObject* Clone() const; + + sal_Bool IsEqual( const ScAreaLink& rCompare ) const; + sal_Bool IsEqualSource( const ScAreaLink& rCompare ) const; + + void WriteToLink( ScAreaLink& rLink ) const; + void InsertNewLink( ScDocument* pDoc ) const; +}; + + +class ScAreaLinkSaveCollection : public ScCollection +{ +public: + ScAreaLinkSaveCollection(); + ScAreaLinkSaveCollection( const ScAreaLinkSaveCollection& rCopy ); + virtual ~ScAreaLinkSaveCollection(); + + virtual ScDataObject* Clone() const; + + ScAreaLinkSaver* operator[](sal_uInt16 nIndex) const {return (ScAreaLinkSaver*)At(nIndex);} + + sal_Bool IsEqual( const ScDocument* pDoc ) const; + void Restore( ScDocument* pDoc ) const; + + // returns NULL if empty + static ScAreaLinkSaveCollection* CreateFromDoc( const ScDocument* pDoc ); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/areasdlg.hxx b/sc/source/ui/inc/areasdlg.hxx new file mode 100644 index 000000000000..fafd293a2a4b --- /dev/null +++ b/sc/source/ui/inc/areasdlg.hxx @@ -0,0 +1,106 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_AREASDLG_HXX +#define SC_AREASDLG_HXX + +#include "address.hxx" + +#include <vcl/lstbox.hxx> +#include <vcl/fixed.hxx> +#include <anyrefdg.hxx> + +class ScDocument; +class ScViewData; +class ScRangeUtil; +class ScRangeItem; + + +//============================================================================ + +class ScPrintAreasDlg : public ScAnyRefDlg +{ +public: + ScPrintAreasDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent ); + ~ScPrintAreasDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + virtual void AddRefEntry(); + + virtual sal_Bool IsTableLocked() const; + + virtual void SetActive(); + virtual void Deactivate(); + virtual sal_Bool Close(); + +private: + FixedLine aFlPrintArea; + ListBox aLbPrintArea; + formula::RefEdit aEdPrintArea; + formula::RefButton aRbPrintArea; + + FixedLine aFlRepeatRow; + ListBox aLbRepeatRow; + formula::RefEdit aEdRepeatRow; + formula::RefButton aRbRepeatRow; + + FixedLine aFlRepeatCol; + ListBox aLbRepeatCol; + formula::RefEdit aEdRepeatCol; + formula::RefButton aRbRepeatCol; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + sal_Bool bDlgLostFocus; + formula::RefEdit* pRefInputEdit; + ScDocument* pDoc; + ScViewData* pViewData; + SCTAB nCurTab; + +#ifdef _AREASDLG_CXX +private: + void Impl_Reset(); + sal_Bool Impl_CheckRefStrings(); + void Impl_FillLists(); + sal_Bool Impl_GetItem( Edit* pEd, SfxStringItem& rItem ); + + // Handler: + DECL_LINK( Impl_SelectHdl, ListBox* ); + DECL_LINK( Impl_ModifyHdl, formula::RefEdit* ); + DECL_LINK( Impl_BtnHdl, PushButton* ); + DECL_LINK( Impl_GetFocusHdl, Control* ); +#endif +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx new file mode 100644 index 000000000000..7fb3c937538d --- /dev/null +++ b/sc/source/ui/inc/asciiopt.hxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ============================================================================ + +#ifndef SC_ASCIIOPT_HXX +#define SC_ASCIIOPT_HXX + +#include <tools/string.hxx> +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/combobox.hxx> +#include <vcl/field.hxx> +#include <tools/stream.hxx> +#include <svx/txencbox.hxx> +#include "csvtablebox.hxx" +#include "i18npool/lang.h" + +// ============================================================================ + +class SC_DLLPUBLIC ScAsciiOptions +{ +private: + sal_Bool bFixedLen; + String aFieldSeps; + sal_Bool bMergeFieldSeps; + bool bQuotedFieldAsText; + bool bDetectSpecialNumber; + sal_Unicode cTextSep; + CharSet eCharSet; + LanguageType eLang; + sal_Bool bCharSetSystem; + long nStartRow; + sal_uInt16 nInfoCount; + xub_StrLen* pColStart; //! TODO replace with vector + sal_uInt8* pColFormat; //! TODO replace with vector + +public: + ScAsciiOptions(); + ScAsciiOptions(const ScAsciiOptions& rOpt); + ~ScAsciiOptions(); + + static const sal_Unicode cDefaultTextSep = '"'; + + ScAsciiOptions& operator=( const ScAsciiOptions& rCpy ); + + sal_Bool operator==( const ScAsciiOptions& rCmp ) const; + + void ReadFromString( const String& rString ); + String WriteToString() const; + + void InterpretColumnList( const String& rString ); + + CharSet GetCharSet() const { return eCharSet; } + sal_Bool GetCharSetSystem() const { return bCharSetSystem; } + const String& GetFieldSeps() const { return aFieldSeps; } + sal_Bool IsMergeSeps() const { return bMergeFieldSeps; } + bool IsQuotedAsText() const { return bQuotedFieldAsText; } + bool IsDetectSpecialNumber() const { return bDetectSpecialNumber; } + sal_Unicode GetTextSep() const { return cTextSep; } + sal_Bool IsFixedLen() const { return bFixedLen; } + sal_uInt16 GetInfoCount() const { return nInfoCount; } + const xub_StrLen* GetColStart() const { return pColStart; } + const sal_uInt8* GetColFormat() const { return pColFormat; } + long GetStartRow() const { return nStartRow; } + LanguageType GetLanguage() const { return eLang; } + + void SetCharSet( CharSet eNew ) { eCharSet = eNew; } + void SetCharSetSystem( sal_Bool bSet ) { bCharSetSystem = bSet; } + void SetFixedLen( sal_Bool bSet ) { bFixedLen = bSet; } + void SetFieldSeps( const String& rStr ) { aFieldSeps = rStr; } + void SetMergeSeps( sal_Bool bSet ) { bMergeFieldSeps = bSet; } + void SetQuotedAsText(bool bSet) { bQuotedFieldAsText = bSet; } + void SetDetectSpecialNumber(bool bSet) { bDetectSpecialNumber = bSet; } + void SetTextSep( sal_Unicode c ) { cTextSep = c; } + void SetStartRow( long nRow) { nStartRow= nRow; } + void SetLanguage(LanguageType e) { eLang = e; } + + void SetColInfo( sal_uInt16 nCount, const xub_StrLen* pStart, const sal_uInt8* pFormat ); + void SetColumnInfo( const ScCsvExpDataVec& rDataVec ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/attrdlg.hrc b/sc/source/ui/inc/attrdlg.hrc new file mode 100644 index 000000000000..d048e302f062 --- /dev/null +++ b/sc/source/ui/inc/attrdlg.hrc @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // -> SC_DLG_ATTR + +#define TP_NUMBER 1 +#define TP_FONT 2 +#define TP_ALIGNMENT 3 +#define TP_BORDER 4 +#define TP_BACKGROUND 5 +#define TP_PROTECTION 6 +#define TP_FONTEFF 7 +#define TP_ASIAN 8 + +//================================================ +// Zellschutz-TabPage: + +#define BTN_PROTECTED 1 +#define BTN_HIDE_FORMULAR 2 +#define BTN_HIDE_ALL 3 +#define FT_HINT 4 +#define FL_PROTECTION 5 +#define BTN_HIDE_PRINT 6 +#define FT_HINT2 7 +#define FL_PRINT 8 diff --git a/sc/source/ui/inc/attrdlg.hxx b/sc/source/ui/inc/attrdlg.hxx new file mode 100644 index 000000000000..8f1bae4260ff --- /dev/null +++ b/sc/source/ui/inc/attrdlg.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ATTRDLG_HXX +#define SC_ATTRDLG_HXX + +#include <sfx2/tabdlg.hxx> + +class Window; +class SfxViewFrame; +class SfxItemSet; + +#ifndef LAYOUT_SFX_TABDIALOG_BROKEN +#define LAYOUT_SFX_TABDIALOG_BROKEN 1 +#endif /* !LAYOUT_SFX_TABDIALOG_BROKEN */ + +#if !LAYOUT_SFX_TABDIALOG_BROKEN +#include <sfx2/layout.hxx> +#include <layout/layout-pre.hxx> +#endif + +//================================================================== + +class ScAttrDlg : public SfxTabDialog +{ +public: + ScAttrDlg( SfxViewFrame* pFrame, + Window* pParent, + const SfxItemSet* pCellAttrs ); + ~ScAttrDlg(); + +protected: + virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ); + +private: + DECL_LINK( OkHandler, void* ); // fuer DoppelClick-Beenden in TabPages +}; + +#if !LAYOUT_SFX_TABDIALOG_BROKEN +#include <layout/layout-post.hxx> +#endif + +#endif // SC_ATTRDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/auditsh.hxx b/sc/source/ui/inc/auditsh.hxx new file mode 100644 index 000000000000..0d11a49f517d --- /dev/null +++ b/sc/source/ui/inc/auditsh.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_AUDITSH_HXX +#define SC_AUDITSH_HXX + +#include <sfx2/shell.hxx> +#include <sfx2/module.hxx> + +#include "shellids.hxx" + +class ScViewData; + +class ScAuditingShell : public SfxShell +{ +private: + ScViewData* pViewData; + sal_uInt16 nFunction; + +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_AUDITING_SHELL) + + ScAuditingShell(ScViewData* pData); + ~ScAuditingShell(); + + void Execute(SfxRequest& rReq); + void GetState(SfxItemSet& rSet); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/autofmt.hxx b/sc/source/ui/inc/autofmt.hxx new file mode 100644 index 000000000000..4950341129dc --- /dev/null +++ b/sc/source/ui/inc/autofmt.hxx @@ -0,0 +1,141 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_AUTOFMT_HXX +#define SC_AUTOFMT_HXX + +#include <vcl/virdev.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/button.hxx> +#include <vcl/morebtn.hxx> +#include <vcl/dialog.hxx> +#include <svtools/scriptedtext.hxx> +#include <svx/framelinkarray.hxx> +#include "scdllapi.h" + +//------------------------------------------------------------------------ + +class ScAutoFormat; +class ScAutoFormatData; +class SvxBoxItem; +class SvxLineItem; +class ScAutoFmtPreview; // s.u. +class SvNumberFormatter; +class ScDocument; + +//------------------------------------------------------------------------ + +enum AutoFmtLine { TOP_LINE, BOTTOM_LINE, LEFT_LINE, RIGHT_LINE }; + +//======================================================================== + +class SC_DLLPUBLIC ScAutoFmtPreview : public Window +{ +public: + ScAutoFmtPreview( Window* pParent, const ResId& rRes, ScDocument* pDoc ); + ~ScAutoFmtPreview(); + + void NotifyChange( ScAutoFormatData* pNewData ); + +protected: + virtual void Paint( const Rectangle& rRect ); + +private: + ScAutoFormatData* pCurData; + VirtualDevice aVD; + SvtScriptedTextHelper aScriptedText; + ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > xBreakIter; + sal_Bool bFitWidth; + svx::frame::Array maArray; /// Implementation to draw the frame borders. + bool mbRTL; + Size aPrvSize; + long mnLabelColWidth; + long mnDataColWidth1; + long mnDataColWidth2; + long mnRowHeight; + const String aStrJan; + const String aStrFeb; + const String aStrMar; + const String aStrNorth; + const String aStrMid; + const String aStrSouth; + const String aStrSum; + SvNumberFormatter* pNumFmt; + //------------------------------------------- + SC_DLLPRIVATE void Init (); + SC_DLLPRIVATE void DoPaint ( const Rectangle& rRect ); + SC_DLLPRIVATE void CalcCellArray ( sal_Bool bFitWidth ); + SC_DLLPRIVATE void CalcLineMap (); + SC_DLLPRIVATE void PaintCells (); + +/* Usage of type size_t instead of SCCOL/SCROW is correct here - used in + conjunction with class svx::frame::Array (svx/framelinkarray.hxx), which + expects size_t coordinates. */ + + SC_DLLPRIVATE sal_uInt16 GetFormatIndex( size_t nCol, size_t nRow ) const; + SC_DLLPRIVATE const SvxBoxItem& GetBoxItem( size_t nCol, size_t nRow ) const; + SC_DLLPRIVATE const SvxLineItem& GetDiagItem( size_t nCol, size_t nRow, bool bTLBR ) const; + + SC_DLLPRIVATE void DrawString( size_t nCol, size_t nRow ); + SC_DLLPRIVATE void DrawStrings(); + SC_DLLPRIVATE void DrawBackground(); + + SC_DLLPRIVATE void MakeFonts ( sal_uInt16 nIndex, + Font& rFont, + Font& rCJKFont, + Font& rCTLFont ); + + SC_DLLPRIVATE String MakeNumberString( String cellString, sal_Bool bAddDec ); + SC_DLLPRIVATE void DrawFrameLine ( const ::editeng::SvxBorderLine& rLineD, + Point from, + Point to, + sal_Bool bHorizontal, + const ::editeng::SvxBorderLine& rLineLT, + const ::editeng::SvxBorderLine& rLineL, + const ::editeng::SvxBorderLine& rLineLB, + const ::editeng::SvxBorderLine& rLineRT, + const ::editeng::SvxBorderLine& rLineR, + const ::editeng::SvxBorderLine& rLineRB ); + SC_DLLPRIVATE void CheckPriority ( sal_uInt16 nCurLine, + AutoFmtLine eLine, + ::editeng::SvxBorderLine& rLine ); + SC_DLLPRIVATE void GetLines ( sal_uInt16 nIndex, AutoFmtLine eLine, + ::editeng::SvxBorderLine& rLineD, + ::editeng::SvxBorderLine& rLineLT, + ::editeng::SvxBorderLine& rLineL, + ::editeng::SvxBorderLine& rLineLB, + ::editeng::SvxBorderLine& rLineRT, + ::editeng::SvxBorderLine& rLineR, + ::editeng::SvxBorderLine& rLineRB ); +}; + +#endif // SC_AUTOFMT_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/autostyl.hxx b/sc/source/ui/inc/autostyl.hxx new file mode 100644 index 000000000000..cbf270626f81 --- /dev/null +++ b/sc/source/ui/inc/autostyl.hxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_AUTOSTYL_HXX +#define SC_AUTOSTYL_HXX + +#include <boost/ptr_container/ptr_vector.hpp> + +#include <tools/string.hxx> + +#include <vcl/timer.hxx> + +class ScDocShell; +class ScRange; +class ScAutoStyleData; +struct ScAutoStyleInitData; + +class ScAutoStyleList +{ +private: + + ScDocShell* pDocSh; + Timer aTimer; + Timer aInitTimer; + sal_uLong nTimerStart; + boost::ptr_vector<ScAutoStyleData> aEntries; + boost::ptr_vector<ScAutoStyleInitData> aInitials; + + void ExecuteEntries(); + void AdjustEntries(sal_uLong nDiff); + void StartTimer(sal_uLong nNow); + DECL_LINK( TimerHdl, Timer* ); + DECL_LINK( InitHdl, Timer* ); + +public: + ScAutoStyleList(ScDocShell* pShell); + ~ScAutoStyleList(); + + void AddInitial( const ScRange& rRange, const String& rStyle1, + sal_uLong nTimeout, const String& rStyle2 ); + void AddEntry( sal_uLong nTimeout, const ScRange& rRange, const String& rStyle ); + + void ExecuteAllNow(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/cbutton.hxx b/sc/source/ui/inc/cbutton.hxx new file mode 100644 index 000000000000..dc588ebb02f8 --- /dev/null +++ b/sc/source/ui/inc/cbutton.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +//------------------------------------------------------------------ + +#ifndef SC_CBUTTON_HXX +#define SC_CBUTTON_HXX + +#include <tools/gen.hxx> +#include <tools/color.hxx> + +class OutputDevice; + + +//================================================================== + +class ScDDComboBoxButton +{ +public: + ScDDComboBoxButton( OutputDevice* pOutputDevice ); + ~ScDDComboBoxButton(); + + void SetOutputDevice( OutputDevice* pOutputDevice ); + + void Draw( const Point& rAt, + const Size& rSize, + sal_Bool bState, + sal_Bool bBtnIn = false ); + + void Draw( const Point& rAt, + sal_Bool bState, + sal_Bool bBtnIn = false ) + { Draw( rAt, aBtnSize, bState, bBtnIn ); } + + void Draw( sal_Bool bState, + sal_Bool bBtnIn = false ) + { Draw( aBtnPos, aBtnSize, bState, bBtnIn ); } + + void SetOptSizePixel(); + + void SetPosPixel( const Point& rNewPos ) { aBtnPos = rNewPos; } + Point GetPosPixel() const { return aBtnPos; } + + void SetSizePixel( const Size& rNewSize ) { aBtnSize = rNewSize; } + Size GetSizePixel() const { return aBtnSize; } + +private: + void ImpDrawArrow( const Rectangle& rRect, + sal_Bool bState ); + +protected: + OutputDevice* pOut; + Point aBtnPos; + Size aBtnSize; +}; + + +#endif // SC_CBUTTON_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/cellmergeoption.hxx b/sc/source/ui/inc/cellmergeoption.hxx new file mode 100644 index 000000000000..ad5fe34d41ca --- /dev/null +++ b/sc/source/ui/inc/cellmergeoption.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * [ Kohei Yoshida <kyoshida@novell.com> ] + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef SC_CELLMERGEOPTION_HXX +#define SC_CELLMERGEOPTION_HXX + +#include "address.hxx" + +#include <set> + +class ScRange; + +struct ScCellMergeOption +{ + ::std::set<SCTAB> maTabs; + SCCOL mnStartCol; + SCROW mnStartRow; + SCCOL mnEndCol; + SCROW mnEndRow; + bool mbCenter; + + explicit ScCellMergeOption(); + explicit ScCellMergeOption(const ScRange& rRange); + explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, + bool bCenter = false); + explicit ScCellMergeOption(const ScCellMergeOption& r); + + ScRange getSingleRange(SCTAB nTab) const; + ScRange getFirstSingleRange() const; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/cellsh.hxx b/sc/source/ui/inc/cellsh.hxx new file mode 100644 index 000000000000..b7cc54f5b7ef --- /dev/null +++ b/sc/source/ui/inc/cellsh.hxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CELLSH_HXX +#define SC_CELLSH_HXX + +#include <sfx2/shell.hxx> +#include "shellids.hxx" +#include <sfx2/module.hxx> +#include <svx/svdmark.hxx> +#include <unotools/caserotate.hxx> +#include <tools/link.hxx> +#include "formatsh.hxx" +#include "address.hxx" + +class SvxClipboardFmtItem; +class TransferableDataHelper; +class TransferableClipboardListener; +class AbstractScLinkedAreaDlg; +class ScTabViewShell; + +struct CellShell_Impl +{ + TransferableClipboardListener* m_pClipEvtLstnr; + AbstractScLinkedAreaDlg* m_pLinkedDlg; + SfxRequest* m_pRequest; + + CellShell_Impl() : + m_pClipEvtLstnr( NULL ), + m_pLinkedDlg( NULL ), + m_pRequest( NULL ) {} +}; + +class ScCellShell: public ScFormatShell +{ +private: + CellShell_Impl* pImpl; + sal_Bool bPastePossible; + + void GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats ); + void ExecuteExternalSource( + const String& _rFile, const String& _rFilter, const String& _rOptions, + const String& _rSource, sal_uLong _nRefresh, SfxRequest& _rRequest ); + + void ExecuteDataPilotDialog(); + void ExecuteSubtotals(SfxRequest& rReq); + + DECL_LINK( ClipboardChanged, TransferableDataHelper* ); + DECL_LINK( DialogClosed, AbstractScLinkedAreaDlg* ); + + RotateTransliteration m_aRotateCase; + +public: + + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_CELL_SHELL) + + ScCellShell(ScViewData* pData); + virtual ~ScCellShell(); + + void Execute(SfxRequest &); + void GetState(SfxItemSet &); + + void ExecuteEdit( SfxRequest& rReq ); + void ExecuteTrans( SfxRequest& rReq ); + void ExecuteRotateTrans( SfxRequest& rReq ); + + void GetBlockState( SfxItemSet& rSet ); + void GetCellState( SfxItemSet& rSet ); + + void ExecuteDB( SfxRequest& rReq ); + void GetDBState( SfxItemSet& rSet ); + + void ExecImageMap(SfxRequest& rReq); // ImageMap + void GetImageMapState(SfxItemSet& rSet); + + void GetClipState( SfxItemSet& rSet ); + void GetHLinkState( SfxItemSet& rSet ); + + void ExecuteCursor( SfxRequest& rReq ); + void ExecuteCursorSel( SfxRequest& rReq ); + void ExecutePage( SfxRequest& rReq ); + void ExecutePageSel( SfxRequest& rReq ); + void ExecuteMove( SfxRequest& rReq ); + void GetStateCursor( SfxItemSet& rSet ); + + static void PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, bool bShowDialog ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/chartsh.hxx b/sc/source/ui/inc/chartsh.hxx new file mode 100644 index 000000000000..0e09211ce346 --- /dev/null +++ b/sc/source/ui/inc/chartsh.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef CHARTSH_HXX +#define CHARTSH_HXX + +#include <sfx2/shell.hxx> +#include "shellids.hxx" +#include <sfx2/module.hxx> +#include <svx/svdmark.hxx> + +class ScViewData; + +#include "drawsh.hxx" + +class ScChartShell: public ScDrawShell +{ +public: + + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_CHART_SHELL) + + ScChartShell(ScViewData* pData); + virtual ~ScChartShell(); + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/client.hxx b/sc/source/ui/inc/client.hxx new file mode 100644 index 000000000000..ac39d6d386b5 --- /dev/null +++ b/sc/source/ui/inc/client.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CLIENT_HXX +#define SC_CLIENT_HXX + +#include <sfx2/ipclient.hxx> + +class ScDocument; +class ScTabViewShell; +class SdrOle2Obj; +class SdrGrafObj; +class SdrModel; + +class ScClient : public SfxInPlaceClient +{ +private: + SdrModel* pModel; + SdrGrafObj* pGrafEdit; + + virtual void ObjectAreaChanged(); + virtual void RequestNewObjectArea( Rectangle& ); + virtual void ViewChanged(); + virtual void MakeVisible(); + +public: + ScClient( ScTabViewShell* pViewShell, Window* pDraw, SdrModel* pSdrModel, SdrOle2Obj* pObj ); + virtual ~ScClient(); + + SdrGrafObj* GetGrafEdit() const { return pGrafEdit; } + void SetGrafEdit(SdrGrafObj* pNew) { pGrafEdit = pNew; } + SdrOle2Obj* GetDrawObj(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/colrowba.hxx b/sc/source/ui/inc/colrowba.hxx new file mode 100644 index 000000000000..fdc4b191972a --- /dev/null +++ b/sc/source/ui/inc/colrowba.hxx @@ -0,0 +1,112 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_COLROWBAR_HXX +#define SC_COLROWBAR_HXX + +#include "hdrcont.hxx" +#include "viewdata.hxx" + +class ScHeaderFunctionSet; +class ScHeaderSelectionEngine; + +// --------------------------------------------------------------------------- + + +class ScColBar : public ScHeaderControl +{ + ScViewData* pViewData; + ScHSplitPos eWhich; + ScHeaderFunctionSet* pFuncSet; + ScHeaderSelectionEngine* pSelEngine; + +public: + ScColBar( Window* pParent, ScViewData* pData, ScHSplitPos eWhichPos, + ScHeaderFunctionSet* pFunc, ScHeaderSelectionEngine* pEng ); + ~ScColBar(); + + virtual SCCOLROW GetPos(); + virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ); + virtual String GetEntryText( SCCOLROW nEntryNo ); + + virtual sal_Bool IsLayoutRTL(); // only for columns + + virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ); + virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ); + + virtual void SetMarking( sal_Bool bSet ); + virtual void SelectWindow(); + virtual sal_Bool IsDisabled(); + virtual sal_Bool ResizeAllowed(); + + virtual void DrawInvert( long nDragPos ); + + virtual String GetDragHelp( long nVal ); + + sal_Bool UseNumericHeader() const; +}; + + +class ScRowBar : public ScHeaderControl +{ + ScViewData* pViewData; + ScVSplitPos eWhich; + ScHeaderFunctionSet* pFuncSet; + ScHeaderSelectionEngine* pSelEngine; + +public: + ScRowBar( Window* pParent, ScViewData* pData, ScVSplitPos eWhichPos, + ScHeaderFunctionSet* pFunc, ScHeaderSelectionEngine* pEng ); + ~ScRowBar(); + + virtual SCCOLROW GetPos(); + virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ); + virtual String GetEntryText( SCCOLROW nEntryNo ); + + virtual sal_Bool IsMirrored(); // only for columns + virtual SCROW GetHiddenCount( SCROW nEntryNo ); // only for columns + + virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewSize ); + virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ); + + virtual void SetMarking( sal_Bool bSet ); + virtual void SelectWindow(); + virtual sal_Bool IsDisabled(); + virtual sal_Bool ResizeAllowed(); + + virtual void DrawInvert( long nDragPos ); + + virtual String GetDragHelp( long nVal ); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condfrmt.hrc b/sc/source/ui/inc/condfrmt.hrc new file mode 100644 index 000000000000..e1013438d219 --- /dev/null +++ b/sc/source/ui/inc/condfrmt.hrc @@ -0,0 +1,78 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // ->RID_SCDLG_SOLVER + +#define CBX_COND1 1 +#define LB_COND1_1 2 +#define LB_COND1_2 3 +#define EDT_COND1_1 4 +#define RB_COND1_1 5 +#define FT_COND1_AND 6 +#define EDT_COND1_2 7 +#define RB_COND1_2 8 +#define FT_COND1_TEMPLATE 9 +#define LB_COND1_TEMPLATE 10 + +#define CBX_COND2 11 +#define LB_COND2_1 12 +#define LB_COND2_2 13 +#define EDT_COND2_1 14 +#define RB_COND2_1 15 +#define FT_COND2_AND 16 +#define EDT_COND2_2 17 +#define RB_COND2_2 18 +#define FT_COND2_TEMPLATE 19 +#define LB_COND2_TEMPLATE 20 + +#define CBX_COND3 21 +#define LB_COND3_1 22 +#define LB_COND3_2 23 +#define EDT_COND3_1 24 +#define RB_COND3_1 25 +#define FT_COND3_AND 26 +#define EDT_COND3_2 27 +#define RB_COND3_2 28 +#define FT_COND3_TEMPLATE 29 +#define LB_COND3_TEMPLATE 30 + +#define FL_SEP1 41 +#define FL_SEP2 42 + +//IAccessibility2 Implementation 2009----- +#define LABEL_FORMARTTING_CONDITIONS 5043 +#define LABEL_CONDITIONS 5044 +#define LABEL_CONDITION_VALUE 5045 +//-----IAccessibility2 Implementation 2009 + +#define BTN_OK 31 +#define BTN_CANCEL 32 +#define BTN_HELP 33 + +#define BTN_COND1_NEW 34 +#define BTN_COND2_NEW 35 +#define BTN_COND3_NEW 36 diff --git a/sc/source/ui/inc/condfrmt.hxx b/sc/source/ui/inc/condfrmt.hxx new file mode 100644 index 000000000000..85d7b6e225da --- /dev/null +++ b/sc/source/ui/inc/condfrmt.hxx @@ -0,0 +1,154 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef SC_CONDFRMT_HXX_ +#define SC_CONDFRMT_HXX_ + +#include "anyrefdg.hxx" +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> + + +class ScDocument; +class ScConditionalFormat; + + +//============================================================================ +// class ScConditionalFormat +// +// Dialog zum Festlegen von bedingten Formaten + +class ScConditionalFormatDlg : public ScAnyRefDlg +{ +public: + ScConditionalFormatDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScDocument* pCurDoc, + const ScConditionalFormat* pCurrentFormat ); + ~ScConditionalFormatDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + virtual void AddRefEntry(); + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + virtual sal_Bool Close(); + +private: + CheckBox aCbxCond1; + ListBox aLbCond11; + ListBox aLbCond12; + formula::RefEdit aEdtCond11; + formula::RefButton aRbCond11; + FixedText aFtCond1And; + formula::RefEdit aEdtCond12; + formula::RefButton aRbCond12; + FixedText aFtCond1Template; + ListBox aLbCond1Template; + PushButton aBtnNew1; + CheckBox aCbxCond2; + ListBox aLbCond21; + ListBox aLbCond22; + formula::RefEdit aEdtCond21; + formula::RefButton aRbCond21; + FixedText aFtCond2And; + formula::RefEdit aEdtCond22; + formula::RefButton aRbCond22; + FixedText aFtCond2Template; + ListBox aLbCond2Template; + PushButton aBtnNew2; + CheckBox aCbxCond3; + ListBox aLbCond31; + ListBox aLbCond32; + formula::RefEdit aEdtCond31; + formula::RefButton aRbCond31; + FixedText aFtCond3And; + formula::RefEdit aEdtCond32; + formula::RefButton aRbCond32; + FixedText aFtCond3Template; + ListBox aLbCond3Template; + PushButton aBtnNew3; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + Point aCond1Pos1; + Point aCond1Pos2; + Point aRBtn1Pos1; + Point aRBtn1Pos2; + Size aCond1Size1; + Size aCond1Size2; + Size aCond1Size3; + + Point aCond2Pos1; + Point aCond2Pos2; + Point aRBtn2Pos1; + Point aRBtn2Pos2; + Size aCond2Size1; + Size aCond2Size2; + Size aCond2Size3; + + Point aCond3Pos1; + Point aCond3Pos2; + Point aRBtn3Pos1; + Point aRBtn3Pos2; + Size aCond3Size1; + Size aCond3Size2; + Size aCond3Size3; + FixedLine aFlSep2; + FixedLine aFlSep1; + formula::RefEdit* pEdActive; + sal_Bool bDlgLostFocus; + ScDocument* pDoc; + +#ifdef _CONDFRMT_CXX + void GetConditionalFormat( ScConditionalFormat& rCndFmt ); + + DECL_LINK( ClickCond1Hdl, void * ); + DECL_LINK( ChangeCond11Hdl, void * ); + DECL_LINK( ChangeCond12Hdl, void * ); + + DECL_LINK( ClickCond2Hdl, void * ); + DECL_LINK( ChangeCond21Hdl, void * ); + DECL_LINK( ChangeCond22Hdl, void * ); + + DECL_LINK( ClickCond3Hdl, void * ); + DECL_LINK( ChangeCond31Hdl, void * ); + DECL_LINK( ChangeCond32Hdl, void * ); + + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); + DECL_LINK( BtnHdl, PushButton* ); + DECL_LINK( NewBtnHdl, PushButton* ); +#endif // _CONDFRMT_CXX +}; + +#endif // SC_CONDFRMT_HXX_ + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/conflictsdlg.hrc b/sc/source/ui/inc/conflictsdlg.hrc new file mode 100644 index 000000000000..7935a6ee21d7 --- /dev/null +++ b/sc/source/ui/inc/conflictsdlg.hrc @@ -0,0 +1,43 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <sc.hrc> + +#define FT_CONFLICTS 1 +#define LB_CONFLICTS 2 +#define BTN_KEEPMINE 3 +#define BTN_KEEPOTHER 4 +#define FL_CONFLICTS 5 +#define BTN_KEEPALLMINE 6 +#define BTN_KEEPALLOTHERS 7 +#define BTN_CANCEL 8 +#define BTN_HELP 9 + +#define STR_TITLE_CONFLICT 1 +#define STR_TITLE_AUTHOR 2 +#define STR_TITLE_DATE 3 +#define STR_UNKNOWN_USER 4 diff --git a/sc/source/ui/inc/conflictsdlg.hxx b/sc/source/ui/inc/conflictsdlg.hxx new file mode 100644 index 000000000000..5dcdd07d62fe --- /dev/null +++ b/sc/source/ui/inc/conflictsdlg.hxx @@ -0,0 +1,215 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CONFLICTSDLG_HXX +#define SC_CONFLICTSDLG_HXX + +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <svx/ctredlin.hxx> + +#include "chgtrack.hxx" +#include "docsh.hxx" + +class ScViewData; + + +//============================================================================= + +enum ScConflictAction +{ + SC_CONFLICT_ACTION_NONE, + SC_CONFLICT_ACTION_KEEP_MINE, + SC_CONFLICT_ACTION_KEEP_OTHER +}; + +typedef ::std::vector< sal_uLong > ScChangeActionList; + + +//============================================================================= +// struct ScConflictsListEntry +//============================================================================= + +struct ScConflictsListEntry +{ + ScConflictAction meConflictAction; + ScChangeActionList maSharedActions; + ScChangeActionList maOwnActions; + + bool HasSharedAction( sal_uLong nSharedAction ) const; + bool HasOwnAction( sal_uLong nOwnAction ) const; +}; + + +//============================================================================= + +typedef ::std::vector< ScConflictsListEntry > ScConflictsList; + + +//============================================================================= +// class ScConflictsListHelper +//============================================================================= + +class ScConflictsListHelper +{ +private: + static void Transform_Impl( ScChangeActionList& rActionList, ScChangeActionMergeMap* pMergeMap ); + +public: + static bool HasOwnAction( ScConflictsList& rConflictsList, sal_uLong nOwnAction ); + + static ScConflictsListEntry* GetSharedActionEntry( ScConflictsList& rConflictsList, sal_uLong nSharedAction ); + static ScConflictsListEntry* GetOwnActionEntry( ScConflictsList& rConflictsList, sal_uLong nOwnAction ); + + static void TransformConflictsList( ScConflictsList& rConflictsList, + ScChangeActionMergeMap* pSharedMap, ScChangeActionMergeMap* pOwnMap ); +}; + + +//============================================================================= +// class ScConflictsFinder +//============================================================================= + +class ScConflictsFinder +{ +private: + ScChangeTrack* mpTrack; + sal_uLong mnStartShared; + sal_uLong mnEndShared; + sal_uLong mnStartOwn; + sal_uLong mnEndOwn; + ScConflictsList& mrConflictsList; + + static bool DoActionsIntersect( const ScChangeAction* pAction1, const ScChangeAction* pAction2 ); + ScConflictsListEntry* GetIntersectingEntry( const ScChangeAction* pAction ) const; + ScConflictsListEntry* GetEntry( sal_uLong nSharedAction, const ScChangeActionList& rOwnActions ); + +public: + ScConflictsFinder( ScChangeTrack* pTrack, sal_uLong nStartShared, sal_uLong nEndShared, + sal_uLong nStartOwn, sal_uLong nEndOwn, ScConflictsList& rConflictsList ); + virtual ~ScConflictsFinder(); + + bool Find(); +}; + + +//============================================================================= +// class ScConflictsResolver +//============================================================================= + +class ScConflictsResolver +{ +private: + ScChangeTrack* mpTrack; + ScConflictsList& mrConflictsList; + +public: + ScConflictsResolver( ScChangeTrack* pTrack, ScConflictsList& rConflictsList ); + virtual ~ScConflictsResolver(); + + void HandleAction( ScChangeAction* pAction, bool bIsSharedAction, + bool bHandleContentAction, bool bHandleNonContentAction ); +}; + + +//============================================================================= +// class ScConflictsListBox +//============================================================================= + +class ScConflictsListBox: public SvxRedlinTable +{ +private: + +public: + ScConflictsListBox( Window* pParent, const ResId& rResId ); + ~ScConflictsListBox(); +}; + +//============================================================================= +// class ScConflictsDlg +//============================================================================= + +class ScConflictsDlg : public ModalDialog +{ +private: + FixedText maFtConflicts; + ScConflictsListBox maLbConflicts; + PushButton maBtnKeepMine; + PushButton maBtnKeepOther; + FixedLine maFlConflicts; + PushButton maBtnKeepAllMine; + PushButton maBtnKeepAllOthers; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + String maStrTitleConflict; + String maStrTitleAuthor; + String maStrTitleDate; + String maStrUnknownUser; + + ScViewData* mpViewData; + ScDocument* mpOwnDoc; + ScChangeTrack* mpOwnTrack; + ScDocument* mpSharedDoc; + ScChangeTrack* mpSharedTrack; + ScConflictsList& mrConflictsList; + Size maDialogSize; + + Timer maSelectionTimer; + bool mbInSelectHdl; + bool mbInDeselectHdl; + + String GetConflictString( const ScConflictsListEntry& rConflictEntry ); + String GetActionString( const ScChangeAction* pAction, ScDocument* pDoc ); + void HandleListBoxSelection( bool bSelectHandle ); + + void SetConflictAction( SvLBoxEntry* pRootEntry, ScConflictAction eConflictAction ); + void KeepHandler( bool bMine ); + void KeepAllHandler( bool bMine ); + + DECL_LINK( SelectHandle, SvxRedlinTable* ); + DECL_LINK( DeselectHandle, SvxRedlinTable* ); + DECL_LINK( UpdateSelectionHdl, Timer* ); + DECL_LINK( KeepMineHandle, void* ); + DECL_LINK( KeepOtherHandle, void* ); + DECL_LINK( KeepAllMineHandle, void* ); + DECL_LINK( KeepAllOthersHandle, void* ); + +public: + ScConflictsDlg( Window* pParent, ScViewData* pViewData, ScDocument* pSharedDoc, ScConflictsList& rConflictsList ); + ~ScConflictsDlg(); + + virtual void Resize(); + void UpdateView(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/consdlg.hxx b/sc/source/ui/inc/consdlg.hxx new file mode 100644 index 000000000000..fa4fe9e41651 --- /dev/null +++ b/sc/source/ui/inc/consdlg.hxx @@ -0,0 +1,130 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CONSDLG_HXX +#define SC_CONSDLG_HXX + +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/group.hxx> +#include <vcl/morebtn.hxx> +#include "global.hxx" +#include "anyrefdg.hxx" + +class ScViewData; +class ScDocument; +class ScRangeUtil; +class ScAreaData; + + +//============================================================================ + +class ScConsolidateDlg : public ScAnyRefDlg +{ +public: + ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + const SfxItemSet& rArgSet ); + ~ScConsolidateDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + + virtual sal_Bool IsRefInputMode() const { return sal_True; } + virtual void SetActive(); + + virtual sal_Bool Close(); + +protected: + virtual void Deactivate(); + +private: + FixedText aFtFunc; + ListBox aLbFunc; + + FixedText aFtConsAreas; + MultiListBox aLbConsAreas; + + ListBox aLbDataArea; + FixedText aFtDataArea; + formula::RefEdit aEdDataArea; + formula::RefButton aRbDataArea; + + ListBox aLbDestArea; + FixedText aFtDestArea; + formula::RefEdit aEdDestArea; + formula::RefButton aRbDestArea; + + FixedLine aFlConsBy; + CheckBox aBtnByRow; + CheckBox aBtnByCol; + + FixedLine aFlSep; + FixedLine aFlOptions; + CheckBox aBtnRefs; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + PushButton aBtnAdd; + PushButton aBtnRemove; + MoreButton aBtnMore; + + String aStrUndefined; + + ScConsolidateParam theConsData; + ScViewData* pViewData; + ScDocument* pDoc; + ScRangeUtil* pRangeUtil; + ScAreaData* pAreaData; + sal_uInt16 nAreaDataCount; + sal_uInt16 nWhichCons; + + formula::RefEdit* pRefInputEdit; + sal_Bool bDlgLostFocus; + +#ifdef _CONSDLG_CXX +private: + void Init (); + void FillAreaLists (); + sal_Bool VerifyEdit ( formula::RefEdit* pEd ); + + DECL_LINK( OkHdl, void* ); + DECL_LINK( ClickHdl, PushButton* ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( ModifyHdl, formula::RefEdit* ); + DECL_LINK( SelectHdl, ListBox* ); + + ScSubTotalFunc LbPosToFunc( sal_uInt16 nPos ); + sal_uInt16 FuncToLbPos( ScSubTotalFunc eFunc ); +#endif // _CONSDLG_CXX +}; + + + +#endif // SC_CONSDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx new file mode 100644 index 000000000000..1de37c004126 --- /dev/null +++ b/sc/source/ui/inc/content.hxx @@ -0,0 +1,169 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CONTENT_HXX +#define SC_CONTENT_HXX + +#include <svtools/svtreebx.hxx> +#include "global.hxx" +#include "address.hxx" +#include <tools/solar.h> + +class ScNavigatorDlg; +class ScNavigatorSettings; +class ScDocument; +class ScDocShell; +class ScAreaLink; + +#define SC_CONTENT_ROOT 0 +#define SC_CONTENT_TABLE 1 +#define SC_CONTENT_RANGENAME 2 +#define SC_CONTENT_DBAREA 3 +#define SC_CONTENT_GRAPHIC 4 +#define SC_CONTENT_OLEOBJECT 5 +#define SC_CONTENT_NOTE 6 +#define SC_CONTENT_AREALINK 7 +#define SC_CONTENT_DRAWING 8 +#define SC_CONTENT_COUNT 9 + +const sal_uLong SC_CONTENT_NOCHILD = ~0UL; + +// +// TreeListBox fuer Inhalte +// + +class ScContentTree : public SvTreeListBox +{ + ScNavigatorDlg* pParentWindow; + ImageList aEntryImages; + SvLBoxEntry* pRootNodes[SC_CONTENT_COUNT]; + sal_uInt16 nRootType; // als Root eingestellt + String aManualDoc; // im Navigator umgeschaltet (Title) + sal_Bool bHiddenDoc; // verstecktes aktiv? + String aHiddenName; // URL zum Laden + String aHiddenTitle; // fuer Anzeige + ScDocument* pHiddenDocument; // temporaer + + sal_uInt16 pPosList[SC_CONTENT_COUNT]; // fuer die Reihenfolge + + static sal_Bool bIsInDrag; // static, falls der Navigator im ExecuteDrag geloescht wird + + ScDocShell* GetManualOrCurrent(); + + void InitRoot(sal_uInt16 nType); + void ClearType(sal_uInt16 nType); + void ClearAll(); + void InsertContent( sal_uInt16 nType, const String& rValue ); + void GetDrawNames( sal_uInt16 nType ); + + void GetTableNames(); + void GetAreaNames(); + void GetDbNames(); + void GetLinkNames(); + void GetGraphicNames(); + void GetOleNames(); + void GetDrawingNames(); + void GetNoteStrings(); + + static bool IsPartOfType( sal_uInt16 nContentType, sal_uInt16 nObjIdentifier ); + + sal_Bool DrawNamesChanged( sal_uInt16 nType ); + sal_Bool NoteStringsChanged(); + + ScAddress GetNotePos( sal_uLong nIndex ); + const ScAreaLink* GetLink( sal_uLong nIndex ); + + /** Returns the indexes of the specified listbox entry. + @param rnRootIndex Root index of specified entry is returned. + @param rnChildIndex Index of the entry inside its root is returned (or SC_CONTENT_NOCHILD if entry is root). + @param pEntry The entry to examine. */ + void GetEntryIndexes( sal_uInt16& rnRootIndex, sal_uLong& rnChildIndex, SvLBoxEntry* pEntry ) const; + + /** Returns the child index of the specified listbox entry. + @param pEntry The entry to examine or NULL for the selected entry. + @return Index of the entry inside its root or SC_CONTENT_NOCHILD if entry is root. */ + sal_uLong GetChildIndex( SvLBoxEntry* pEntry ) const; + + void DoDrag(); + + ScDocument* GetSourceDocument(); + + DECL_LINK( ContentDoubleClickHdl, ScContentTree* ); + DECL_STATIC_LINK( ScContentTree, ExecDragHdl, void* ); + +protected: +// virtual sal_Bool Drop( const DropEvent& rEvt ); +// virtual sal_Bool QueryDrop( DropEvent& rEvt ); + + using SvTreeListBox::ExecuteDrop; + + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); + virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); + virtual void DragFinished( sal_Int8 nAction ); + + virtual void Command( const CommandEvent& rCEvt ); + virtual void RequestHelp( const HelpEvent& rHEvt ); + +public: + ScContentTree( Window* pParent, const ResId& rResId ); + ~ScContentTree(); + + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void KeyInput( const KeyEvent& rKEvt ); + + void InitWindowBits( sal_Bool bButtons ); + + void Refresh( sal_uInt16 nType = 0 ); + + void ToggleRoot(); + void SetRootType( sal_uInt16 nNew ); + sal_uInt16 GetRootType() const { return nRootType; } + + void ActiveDocChanged(); + void ResetManualDoc(); + void SetManualDoc(const String& rName); + sal_Bool LoadFile(const String& rUrl); + void SelectDoc(const String& rName); + + const String& GetHiddenTitle() const { return aHiddenTitle; } + + /** Applies the navigator settings to the listbox. */ + void ApplySettings(); + /** Stores the current listbox state in the navigator settings. */ + void StoreSettings() const; + + static sal_Bool IsInDrag() { return bIsInDrag; } +}; + + + + +#endif // SC_NAVIPI_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/corodlg.hxx b/sc/source/ui/inc/corodlg.hxx new file mode 100644 index 000000000000..87662e0f3da1 --- /dev/null +++ b/sc/source/ui/inc/corodlg.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CORODLG_HXX +#define SC_CORODLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> + +#include "sc.hrc" +#include "scresid.hxx" + +//------------------------------------------------------------------------ + +class ScColRowLabelDlg : public ModalDialog +{ +public: + ScColRowLabelDlg( Window* pParent, + sal_Bool bCol = false, + sal_Bool bRow = false ) + : ModalDialog( pParent, ScResId( RID_SCDLG_CHARTCOLROW ) ), + aFlColRow ( this, ScResId(6) ), + aBtnRow ( this, ScResId(2) ), + aBtnCol ( this, ScResId(1) ), + aBtnOk ( this, ScResId(3) ), + aBtnCancel ( this, ScResId(4) ), + aBtnHelp ( this, ScResId(5) ) + { + FreeResource(); + aBtnCol.Check( bCol ); + aBtnRow.Check( bRow ); + } + + sal_Bool IsCol() { return aBtnCol.IsChecked(); } + sal_Bool IsRow() { return aBtnRow.IsChecked(); } + +private: + FixedLine aFlColRow; + CheckBox aBtnRow; + CheckBox aBtnCol; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; +}; + + +#endif + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/crdlg.hxx b/sc/source/ui/inc/crdlg.hxx new file mode 100644 index 000000000000..648544ee117f --- /dev/null +++ b/sc/source/ui/inc/crdlg.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CRDLG_HXX +#define SC_CRDLG_HXX + + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include "scui_def.hxx" + +//------------------------------------------------------------------------ + +class ScColOrRowDlg : public ModalDialog +{ +public: + ScColOrRowDlg( Window* pParent, + const String& rStrTitle, + const String& rStrLabel, + sal_Bool bColDefault = sal_True ); + ~ScColOrRowDlg(); + +private: + FixedLine aFlFrame; + RadioButton aBtnRows; + RadioButton aBtnCols; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + DECL_LINK( OkHdl, OKButton * ); +}; + + +#endif + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/crnrdlg.hrc b/sc/source/ui/inc/crnrdlg.hrc new file mode 100644 index 000000000000..7467b398d5fb --- /dev/null +++ b/sc/source/ui/inc/crnrdlg.hrc @@ -0,0 +1,45 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // -> RID_SCDLG_COLROWNAMERANGES + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_ADD 3 +#define BTN_REMOVE 4 +#define BTN_HELP 5 + +#define LB_RANGE 11 + +#define FL_ASSIGN 12 +#define ED_AREA 13 +#define RB_AREA 14 +#define BTN_COLHEAD 15 +#define BTN_ROWHEAD 16 +#define ED_DATA 17 +#define RB_DATA 18 +#define FT_DATA_LABEL 19 diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx new file mode 100644 index 000000000000..7c5c58b9bc5d --- /dev/null +++ b/sc/source/ui/inc/crnrdlg.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_CRNRDLG_HXX +#define SC_CRNRDLG_HXX + +#include "anyrefdg.hxx" +#include "rangelst.hxx" +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> + +#include <boost/unordered_map.hpp> + +class ScViewData; +class ScDocument; + + +//============================================================================ + +class ScColRowNameRangesDlg : public ScAnyRefDlg +{ +public: + ScColRowNameRangesDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScViewData* ptrViewData ); + ~ScColRowNameRangesDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + virtual sal_Bool Close(); + +private: + FixedLine aFlAssign; + ListBox aLbRange; + + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; + RadioButton aBtnColHead; + RadioButton aBtnRowHead; + FixedText aFtAssign2; + formula::RefEdit aEdAssign2; + formula::RefButton aRbAssign2; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + PushButton aBtnAdd; + PushButton aBtnRemove; + + ScRange theCurArea; + ScRange theCurData; + + ScRangePairListRef xColNameRanges; + ScRangePairListRef xRowNameRanges; + + typedef ::boost::unordered_map< String, ScRange, ScStringHashCode, ::std::equal_to<String> > NameRangeMap; + NameRangeMap aRangeMap; + ScViewData* pViewData; + ScDocument* pDoc; + formula::RefEdit* pEdActive; + sal_Bool bDlgLostFocus; + +#ifdef _CRNRDLG_CXX +private: + void Init (); + void UpdateNames (); + void UpdateRangeData ( const ScRange& rRange, sal_Bool bColName ); + void SetColRowData( const ScRange& rLabelRange,sal_Bool bRef=false); + void AdjustColRowData( const ScRange& rDataRange,sal_Bool bRef=false); + DECL_LINK( CancelBtnHdl, void * ); + DECL_LINK( OkBtnHdl, void * ); + DECL_LINK( AddBtnHdl, void * ); + DECL_LINK( RemoveBtnHdl, void * ); + DECL_LINK( Range1SelectHdl, void * ); + DECL_LINK( Range1DataModifyHdl, void * ); + DECL_LINK( ColClickHdl, void * ); + DECL_LINK( RowClickHdl, void * ); + DECL_LINK( Range2DataModifyHdl, void * ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); +#endif +}; + + + +#endif // SC_CRNRDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx new file mode 100644 index 000000000000..68a97150e8e4 --- /dev/null +++ b/sc/source/ui/inc/csvcontrol.hxx @@ -0,0 +1,434 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ============================================================================ + +#ifndef _SC_CSVCONTROL_HXX +#define _SC_CSVCONTROL_HXX + +#include <vcl/ctrl.hxx> +#include "scdllapi.h" +#include "global.hxx" +#include "address.hxx" +#include "csvsplits.hxx" +#include <com/sun/star/uno/Reference.hxx> + + +class ScAccessibleCsvControl; +namespace com { namespace sun { namespace star { namespace accessibility { + class XAccessible; +} } } } + + +// ============================================================================ + +/** Minimum character count for a column in separators mode. */ +const sal_Int32 CSV_MINCOLWIDTH = 8; +/** Maximum length of a cell string. */ +const xub_StrLen CSV_MAXSTRLEN = 0x7FFF; +/** Transparency for header color of selected columns. */ +const sal_uInt16 CSV_HDR_TRANSPARENCY = 85; +/** Minimum distance to border for auto scroll. */ +const sal_Int32 CSV_SCROLL_DIST = 3; + +//! TODO make string array dynamic +const sal_Int32 CSV_PREVIEW_LINES = 32; // maximum count of preview lines +/** Maximum count of columns. */ +const sal_Int32 CSV_MAXCOLCOUNT = MAXCOLCOUNT; + +/** Default column data type. */ +const sal_Int32 CSV_TYPE_DEFAULT = 0; +/** Multi selection with different types. */ +const sal_Int32 CSV_TYPE_MULTI = -1; +/** No column selected. */ +const sal_Int32 CSV_TYPE_NOSELECTION = -2; + +// External used column types. +const sal_uInt8 SC_COL_STANDARD = 1; +const sal_uInt8 SC_COL_TEXT = 2; +const sal_uInt8 SC_COL_MDY = 3; +const sal_uInt8 SC_COL_DMY = 4; +const sal_uInt8 SC_COL_YMD = 5; +const sal_uInt8 SC_COL_SKIP = 9; +const sal_uInt8 SC_COL_ENGLISH = 10; + + +// ============================================================================ + +/** Exported data of a column (data used in the dialog). */ +struct ScCsvExpData +{ + xub_StrLen mnIndex; /// Index of a column. + sal_uInt8 mnType; /// External type of the column. + + inline ScCsvExpData() : mnIndex( 0 ), mnType( SC_COL_STANDARD ) {} + inline ScCsvExpData( xub_StrLen nIndex, sal_uInt8 nType ) : + mnIndex( nIndex ), mnType( nType ) {} +}; + +typedef ::std::vector< ScCsvExpData > ScCsvExpDataVec; + + +// ============================================================================ + +/** Specifies which element should be used to perform an action. */ +enum ScMoveMode +{ + MOVE_NONE, /// No action. + MOVE_FIRST, /// First element in current context. + MOVE_LAST, /// Last element in current context. + MOVE_PREV, /// Predecessor of current element in current context. + MOVE_NEXT, /// Successor of current element in current context. + MOVE_PREVPAGE, /// Previous page relative to current context. + MOVE_NEXTPAGE /// Next page relative to current context. +}; + + +// ============================================================================ + +/** Flags for comparison of old and new control layout data. */ +typedef sal_uInt32 ScCsvDiff; + +const ScCsvDiff CSV_DIFF_EQUAL = 0x00000000; +const ScCsvDiff CSV_DIFF_POSCOUNT = 0x00000001; +const ScCsvDiff CSV_DIFF_POSOFFSET = 0x00000002; +const ScCsvDiff CSV_DIFF_HDRWIDTH = 0x00000004; +const ScCsvDiff CSV_DIFF_CHARWIDTH = 0x00000008; +const ScCsvDiff CSV_DIFF_LINECOUNT = 0x00000010; +const ScCsvDiff CSV_DIFF_LINEOFFSET = 0x00000020; +const ScCsvDiff CSV_DIFF_HDRHEIGHT = 0x00000040; +const ScCsvDiff CSV_DIFF_LINEHEIGHT = 0x00000080; +const ScCsvDiff CSV_DIFF_RULERCURSOR = 0x00000100; +const ScCsvDiff CSV_DIFF_GRIDCURSOR = 0x00000200; + +const ScCsvDiff CSV_DIFF_HORIZONTAL = CSV_DIFF_POSCOUNT | CSV_DIFF_POSOFFSET | CSV_DIFF_HDRWIDTH | CSV_DIFF_CHARWIDTH; +const ScCsvDiff CSV_DIFF_VERTICAL = CSV_DIFF_LINECOUNT | CSV_DIFF_LINEOFFSET | CSV_DIFF_HDRHEIGHT | CSV_DIFF_LINEHEIGHT; +const ScCsvDiff CSV_DIFF_CURSOR = CSV_DIFF_RULERCURSOR | CSV_DIFF_GRIDCURSOR; + + +// ---------------------------------------------------------------------------- + +/** A structure containing all layout data valid for both ruler and data grid + (i.e. scroll position or column width). */ +struct ScCsvLayoutData +{ + // horizontal settings + sal_Int32 mnPosCount; /// Number of positions. + sal_Int32 mnPosOffset; /// Horizontal scroll offset. + + sal_Int32 mnWinWidth; /// Width of ruler and data grid. + sal_Int32 mnHdrWidth; /// Width of the header column. + sal_Int32 mnCharWidth; /// Pixel width of one character. + + // vertical settings + sal_Int32 mnLineCount; /// Number of data lines. + sal_Int32 mnLineOffset; /// Index of first visible line (0-based). + + sal_Int32 mnWinHeight; /// Height of entire data grid (incl. header). + sal_Int32 mnHdrHeight; /// Height of the header line. + sal_Int32 mnLineHeight; /// Height of a data line. + + // cursor settings + sal_Int32 mnPosCursor; /// Position of ruler cursor. + sal_Int32 mnColCursor; /// Position of grid column cursor. + + mutable sal_Int32 mnNoRepaint; /// >0 = no repaint. + bool mbAppRTL; /// true = application in RTL mode. + + explicit ScCsvLayoutData(); + + /** Returns differences to rData. + @descr For each difference the appropriate bit is set in the returned value. */ + ScCsvDiff GetDiff( const ScCsvLayoutData& rData ) const; +}; + +inline bool operator==( const ScCsvLayoutData& rData1, const ScCsvLayoutData& rData2 ) +{ + return rData1.GetDiff( rData2 ) == CSV_DIFF_EQUAL; +} + +inline bool operator!=( const ScCsvLayoutData& rData1, const ScCsvLayoutData& rData2 ) +{ + return !(rData1 == rData2); +} + + +// ============================================================================ + +/** Enumeration of possible commands to change any settings of the CSV controls. + @descr Controls have to send commands instead of changing their settings directly. + This helps to keep the different controls consistent to each other. + A command can contain 0 to 2 sal_Int32 parameters. In the description of each + command the required parameters are swown in brackets. [-] means no parameter. */ +enum ScCsvCmdType +{ + // misc + CSVCMD_NONE, /// No command. [-] + CSVCMD_REPAINT, /// Repaint all controls. [-] + + // modify horizontal dimensions + CSVCMD_SETPOSCOUNT, /// Change position/column count. [character count] + CSVCMD_SETPOSOFFSET, /// Change position offset (scroll pos). [position] + CSVCMD_SETHDRWIDTH, /// Change width of the header column. [width in pixel] + CSVCMD_SETCHARWIDTH, /// Change character pixel width. [width in pixel] + + // modify vertical dimensions + CSVCMD_SETLINECOUNT, /// Change number of data lines. [line count] + CSVCMD_SETLINEOFFSET, /// Change first visible line. [line index] + CSVCMD_SETHDRHEIGHT, /// Change height of top header line. [height in pixel] + CSVCMD_SETLINEHEIGHT, /// Change data line pixel height. [height in pixel} + + // cursors/positions + CSVCMD_MOVERULERCURSOR, /// Move ruler cursor to new position. [position] + CSVCMD_MOVEGRIDCURSOR, /// Move data grid cursor to new column. [position] + CSVCMD_MAKEPOSVISIBLE, /// Move to make passed position visible (for mouse tracking). [position] + + // table contents + CSVCMD_NEWCELLTEXTS, /// Recalculate splits and cell texts. [-] + CSVCMD_UPDATECELLTEXTS, /// Update cell texts with current split settings. [-] + CSVCMD_SETCOLUMNTYPE, /// Change data type of selected columns. [column type] + CSVCMD_EXPORTCOLUMNTYPE, /// Send selected column type to external controls. [-] + CSVCMD_SETFIRSTIMPORTLINE, /// Set number of first imported line. [line index] + + // splits + CSVCMD_INSERTSPLIT, /// Insert a split. [position] + CSVCMD_REMOVESPLIT, /// Remove a split. [position] + CSVCMD_TOGGLESPLIT, /// Inserts or removes a split. [position] + CSVCMD_MOVESPLIT, /// Move a split. [old position, new position] + CSVCMD_REMOVEALLSPLITS /// Remove all splits. [-] +}; + + +// ---------------------------------------------------------------------------- + +/** Data for a CSV control command. The stored position data is aways character based, + it's never a column index (required for internal consistency). */ +class ScCsvCmd +{ +private: + ScCsvCmdType meType; /// The command. + sal_Int32 mnParam1; /// First parameter. + sal_Int32 mnParam2; /// Second parameter. + +public: + inline explicit ScCsvCmd() : meType( CSVCMD_NONE ), + mnParam1( CSV_POS_INVALID ), mnParam2( CSV_POS_INVALID ) {} + + inline void Set( ScCsvCmdType eType, sal_Int32 nParam1, sal_Int32 nParam2 ); + + inline ScCsvCmdType GetType() const { return meType; } + inline sal_Int32 GetParam1() const { return mnParam1; } + inline sal_Int32 GetParam2() const { return mnParam2; } +}; + +inline void ScCsvCmd::Set( ScCsvCmdType eType, sal_Int32 nParam1, sal_Int32 nParam2 ) +{ + meType = eType; mnParam1 = nParam1; mnParam2 = nParam2; +} + + +// ============================================================================ + +/** Base class for the CSV ruler and the data grid control. Implements command handling. */ +class SC_DLLPUBLIC ScCsvControl : public Control +{ +protected: + typedef ::std::vector< String > StringVec; + typedef ::std::vector< StringVec > StringVecVec; + + typedef ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > XAccessibleRef; + +private: + Link maCmdHdl; /// External command handler. + ScCsvCmd maCmd; /// Data of last command. + const ScCsvLayoutData& mrData; /// Shared layout data. + + XAccessibleRef mxAccessible; /// The accessible object of the control. + ScAccessibleCsvControl* mpAccessible; /// Pointer to the accessible implementation object. + bool mbValidGfx; /// Content of virtual devices valid? + + // ------------------------------------------------------------------------ +public: + explicit ScCsvControl( ScCsvControl& rParent ); + explicit ScCsvControl( Window* pParent, const ScCsvLayoutData& rData, WinBits nStyle = 0 ); + explicit ScCsvControl( Window* pParent, const ScCsvLayoutData& rData, const ResId& rResId ); + virtual ~ScCsvControl(); + + // event handling --------------------------------------------------------- + + virtual void GetFocus(); + virtual void LoseFocus(); + + /** Sends a GetFocus or LoseFocus event to the accessibility object. */ + void AccSendFocusEvent( bool bFocused ); + /** Sends a caret changed event to the accessibility object. */ + void AccSendCaretEvent(); + /** Sends a visible area changed event to the accessibility object. */ + void AccSendVisibleEvent(); + /** Sends a selection changed event to the accessibility object. */ + void AccSendSelectionEvent(); + /** Sends a table model changed event for changed cell contents to the accessibility object. */ + void AccSendTableUpdateEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn, bool bAllRows = true ); + /** Sends a table model changed event for an inserted column to the accessibility object. */ + void AccSendInsertColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); + /** Sends a table model changed event for a removed column to the accessibility object. */ + void AccSendRemoveColumnEvent( sal_uInt32 nFirstColumn, sal_uInt32 nLastColumn ); + + // repaint helpers -------------------------------------------------------- + + /** Sets the graphic invalid (next Redraw() will not use cached graphic). */ + inline void InvalidateGfx() { mbValidGfx = false; } + /** Sets the graphic valid (next Redraw() will use cached graphic). */ + inline void ValidateGfx() { mbValidGfx = true; } + /** Returns true, if cached graphic is valid. */ + inline bool IsValidGfx() const { return mbValidGfx; } + + /** Repaints all controls. + @param bInvalidate true = invalidates graphics of this control (not all). */ + void Repaint( bool bInvalidate = false ); + /** Increases no-repaint counter (controls do not repaint until the last EnableRepaint()). */ + void DisableRepaint(); + /** Decreases no-repaint counter and repaints if counter reaches 0. + @param bInvalidate true = invalidates graphics of this control (not all). */ + void EnableRepaint( bool bInvalidate = false ); + /** Returns true, if controls will not repaint. */ + inline bool IsNoRepaint() const { return mrData.mnNoRepaint > 0; } + + // command handling ------------------------------------------------------- + + /** Sets a new command handler. */ + inline void SetCmdHdl( const Link& rHdl ) { maCmdHdl = rHdl; } + /** Returns the current command handler. */ + inline const Link& GetCmdHdl() const { return maCmdHdl; } + /** Returns data of the last command. */ + inline const ScCsvCmd& GetCmd() const { return maCmd; } + + /** Executes a command by calling command handler. */ + void Execute( + ScCsvCmdType eType, + sal_Int32 nParam1 = CSV_POS_INVALID, + sal_Int32 nParam2 = CSV_POS_INVALID ); + + // layout helpers --------------------------------------------------------- + + /** Returns a reference to the current layout data. */ + inline const ScCsvLayoutData& GetLayoutData() const { return mrData; } + /** Returns true, if the Right-to-Left layout mode is active. */ + inline bool IsRTL() const { return mrData.mbAppRTL; } + + /** Returns the number of available positions. */ + inline sal_Int32 GetPosCount() const { return mrData.mnPosCount; } + /** Returns the number of visible positions. */ + sal_Int32 GetVisPosCount() const; + /** Returns the first visible position. */ + inline sal_Int32 GetFirstVisPos() const { return mrData.mnPosOffset; } + /** Returns the last visible position. */ + inline sal_Int32 GetLastVisPos() const { return GetFirstVisPos() + GetVisPosCount(); } + /** Returns highest possible position for first visible character. */ + sal_Int32 GetMaxPosOffset() const; + + /** Returns true, if it is allowed to set a split at nPos. */ + bool IsValidSplitPos( sal_Int32 nPos ) const; + /** Returns true, if nPos is an allowed AND visible split position. */ + bool IsVisibleSplitPos( sal_Int32 nPos ) const; + + /** Returns the width of the header column. */ + inline sal_Int32 GetHdrWidth() const { return mrData.mnHdrWidth; } + /** Returns the width of one character column. */ + inline sal_Int32 GetCharWidth() const { return mrData.mnCharWidth; } + /** Returns the start position of the header column. */ + sal_Int32 GetHdrX() const; + /** Returns the X position of the first pixel of the data area. */ + sal_Int32 GetFirstX() const; + /** Returns the X position of the last pixel of the data area. */ + sal_Int32 GetLastX() const; + /** Returns output X coordinate of the specified position. */ + sal_Int32 GetX( sal_Int32 nPos ) const; + /** Returns position from output coordinate. */ + sal_Int32 GetPosFromX( sal_Int32 nX ) const; + + /** Returns the number of data lines. */ + inline sal_Int32 GetLineCount() const { return mrData.mnLineCount; } + /** Returns the number of visible lines (including partly visible bottom line). */ + sal_Int32 GetVisLineCount() const; + /** Returns index of first visible line. */ + inline sal_Int32 GetFirstVisLine() const { return mrData.mnLineOffset; } + /** Returns index of last visible line. */ + sal_Int32 GetLastVisLine() const; + /** Returns highest possible index for first line. */ + sal_Int32 GetMaxLineOffset() const; + + /** Returns true, if nLine is a valid line index. */ + bool IsValidLine( sal_Int32 nLine ) const; + /** Returns true, if nLine is a valid and visible line index. */ + bool IsVisibleLine( sal_Int32 nLine ) const; + + /** Returns the height of the header line. */ + inline sal_Int32 GetHdrHeight() const { return mrData.mnHdrHeight; } + /** Returns the height of one line. */ + inline sal_Int32 GetLineHeight() const { return mrData.mnLineHeight; } + /** Returns output Y coordinate of the specified line. */ + sal_Int32 GetY( sal_Int32 nLine ) const; + /** Returns line index from output coordinate. */ + sal_Int32 GetLineFromY( sal_Int32 nY ) const; + + /** Returns the ruler cursor position. */ + inline sal_Int32 GetRulerCursorPos() const { return mrData.mnPosCursor; } + /** Returns the data grid cursor position (not column index!). */ + inline sal_Int32 GetGridCursorPos() const { return mrData.mnColCursor; } + + // static helpers --------------------------------------------------------- + + /** Inverts a rectangle in the specified output device. */ + static void ImplInvertRect( OutputDevice& rOutDev, const Rectangle& rRect ); + + /** Returns direction code for the keys LEFT, RIGHT, HOME, END. + @param bHomeEnd false = ignore HOME and END key. */ + static ScMoveMode GetHorzDirection( sal_uInt16 nCode, bool bHomeEnd ); + /** Returns direction code for the keys UP, DOWN, HOME, END, PAGE UP, PAGE DOWN. + @param bHomeEnd false = ignore HOME and END key. */ + static ScMoveMode GetVertDirection( sal_uInt16 nCode, bool bHomeEnd ); + + // accessibility ---------------------------------------------------------- +public: + /** Creates and returns the accessible object of this control. Do not overwrite in + derived classes, use ImplCreateAccessible() instead. */ + virtual XAccessibleRef CreateAccessible(); + +protected: + /** Derived classes create a new accessible object here. */ + virtual ScAccessibleCsvControl* ImplCreateAccessible() = 0; +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx new file mode 100644 index 000000000000..acb21731528e --- /dev/null +++ b/sc/source/ui/inc/csvgrid.hxx @@ -0,0 +1,363 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ============================================================================ + +#ifndef _SC_CSVGRID_HXX +#define _SC_CSVGRID_HXX + +#include <vcl/virdev.hxx> +#include <vcl/menu.hxx> +#include <unotools/options.hxx> + +#include <vector> +#include <memory> +#include "scdllapi.h" +#include "csvcontrol.hxx" +#include "csvsplits.hxx" + + +// ---------------------------------------------------------------------------- + +namespace svtools { class ColorConfig; } +class EditEngine; +class ScEditEngineDefaulter; +class ScAsciiOptions; +class ScAccessibleCsvControl; + + +// ============================================================================ + +const sal_uInt8 CSV_COLFLAG_NONE = 0x00; /// Nothing set. +const sal_uInt8 CSV_COLFLAG_SELECT = 0x01; /// Column is selected. + +const sal_uInt32 CSV_COLUMN_INVALID = CSV_VEC_NOTFOUND; + + +// ---------------------------------------------------------------------------- + +/** This struct contains the state of one table column. */ +struct ScCsvColState +{ + sal_Int32 mnType; /// Data type. + sal_uInt8 mnFlags; /// Flags (i.e. selection state). + + inline explicit ScCsvColState( + sal_Int32 nType = CSV_TYPE_DEFAULT, + sal_uInt8 nFlags = CSV_COLFLAG_NONE ) : + mnType( nType ), mnFlags( nFlags ) {} + + inline bool IsSelected() const; + inline void Select( bool bSel ); +}; + +inline bool ScCsvColState::IsSelected() const +{ + return (mnFlags & CSV_COLFLAG_SELECT) != 0; +} + +inline void ScCsvColState::Select( bool bSel ) +{ + if( bSel ) mnFlags |= CSV_COLFLAG_SELECT; else mnFlags &= ~CSV_COLFLAG_SELECT; +} + + +// ---------------------------------------------------------------------------- + +typedef ::std::vector< ScCsvColState > ScCsvColStateVec; + + +// ============================================================================ + +/** A data grid control for the CSV import dialog. The design of this control + simulates a Calc spreadsheet with row and column headers. */ +class SC_DLLPUBLIC ScCsvGrid : public ScCsvControl, public utl::ConfigurationListener +{ +private: + typedef ::std::auto_ptr< ScEditEngineDefaulter > ScEditEnginePtr; + + VirtualDevice maBackgrDev; /// Grid background, headers, cell texts. + VirtualDevice maGridDev; /// Data grid with selection and cursor. + PopupMenu maPopup; /// Popup menu for column types. + + ::svtools::ColorConfig* mpColorConfig; /// Application color configuration. + Color maBackColor; /// Cell background color. + Color maGridColor; /// Table grid color. + Color maGridPBColor; /// Grid color for "first imported line" delimiter. + Color maAppBackColor; /// Background color for unused area. + Color maTextColor; /// Text color for data area. + Color maHeaderBackColor; /// Background color for headers. + Color maHeaderGridColor; /// Grid color for headers. + Color maHeaderTextColor; /// Text color for headers. + Color maSelectColor; /// Header color of selected columns. + + ScEditEnginePtr mpEditEngine; /// For drawing cell texts. + Font maHeaderFont; /// Font for column and row headers. + Font maMonoFont; /// Monospace font for data cells. + Size maWinSize; /// Size of the control. + Size maEdEngSize; /// Paper size for edit engine. + + ScCsvSplits maSplits; /// Vector with split positions. + ScCsvColStateVec maColStates; /// State of each column. + StringVec maTypeNames; /// UI names of data types. + StringVecVec maTexts; /// 2D-vector for cell texts. + + sal_Int32 mnFirstImpLine; /// First imported line (0-based). + sal_uInt32 mnRecentSelCol; /// Index of most recently selected column. + sal_uInt32 mnMTCurrCol; /// Current column of mouse tracking. + bool mbMTSelecting; /// Mouse tracking: true = select, false = deselect. + + // ------------------------------------------------------------------------ +public: + explicit ScCsvGrid( ScCsvControl& rParent ); + virtual ~ScCsvGrid(); + + /** Finishes initialization. Must be called after constructing a new object. */ + void Init(); + + // common grid handling --------------------------------------------------- +public: + /** Updates layout data dependent from the control's state. */ + void UpdateLayoutData(); + /** Updates X coordinate of first visible position dependent from line numbers. */ + void UpdateOffsetX(); + /** Apply current layout data to the grid control. */ + void ApplyLayout( const ScCsvLayoutData& rOldData ); + /** Sets the number of the first imported line (for visual feedback). nLine is 0-based! */ + void SetFirstImportedLine( sal_Int32 nLine ); + + /** Finds a column position nearest to nPos which does not cause scrolling the visible area. */ + sal_Int32 GetNoScrollCol( sal_Int32 nPos ) const; + +private: + /** Reads colors from system settings. */ + SC_DLLPRIVATE void InitColors(); + /** Initializes all font settings. */ + SC_DLLPRIVATE void InitFonts(); + /** Initializes all data dependent from the control's size. */ + SC_DLLPRIVATE void InitSizeData(); + + // split handling --------------------------------------------------------- +public: + /** Inserts a split. */ + void InsertSplit( sal_Int32 nPos ); + /** Removes a split. */ + void RemoveSplit( sal_Int32 nPos ); + /** Inserts a new or removes an existing split. */ + void MoveSplit( sal_Int32 nPos, sal_Int32 nNewPos ); + /** Removes all splits. */ + void RemoveAllSplits(); + /** Removes all splits and inserts the splits from rSplits. */ + void SetSplits( const ScCsvSplits& rSplits ); + +private: + /** Inserts a split and adjusts column data. */ + SC_DLLPRIVATE bool ImplInsertSplit( sal_Int32 nPos ); + /** Removes a split and adjusts column data. */ + SC_DLLPRIVATE bool ImplRemoveSplit( sal_Int32 nPos ); + /** Clears the split array and re-inserts boundary splits. */ + SC_DLLPRIVATE void ImplClearSplits(); + + // columns/column types --------------------------------------------------- +public: + /** Returns the number of columns. */ + inline sal_uInt32 GetColumnCount() const { return maColStates.size(); } + /** Returns the index of the first visible column. */ + sal_uInt32 GetFirstVisColumn() const; + /** Returns the index of the last visible column. */ + sal_uInt32 GetLastVisColumn() const; + + /** Returns true, if nColIndex points to an existing column. */ + bool IsValidColumn( sal_uInt32 nColIndex ) const; + /** Returns true, if column with index nColIndex is (at least partly) visible. */ + bool IsVisibleColumn( sal_uInt32 nColIndex ) const; + + /** Returns X coordinate of the specified column. */ + sal_Int32 GetColumnX( sal_uInt32 nColIndex ) const; + /** Returns column index from output coordinate. */ + sal_uInt32 GetColumnFromX( sal_Int32 nX ) const; + + /** Returns start position of the column with the specified index. */ + inline sal_Int32 GetColumnPos( sal_uInt32 nColIndex ) const { return maSplits[ nColIndex ]; } + /** Returns column index from position. A split counts to its following column. */ + sal_uInt32 GetColumnFromPos( sal_Int32 nPos ) const; + /** Returns the character width of the column with the specified index. */ + sal_Int32 GetColumnWidth( sal_uInt32 nColIndex ) const; + + /** Returns the vector with the states of all columns. */ + inline const ScCsvColStateVec& GetColumnStates() const { return maColStates; } + /** Sets all column states to the values in the passed vector. */ + void SetColumnStates( const ScCsvColStateVec& rColStates ); + /** Returns the data type of the selected columns. */ + sal_Int32 GetSelColumnType() const; + /** Changes the data type of all selected columns. */ + void SetSelColumnType( sal_Int32 nType ); + /** Sets new UI data type names. */ + void SetTypeNames( const StringVec& rTypeNames ); + /** Returns the UI type name of the specified column. */ + const String& GetColumnTypeName( sal_uInt32 nColIndex ) const; + + /** Fills the options object with column data for separators mode. */ + void FillColumnDataSep( ScAsciiOptions& rOptions ) const; + /** Fills the options object with column data for fixed width mode. */ + void FillColumnDataFix( ScAsciiOptions& rOptions ) const; + +private: + /** Returns the data type of the specified column. */ + SC_DLLPRIVATE sal_Int32 GetColumnType( sal_uInt32 nColIndex ) const; + /** Returns the data type of the specified column. */ + SC_DLLPRIVATE void SetColumnType( sal_uInt32 nColIndex, sal_Int32 nColType ); + + /** Scrolls data grid vertically. */ + SC_DLLPRIVATE void ScrollVertRel( ScMoveMode eDir ); + /** Executes the data type popup menu. */ + SC_DLLPRIVATE void ExecutePopup( const Point& rPos ); + + // selection handling ----------------------------------------------------- +public: + /** Returns true, if the specified column is selected. */ + bool IsSelected( sal_uInt32 nColIndex ) const; + /** Returns index of the first selected column. */ + sal_uInt32 GetFirstSelected() const; + /** Returns index of the first selected column really after nFromIndex. */ + sal_uInt32 GetNextSelected( sal_uInt32 nFromIndex ) const; + /** Returns true, if at least one column is selected. */ + inline bool HasSelection() const { return GetFirstSelected() != CSV_COLUMN_INVALID; } + + /** Selects or deselects the specified column. */ + void Select( sal_uInt32 nColIndex, bool bSelect = true ); + /** Toggles selection of the specified column. */ + void ToggleSelect( sal_uInt32 nColIndex ); + /** Selects or deselects the specified column range. */ + void SelectRange( sal_uInt32 nColIndex1, sal_uInt32 nColIndex2, bool bSelect = true ); + /** Selects or deselects all columns. */ + void SelectAll( bool bSelect = true ); + + /** Returns index of the focused column. */ + inline sal_uInt32 GetFocusColumn() const { return GetColumnFromPos( GetGridCursorPos() ); } + +private: + /** Moves column cursor to a new position. */ + SC_DLLPRIVATE void MoveCursor( sal_uInt32 nColIndex ); + /** Moves column cursor to the given direction. */ + SC_DLLPRIVATE void MoveCursorRel( ScMoveMode eDir ); + + /** Clears the entire selection without notify. */ + SC_DLLPRIVATE void ImplClearSelection(); + + /** Executes selection action for a specific column. */ + SC_DLLPRIVATE void DoSelectAction( sal_uInt32 nColIndex, sal_uInt16 nModifier ); + + // cell contents ---------------------------------------------------------- +public: + /** Fills all cells of a line with the passed text (separators mode). */ + void ImplSetTextLineSep( + sal_Int32 nLine, const String& rTextLine, + const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep ); + /** Fills all cells of a line with the passed text (fixed width mode). */ + void ImplSetTextLineFix( sal_Int32 nLine, const String& rTextLine ); + + /** Returns the text of the specified cell. */ + const String& GetCellText( sal_uInt32 nColIndex, sal_Int32 nLine ) const; + + // event handling --------------------------------------------------------- +protected: + virtual void Resize(); + virtual void GetFocus(); + virtual void LoseFocus(); + + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void Tracking( const TrackingEvent& rTEvt ); + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void Command( const CommandEvent& rCEvt ); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + + virtual void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 ); + + // painting --------------------------------------------------------------- +protected: + virtual void Paint( const Rectangle& ); + +public: + /** Redraws the entire data grid. */ + void ImplRedraw(); + /** Returns a pointer to the used edit engine. */ + EditEngine* GetEditEngine(); + +private: + /** Returns the width of the control. */ + inline sal_Int32 GetWidth() const { return maWinSize.Width(); } + /** Returns the height of the control. */ + inline sal_Int32 GetHeight() const { return maWinSize.Height(); } + + /** Sets a clip region in the specified output device for the specified column. */ + SC_DLLPRIVATE void ImplSetColumnClipRegion( OutputDevice& rOutDev, sal_uInt32 nColIndex ); + /** Draws the header of the specified column to the specified output device. */ + SC_DLLPRIVATE void ImplDrawColumnHeader( OutputDevice& rOutDev, sal_uInt32 nColIndex, Color aFillColor ); + + /** Draws the text at the specified position to maBackgrDev. */ + SC_DLLPRIVATE void ImplDrawCellText( const Point& rPos, const String& rText ); + /** Draws the "first imported line" separator to maBackgrDev (or erases, if bSet is false). */ + SC_DLLPRIVATE void ImplDrawFirstLineSep( bool bSet ); + /** Draws the column with index nColIndex to maBackgrDev. */ + SC_DLLPRIVATE void ImplDrawColumnBackgr( sal_uInt32 nColIndex ); + /** Draws the row headers column to maBackgrDev. */ + SC_DLLPRIVATE void ImplDrawRowHeaders(); + /** Draws all columns and the row headers column to maBackgrDev. */ + SC_DLLPRIVATE void ImplDrawBackgrDev(); + + /** Draws the column with index nColIndex with its selection state to maGridDev. */ + SC_DLLPRIVATE void ImplDrawColumnSelection( sal_uInt32 nColIndex ); + /** Draws all columns with selection and cursor to maGridDev. */ + SC_DLLPRIVATE void ImplDrawGridDev(); + + /** Redraws the entire column (background and selection). */ + SC_DLLPRIVATE void ImplDrawColumn( sal_uInt32 nColIndex ); + + /** Optimized drawing: Scrolls horizontally and redraws only missing parts. */ + SC_DLLPRIVATE void ImplDrawHorzScrolled( sal_Int32 nOldPos ); + + /** Inverts the cursor bar at the specified position in maGridDev. */ + SC_DLLPRIVATE void ImplInvertCursor( sal_Int32 nPos ); + + /** Draws directly tracking rectangle to the column with the specified index. */ + SC_DLLPRIVATE void ImplDrawTrackingRect( sal_uInt32 nColIndex ); + + // accessibility ---------------------------------------------------------- +protected: + /** Creates a new accessible object. */ + virtual ScAccessibleCsvControl* ImplCreateAccessible(); +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/csvruler.hxx b/sc/source/ui/inc/csvruler.hxx new file mode 100644 index 000000000000..c0c1f99cc5da --- /dev/null +++ b/sc/source/ui/inc/csvruler.hxx @@ -0,0 +1,202 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ============================================================================ + +#ifndef _SC_CSVRULER_HXX +#define _SC_CSVRULER_HXX + +#include <vcl/virdev.hxx> +#include "csvcontrol.hxx" +#include "csvsplits.hxx" +#include "scdllapi.h" + +class ScAccessibleCsvControl; + + +// ============================================================================ + +/** A ruler control for the CSV import dialog. Supports setting and moving + splits (which divide lines of data into several columns). */ +class SC_DLLPUBLIC ScCsvRuler : public ScCsvControl +{ +private: + VirtualDevice maBackgrDev; /// Ruler background, scaling. + VirtualDevice maRulerDev; /// Ruler with splits and cursor. + + Color maBackColor; /// Background color. + Color maActiveColor; /// Color for active part of ruler. + Color maTextColor; /// Text and scale color. + Color maSplitColor; /// Split area color. + + ScCsvSplits maSplits; /// Vector with split positions. + ScCsvSplits maOldSplits; /// Old state for cancellation. + + sal_Int32 mnPosCursorLast; /// Last valid position of cursor. + sal_Int32 mnPosMTStart; /// Start position of mouse tracking. + sal_Int32 mnPosMTCurr; /// Current position of mouse tracking. + bool mbPosMTMoved; /// Tracking: Anytime moved to another position? + + Size maWinSize; /// Size of the control. + Rectangle maActiveRect; /// The active area of the ruler. + sal_Int32 mnSplitSize; /// Size of a split circle. + + // ------------------------------------------------------------------------ +public: + explicit ScCsvRuler( ScCsvControl& rParent ); + ~ScCsvRuler(); + + // common ruler handling -------------------------------------------------- +public: + using Window::SetPosSizePixel; + /** Sets position and size of the ruler. The height is calculated internally. */ + virtual void SetPosSizePixel( + long nX, long nY, + long nWidth, long nHeight, + sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ); + + /** Apply current layout data to the ruler. */ + void ApplyLayout( const ScCsvLayoutData& rOldData ); + +private: + /** Reads colors from system settings. */ + SC_DLLPRIVATE void InitColors(); + /** Initializes all data dependent from the control's size. */ + SC_DLLPRIVATE void InitSizeData(); + + /** Moves cursor to a new position. + @param bScroll sal_True = The method may scroll the ruler. */ + SC_DLLPRIVATE void MoveCursor( sal_Int32 nPos, bool bScroll = true ); + /** Moves cursor to the given direction. */ + SC_DLLPRIVATE void MoveCursorRel( ScMoveMode eDir ); + /** Sets cursor to an existing split, according to eDir. */ + SC_DLLPRIVATE void MoveCursorToSplit( ScMoveMode eDir ); + /** Scrolls data grid vertically. */ + SC_DLLPRIVATE void ScrollVertRel( ScMoveMode eDir ); + + // split handling --------------------------------------------------------- +public: + /** Returns the split array. */ + inline const ScCsvSplits& GetSplits() const { return maSplits; } + /** Returns the number of splits. */ + inline sal_uInt32 GetSplitCount() const + { return maSplits.Count(); } + /** Returns the position of the specified split. */ + inline sal_Int32 GetSplitPos( sal_uInt32 nIndex ) const + { return maSplits[ nIndex ]; } + /** Finds a position nearest to nPos which does not cause scrolling the visible area. */ + sal_Int32 GetNoScrollPos( sal_Int32 nPos ) const; + + /** Returns true if at position nPos is a split. */ + inline bool HasSplit( sal_Int32 nPos ) const { return maSplits.HasSplit( nPos ); } + /** Inserts a split. */ + void InsertSplit( sal_Int32 nPos ); + /** Removes a split. */ + void RemoveSplit( sal_Int32 nPos ); + /** Moves a split from nPos to nNewPos. */ + void MoveSplit( sal_Int32 nPos, sal_Int32 nNewPos ); + /** Removes all splits of the ruler. */ + void RemoveAllSplits(); + +private: + /** Finds next position without a split. */ + SC_DLLPRIVATE sal_Int32 FindEmptyPos( sal_Int32 nPos, ScMoveMode eDir ) const; + + /** Moves split and cursor to nNewPos and commits event. */ + SC_DLLPRIVATE void MoveCurrSplit( sal_Int32 nNewPos ); + /** Moves split and cursor to the given direction and commits event. */ + SC_DLLPRIVATE void MoveCurrSplitRel( ScMoveMode eDir ); + + // event handling --------------------------------------------------------- +protected: + virtual void Resize(); + virtual void GetFocus(); + virtual void LoseFocus(); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void Tracking( const TrackingEvent& rTEvt ); + + virtual void KeyInput( const KeyEvent& rKEvt ); + +private: + /** Starts tracking at the specified position. */ + SC_DLLPRIVATE void StartMouseTracking( sal_Int32 nPos ); + /** Moves tracking to a new position. */ + SC_DLLPRIVATE void MoveMouseTracking( sal_Int32 nPos ); + /** Applies tracking action for the current tracking position. + @param bApply sal_True = apply action, sal_False = cancel action. */ + SC_DLLPRIVATE void EndMouseTracking( bool bApply ); + + // painting --------------------------------------------------------------- +protected: + virtual void Paint( const Rectangle& ); + +public: + /** Redraws the entire ruler. */ + void ImplRedraw(); + +private: + /** Returns the width of the control. */ + inline sal_Int32 GetWidth() const { return maWinSize.Width(); } + /** Returns the height of the control. */ + inline sal_Int32 GetHeight() const { return maWinSize.Height(); } + + /** Draws the background and active area to maBackgrDev (only the given X range). */ + SC_DLLPRIVATE void ImplDrawArea( sal_Int32 nPosX, sal_Int32 nWidth ); + /** Draws the entire ruler background with scaling to maBackgrDev. */ + SC_DLLPRIVATE void ImplDrawBackgrDev(); + + /** Draws a split to maRulerDev. */ + SC_DLLPRIVATE void ImplDrawSplit( sal_Int32 nPos ); + /** Erases a split from maRulerDev. */ + SC_DLLPRIVATE void ImplEraseSplit( sal_Int32 nPos ); + /** Draws the ruler background, all splits and the cursor to maRulerDev. */ + SC_DLLPRIVATE void ImplDrawRulerDev(); + + /** Inverts the cursor bar at the specified position in maRulerDev. */ + SC_DLLPRIVATE void ImplInvertCursor( sal_Int32 nPos ); + /** Draws directly tracking rectangle to the column with the specified index. */ + SC_DLLPRIVATE void ImplDrawTrackingRect(); + + /** Sets arrow or horizontal split pointer. */ + SC_DLLPRIVATE void ImplSetMousePointer( sal_Int32 nPos ); + + // accessibility ---------------------------------------------------------- +protected: + /** Creates a new accessible object. */ + virtual ScAccessibleCsvControl* ImplCreateAccessible(); +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/csvsplits.hxx b/sc/source/ui/inc/csvsplits.hxx new file mode 100644 index 000000000000..42d38bcca803 --- /dev/null +++ b/sc/source/ui/inc/csvsplits.hxx @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ============================================================================ + +#ifndef _SC_CSVSPLITS_HXX +#define _SC_CSVSPLITS_HXX + +#include <sal/types.h> + +#include <vector> + + +// ============================================================================ + +/** Constant for an invalid vector index. */ +const sal_uInt32 CSV_VEC_NOTFOUND = SAL_MAX_UINT32; +/** Constant for an invalid ruler position. */ +const sal_Int32 CSV_POS_INVALID = -1; + + +// ---------------------------------------------------------------------------- + +/** A vector of column splits that supports inserting, removing and moving splits. */ +class ScCsvSplits +{ +private: + typedef ::std::vector< sal_Int32 > ScSplitVector; + typedef ScSplitVector::iterator iterator; + typedef ScSplitVector::const_iterator const_iterator; + + ScSplitVector maVec; /// The split containter. + +public: + // *** access by position *** --------------------------------------------- + + /** Inserts a new split at position nPos into the vector. + @return true = split inserted (nPos was valid and empty). */ + bool Insert( sal_Int32 nPos ); + /** Removes a split by position. + @return true = split found and removed. */ + bool Remove( sal_Int32 nPos ); + /** Removes a range of splits in the given position range. */ + void RemoveRange( sal_Int32 nPosStart, sal_Int32 nPosEnd ); + /** Removes all elements from the vector. */ + void Clear(); + + /** Returns true if at position nPos is a split. */ + bool HasSplit( sal_Int32 nPos ) const; + + // *** access by index *** ------------------------------------------------ + + /** Searches for a split at position nPos. + @return the vector index of the split. */ + sal_uInt32 GetIndex( sal_Int32 nPos ) const; + /** Returns index of the first split greater than or equal to nPos. */ + sal_uInt32 LowerBound( sal_Int32 nPos ) const; + /** Returns index of the last split less than or equal to nPos. */ + sal_uInt32 UpperBound( sal_Int32 nPos ) const; + + /** Returns the number of splits. */ + inline sal_uInt32 Count() const + { return maVec.size(); } + /** Returns the position of the specified split. */ + sal_Int32 GetPos( sal_uInt32 nIndex ) const; + /** Returns the position of the specified split. */ + inline sal_Int32 operator[]( sal_uInt32 nIndex ) const + { return GetPos( nIndex ); } + +private: + /** Returns the vector index of an iterator. */ + sal_uInt32 GetIterIndex( const_iterator aIter ) const; +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/csvtablebox.hxx b/sc/source/ui/inc/csvtablebox.hxx new file mode 100644 index 000000000000..22bb380e38c2 --- /dev/null +++ b/sc/source/ui/inc/csvtablebox.hxx @@ -0,0 +1,159 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ============================================================================ + +#ifndef _SC_CSVTABLEBOX_HXX +#define _SC_CSVTABLEBOX_HXX + +#include <vcl/ctrl.hxx> +#include <vcl/scrbar.hxx> +#include "scdllapi.h" +#include "csvcontrol.hxx" +#include "csvruler.hxx" +#include "csvgrid.hxx" + + +class ListBox; +class ScAsciiOptions; + + +/* ============================================================================ +Position: Positions between the characters (the dots in the ruler). +Character: The characters (the range from one position to the next). +Split: Positions which contain a split to divide characters into groups (columns). +Column: The range between two splits. +============================================================================ */ + +/** The control in the CSV import dialog that contains a ruler and a data grid + to visualize and modify the current import settings. */ +class SC_DLLPUBLIC ScCsvTableBox : public ScCsvControl +{ +private: + ScCsvLayoutData maData; /// Current layout data of the controls. + + ScCsvRuler maRuler; /// The ruler for fixed width mode. + ScCsvGrid maGrid; /// Calc-like data table for fixed width mode. + ScrollBar maHScroll; /// Horizontal scroll bar. + ScrollBar maVScroll; /// Vertical scroll bar. + ScrollBarBox maScrollBox; /// For the bottom right edge. + + Link maUpdateTextHdl; /// Updates all cell texts. + Link maColTypeHdl; /// Handler for exporting the column type. + + ScCsvColStateVec maFixColStates; /// Column states in fixed width mode. + ScCsvColStateVec maSepColStates; /// Column states in separators mode. + + sal_Int32 mnFixedWidth; /// Cached total width for fixed width mode. + + bool mbFixedMode; /// false = Separators, true = Fixed width. + + // ------------------------------------------------------------------------ +public: + explicit ScCsvTableBox( Window* pParent, const ResId& rResId ); + + /** Finishes initialization. Must be called after constructing a new object. */ + void Init(); + + // common table box handling ---------------------------------------------- +public: + /** Sets the control to separators mode. */ + void SetSeparatorsMode(); + /** Sets the control to fixed width mode. */ + void SetFixedWidthMode(); + +private: + /** Initializes the children controls (pos/size, scroll bars, ...). */ + SC_DLLPRIVATE void InitControls(); + /** Initializes size and position data of horizontal scrollbar. */ + SC_DLLPRIVATE void InitHScrollBar(); + /** Initializes size and position data of vertical scrollbar. */ + SC_DLLPRIVATE void InitVScrollBar(); + + /** Calculates and sets valid position offset nearest to nPos. */ + SC_DLLPRIVATE inline void ImplSetPosOffset( sal_Int32 nPos ) + { maData.mnPosOffset = Max( Min( nPos, GetMaxPosOffset() ), sal_Int32( 0 ) ); } + /** Calculates and sets valid line offset nearest to nLine. */ + SC_DLLPRIVATE inline void ImplSetLineOffset( sal_Int32 nLine ) + { maData.mnLineOffset = Max( Min( nLine, GetMaxLineOffset() ), sal_Int32( 0 ) ); } + /** Moves controls (not cursors!) so that nPos becomes visible. */ + SC_DLLPRIVATE void MakePosVisible( sal_Int32 nPos ); + + // cell contents ---------------------------------------------------------- +public: + /** Fills all cells of all lines with the passed texts (Unicode strings). */ + void SetUniStrings( + const String* pTextLines, const String& rSepChars, + sal_Unicode cTextSep, bool bMergeSep ); + + // column settings -------------------------------------------------------- +public: + /** Reads UI strings for data types from the list box. */ + void InitTypes( const ListBox& rListBox ); + /** Returns the data type of the selected columns. */ + inline sal_Int32 GetSelColumnType() const { return maGrid.GetSelColumnType(); } + + /** Fills the options object with current column data. */ + void FillColumnData( ScAsciiOptions& rOptions ) const; + + // event handling --------------------------------------------------------- +public: + /** Sets a new handler for "update cell texts" requests. */ + inline void SetUpdateTextHdl( const Link& rHdl ) { maUpdateTextHdl = rHdl; } + /** Returns the handler for "update cell texts" requests. */ + inline const Link& GetUpdateTextHdl() const { return maUpdateTextHdl; } + /** Sets a new handler for "column selection changed" events. */ + inline void SetColTypeHdl( const Link& rHdl ) { maColTypeHdl = rHdl; } + /** Returns the handler for "column selection changed" events. */ + inline const Link& GetColTypeHdl() const { return maColTypeHdl; } + +protected: + virtual void Resize(); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + +private: + SC_DLLPRIVATE DECL_LINK( CsvCmdHdl, ScCsvControl* ); + SC_DLLPRIVATE DECL_LINK( ScrollHdl, ScrollBar* ); + SC_DLLPRIVATE DECL_LINK( ScrollEndHdl, ScrollBar* ); + + // accessibility ---------------------------------------------------------- +public: + /** Creates and returns the accessible object of this control. */ + virtual XAccessibleRef CreateAccessible(); + +protected: + /** Creates a new accessible object. */ + virtual ScAccessibleCsvControl* ImplCreateAccessible(); +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dapidata.hxx b/sc/source/ui/inc/dapidata.hxx new file mode 100644 index 000000000000..588ef43cf72a --- /dev/null +++ b/sc/source/ui/inc/dapidata.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DAPIDATA_HXX +#define SC_DAPIDATA_HXX + +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/combobox.hxx> + +//------------------------------------------------------------------------ + +struct ScImportSourceDesc; + + +class ScDataPilotDatabaseDlg : public ModalDialog +{ +private: + FixedLine aFlFrame; + FixedText aFtDatabase; + ListBox aLbDatabase; + FixedText aFtObject; + ComboBox aCbObject; + FixedText aFtType; + ListBox aLbType; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + void FillObjects(); + + DECL_LINK( SelectHdl, ListBox* ); + +public: + ScDataPilotDatabaseDlg( Window* pParent ); + ~ScDataPilotDatabaseDlg(); + + void GetValues( ScImportSourceDesc& rDesc ); +}; + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx new file mode 100644 index 000000000000..54eefe20f520 --- /dev/null +++ b/sc/source/ui/inc/dapitype.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DAPITYPE_HXX +#define SC_DAPITYPE_HXX + +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/edit.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <com/sun/star/uno/Sequence.hxx> + +//------------------------------------------------------------------------ + +class ScDataPilotSourceTypeDlg : public ModalDialog +{ +private: + FixedLine aFlFrame; + RadioButton aBtnSelection; + RadioButton aBtnNamedRange; + RadioButton aBtnDatabase; + RadioButton aBtnExternal; + ListBox aLbNamedRange; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + +public: + ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bEnableExternal ); + ~ScDataPilotSourceTypeDlg(); + + bool IsDatabase() const; + bool IsExternal() const; + bool IsNamedRange() const; + rtl::OUString GetSelectedNamedRange() const; + void AppendNamedRange(const rtl::OUString& rNames); + +private: + DECL_LINK( RadioClickHdl, RadioButton * ); +}; + + +class ScDataPilotServiceDlg : public ModalDialog +{ +private: + FixedLine aFlFrame; + FixedText aFtService; + ListBox aLbService; + FixedText aFtSource; + Edit aEdSource; + FixedText aFtName; + Edit aEdName; + FixedText aFtUser; + Edit aEdUser; + FixedText aFtPasswd; + Edit aEdPasswd; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + +public: + ScDataPilotServiceDlg( Window* pParent, + const com::sun::star::uno::Sequence<rtl::OUString>& rServices ); + ~ScDataPilotServiceDlg(); + + String GetServiceName() const; + String GetParSource() const; + String GetParName() const; + String GetParUser() const; + String GetParPass() const; +}; + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/datafdlg.hrc b/sc/source/ui/inc/datafdlg.hrc new file mode 100644 index 000000000000..2a8341da5482 --- /dev/null +++ b/sc/source/ui/inc/datafdlg.hrc @@ -0,0 +1,42 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Amelia Wang <amwang@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "sc.hrc" // -> RID_SCDLG_DATAFORM + +//dataform +#define BTN_DATAFORM_NEW 1 +#define BTN_DATAFORM_DELETE 2 +#define BTN_DATAFORM_RESTORE 3 +#define BTN_DATAFORM_LAST 4 +#define BTN_DATAFORM_NEXT 5 +#define BTN_DATAFORM_CLOSE 6 +#define WND_DATAFORM_SCROLLBAR 7 +#define LAB_DATAFORM_RECORDNO 8 + +#define FT_DATAFORM_FIXEDTEXT1 9 +#define ED_DATAFORM_EDIT1 10 + +#define STR_NEW_RECORD 11 diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx new file mode 100644 index 000000000000..fea9e132f0ef --- /dev/null +++ b/sc/source/ui/inc/datafdlg.hxx @@ -0,0 +1,102 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Amelia Wang <amwang@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef SC_DATAFDLG_HXX +#define SC_DATAFDLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> + +#include "global.hxx" + +#include <tabvwsh.hxx> +#include <sfx2/bindings.hxx> +#include <sfx2/dispatch.hxx> + +#define MAX_DATAFORM_COLS 256 +#define MAX_DATAFORM_ROWS 32000 +#define CTRL_HEIGHT 22 +#define FIXED_WIDTH 60 +#define EDIT_WIDTH 140 +#define FIXED_LEFT 12 +#define EDIT_LEFT 78 +#define LINE_HEIGHT 30 + +//zhangyun +class ScDataFormDlg : public ModalDialog +{ +private: + + PushButton aBtnNew; + PushButton aBtnDelete; + PushButton aBtnRestore; + PushButton aBtnLast; + PushButton aBtnNext; + PushButton aBtnClose; + ScrollBar aSlider; + FixedText aFixedText; + + ScTabViewShell* pTabViewShell; + ScDocument* pDoc; + sal_uInt16 aColLength; + SCROW aCurrentRow; + SCCOL nStartCol; + SCCOL nEndCol; + SCROW nStartRow; + SCROW nEndRow; + SCTAB nTab; + sal_Bool bNoSelection; + + FixedText** pFixedTexts; + Edit** pEdits; + +public: + ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShell); + ~ScDataFormDlg(); + + void FillCtrls(SCROW nCurrentRow); +private: + + void SetButtonState(); + + // Handler: + DECL_LINK( Impl_NewHdl, PushButton* ); + DECL_LINK( Impl_LastHdl, PushButton* ); + DECL_LINK( Impl_NextHdl, PushButton* ); + + DECL_LINK( Impl_RestoreHdl, PushButton* ); + DECL_LINK( Impl_DeleteHdl, PushButton* ); + DECL_LINK( Impl_CloseHdl, PushButton* ); + + DECL_LINK( Impl_ScrollHdl, ScrollBar* ); + DECL_LINK( Impl_DataModifyHdl, Edit* ); +}; +#endif // SC_DATAFDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dbdocfun.hxx b/sc/source/ui/inc/dbdocfun.hxx new file mode 100644 index 000000000000..11b2ce27ef62 --- /dev/null +++ b/sc/source/ui/inc/dbdocfun.hxx @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DBDOCFUN_HXX +#define SC_DBDOCFUN_HXX + +#include "address.hxx" +#include <tools/solar.h> +#include <com/sun/star/uno/Sequence.hxx> + +class String; + +struct ScImportParam; +struct ScQueryParam; +struct ScSortParam; +struct ScSubTotalParam; + +class SfxViewFrame; +class SbaSelectionList; +class ScDBData; +class ScDocShell; +class ScAddress; +class ScRange; +class ScDPObject; + +namespace com { namespace sun { namespace star { + namespace beans { + struct PropertyValue; + } + namespace sdbc { + class XResultSet; + } +} } } + +// --------------------------------------------------------------------------- +// ----------------------------------------------------------------- +class SbaSelectionList: public List , public SvRefBase +{ +public: + SbaSelectionList(): + List(CONTAINER_MAXBLOCKSIZE,100,100){} +}; + +SV_DECL_IMPL_REF(SbaSelectionList) + + +class ScDBDocFunc +{ +friend class ScDBFunc; + +private: + ScDocShell& rDocShell; + +public: + ScDBDocFunc( ScDocShell& rDocSh ): rDocShell(rDocSh) {} + ~ScDBDocFunc() {} + + void UpdateImport( const String& rTarget, const String& rDBName, + const String& rTableName, const String& rStatement, + sal_Bool bNative, sal_uInt8 nType, + const ::com::sun::star::uno::Reference< + ::com::sun::star::sdbc::XResultSet >& xResultSet, + const SbaSelectionList* pSelection ); + + sal_Bool DoImport( SCTAB nTab, const ScImportParam& rParam, + const ::com::sun::star::uno::Reference< + ::com::sun::star::sdbc::XResultSet >& xResultSet, + const SbaSelectionList* pSelection, sal_Bool bRecord, + sal_Bool bAddrInsert = false ); + + sal_Bool DoImportUno( const ScAddress& rPos, + const com::sun::star::uno::Sequence< + com::sun::star::beans::PropertyValue>& aArgs ); + + static void ShowInBeamer( const ScImportParam& rParam, SfxViewFrame* pFrame ); + + sal_Bool Sort( SCTAB nTab, const ScSortParam& rSortParam, + sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi ); + + SC_DLLPUBLIC sal_Bool Query( SCTAB nTab, const ScQueryParam& rQueryParam, + const ScRange* pAdvSource, sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam, + const ScSortParam* pForceNewSort, + sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool AddDBRange( const String& rName, const ScRange& rRange, sal_Bool bApi ); + sal_Bool DeleteDBRange( const String& rName, sal_Bool bApi ); + sal_Bool RenameDBRange( const String& rOld, const String& rNew, sal_Bool bApi ); + sal_Bool ModifyDBData( const ScDBData& rNewData, sal_Bool bApi ); // Name unveraendert + + sal_Bool RepeatDB( const String& rDBName, sal_Bool bRecord, sal_Bool bApi, bool bIsUnnamed=false, SCTAB aTab = 0); + + sal_Bool DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewObj, + sal_Bool bRecord, sal_Bool bApi, sal_Bool bAllowMove = false ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx new file mode 100644 index 000000000000..6cc65fc00fca --- /dev/null +++ b/sc/source/ui/inc/dbfunc.hxx @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DBFUNC_HXX +#define SC_DBFUNC_HXX + +#include "viewfunc.hxx" + +namespace com { namespace sun { namespace star { namespace sheet { + struct DataPilotFieldFilter; +}}}} + +struct ScSortParam; +struct ScQueryParam; +class ScDBData; +class ScDBCollection; +class ScDPObject; +class ScDPSaveData; +class ScStrCollection; +struct ScDPNumGroupInfo; +struct ScSubTotalParam; + +// --------------------------------------------------------------------------- + +class ScDBFunc : public ScViewFunc +{ +private: + void GetSelectedMemberList( ScStrCollection& rEntries, long& rDimension ); + +public: + ScDBFunc( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ); + virtual ~ScDBFunc(); + + // nur UISort wiederholt bei Bedarf die Teilergebnisse + + void UISort( const ScSortParam& rSortParam, + sal_Bool bRecord = sal_True ); + + void Sort( const ScSortParam& rSortParam, + sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True ); + SC_DLLPUBLIC void Query( const ScQueryParam& rQueryParam, + const ScRange* pAdvSource, sal_Bool bRecord ); + void DoSubTotals( const ScSubTotalParam& rParam, sal_Bool bRecord = sal_True, + const ScSortParam* pForceNewSort = NULL ); + + void ToggleAutoFilter(); + void HideAutoFilter(); + + void RepeatDB( sal_Bool bRecord = sal_True ); + + sal_Bool ImportData( const ScImportParam& rParam, sal_Bool bRecord = sal_True ); + + void GotoDBArea( const String& rDBName ); + + // DB-Bereich vom Cursor + ScDBData* GetDBData( bool bMarkArea = true, ScGetDBMode eMode = SC_DB_MAKE, ScGetDBSelection eSel = SC_DBSEL_KEEP); + ScDBData* GetAnonymousDBData(); + + void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList ); + + void Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True ); + + bool MakePivotTable( const ScDPSaveData& rData, const ScRange& rDest, sal_Bool bNewTable, + const ScDPObject& rSource, sal_Bool bApi = false ); + void DeletePivotTable(); + void RecalcPivotTable(); + sal_Bool HasSelectionForDateGroup( ScDPNumGroupInfo& rOldInfo, sal_Int32& rParts ); + sal_Bool HasSelectionForNumGroup( ScDPNumGroupInfo& rOldInfo ); + void GroupDataPilot(); + void DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nParts ); + void NumGroupDataPilot( const ScDPNumGroupInfo& rInfo ); + void UngroupDataPilot(); + void DataPilotInput( const ScAddress& rPos, const String& rString ); + + bool DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId = NULL ); + sal_Bool DataPilotMove( const ScRange& rSource, const ScAddress& rDest ); + + sal_Bool HasSelectionForDrillDown( sal_uInt16& rOrientation ); + void SetDataPilotDetails( sal_Bool bShow, const String* pNewDimensionName = NULL ); + + void ShowDataPilotSourceData( ScDPObject& rDPObj, + const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::DataPilotFieldFilter >& rFilters ); + + void MakeOutline( sal_Bool bColumns, sal_Bool bRecord = sal_True ); + void RemoveOutline( sal_Bool bColumns, sal_Bool bRecord = sal_True ); + void RemoveAllOutlines( sal_Bool bRecord = sal_True ); + void TestRemoveOutline( sal_Bool& rCol, sal_Bool& rRow ); + + void AutoOutline( sal_Bool bRecord = sal_True ); + + void SelectLevel( sal_Bool bColumns, sal_uInt16 nLevel, + sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True ); + void ShowOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry, + sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True ); + void HideOutline( sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry, + sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True ); + + void ShowMarkedOutlines( sal_Bool bRecord = sal_True ); + void HideMarkedOutlines( sal_Bool bRecord = sal_True ); + sal_Bool OutlinePossible(sal_Bool bHide); + + void UpdateCharts(sal_Bool bAllCharts = false); // Default: am Cursor + + static sal_uInt16 DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, sal_Bool bAllCharts ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dbnamdlg.hrc b/sc/source/ui/inc/dbnamdlg.hrc new file mode 100644 index 000000000000..ab3e51cbf1b2 --- /dev/null +++ b/sc/source/ui/inc/dbnamdlg.hrc @@ -0,0 +1,50 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // -> RID_SCDLG_DBNAMES + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_ADD 3 +#define BTN_REMOVE 4 +#define BTN_HELP 5 +#define FL_NAME 10 +#define ED_NAME 11 +#define FL_ASSIGN 12 +#define ED_DBAREA 13 +#define RB_DBAREA 14 +#define FL_OPTIONS 20 +#define BTN_HEADER 21 +#define BTN_SIZE 22 +#define BTN_FORMAT 23 +#define BTN_STRIPDATA 24 +#define FT_SOURCE 25 +#define FT_OPERATIONS 26 +#define STR_ADD 30 +#define STR_MODIFY 31 +#define STR_DB_INVALID 32 +#define BTN_MORE 33 diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx new file mode 100644 index 000000000000..a2df8f728379 --- /dev/null +++ b/sc/source/ui/inc/dbnamdlg.hxx @@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DBNAMDLG_HXX +#define SC_DBNAMDLG_HXX + +#include <vcl/combobox.hxx> + +#include <vcl/fixed.hxx> + +#include <vcl/morebtn.hxx> +#include "anyrefdg.hxx" +#include "dbcolect.hxx" +#include "expftext.hxx" + +class ScViewData; +class ScDocument; + + +//============================================================================ + +class ScDbNameDlg : public ScAnyRefDlg +{ +public: + ScDbNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScViewData* ptrViewData ); + ~ScDbNameDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + virtual sal_Bool Close(); + +private: + FixedLine aFlName; + ComboBox aEdName; + + FixedLine aFlAssign; + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; + + FixedLine aFlOptions; + CheckBox aBtnHeader; + CheckBox aBtnDoSize; + CheckBox aBtnKeepFmt; + CheckBox aBtnStripData; + ScExpandedFixedText aFTSource; + FixedText aFTOperations; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + PushButton aBtnAdd; + PushButton aBtnRemove; + MoreButton aBtnMore; + + sal_Bool bSaved; + + + const String aStrAdd; // "Hinzufuegen" + const String aStrModify; // "Aendern" + const String aStrNoName; // "unbenannt" + const String aStrInvalid; + + String aStrSource; + String aStrOperations; + + ScViewData* pViewData; + ScDocument* pDoc; + sal_Bool bRefInputMode; + ScAddress::Details aAddrDetails; + + ScDBCollection aLocalDbCol; + ScRange theCurArea; + List aRemoveList; + +#ifdef _DBNAMDLG_CXX +private: + void Init(); + void UpdateNames(); + void UpdateDBData( const String& rStrName ); + void SetInfoStrings( const ScDBData* pDBData ); + + DECL_LINK( CancelBtnHdl, void * ); + DECL_LINK( OkBtnHdl, void * ); + DECL_LINK( AddBtnHdl, void * ); + DECL_LINK( RemoveBtnHdl, void * ); + DECL_LINK( NameModifyHdl, void * ); + DECL_LINK( AssModifyHdl, void * ); +#endif +}; + + + +#endif // SC_DBNAMDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/delcldlg.hxx b/sc/source/ui/inc/delcldlg.hxx new file mode 100644 index 000000000000..59cb84e5f3a7 --- /dev/null +++ b/sc/source/ui/inc/delcldlg.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DELCLDLG_HXX +#define SC_DELCLDLG_HXX + + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> + + +#include "global.hxx" + +//------------------------------------------------------------------------ + +class ScDeleteCellDlg : public ModalDialog +{ +private: + FixedLine aFlFrame; + RadioButton aBtnCellsUp; + RadioButton aBtnCellsLeft; + RadioButton aBtnDelRows; + RadioButton aBtnDelCols; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + +public: + ScDeleteCellDlg( Window* pParent, sal_Bool bDisallowCellMove = false ); + ~ScDeleteCellDlg(); + + DelCellCmd GetDelCellCmd() const; +}; + + +#endif // SC_DELCLDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/delcodlg.hxx b/sc/source/ui/inc/delcodlg.hxx new file mode 100644 index 000000000000..d7a203f75dea --- /dev/null +++ b/sc/source/ui/inc/delcodlg.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DELCODLG_HXX +#define SC_DELCODLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include "global.hxx" + +//------------------------------------------------------------------------ + +class ScDeleteContentsDlg : public ModalDialog +{ +private: + FixedLine aFlFrame; + CheckBox aBtnDelAll; + CheckBox aBtnDelStrings; + CheckBox aBtnDelNumbers; + CheckBox aBtnDelDateTime; + CheckBox aBtnDelFormulas; + CheckBox aBtnDelNotes; + CheckBox aBtnDelAttrs; + CheckBox aBtnDelObjects; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + sal_Bool bObjectsDisabled; + + static sal_Bool bPreviousAllCheck; + static sal_uInt16 nPreviousChecks; + + void DisableChecks( sal_Bool bDelAllChecked = sal_True ); + DECL_LINK( DelAllHdl, void * ); + +public: + ScDeleteContentsDlg( Window* pParent, + sal_uInt16 nCheckDefaults = 0 ); + ~ScDeleteContentsDlg(); + void DisableObjects(); + + sal_uInt16 GetDelContentsCmdBits() const; +}; + + +#endif // SC_DELCODLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx new file mode 100644 index 000000000000..c54e0c1ba4bd --- /dev/null +++ b/sc/source/ui/inc/docfunc.hxx @@ -0,0 +1,212 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DOCFUNC_HXX +#define SC_DOCFUNC_HXX + +#include <tools/link.hxx> +#include "global.hxx" +#include "formula/grammar.hxx" +#include "tabbgcolor.hxx" +#include "token.hxx" +#include "rangenam.hxx" + +#include <vector> +#include <map> + +class ScEditEngineDefaulter; +class SdrUndoAction; +class ScAddress; +class ScDocShell; +class ScMarkData; +class ScPatternAttr; +class ScRange; +class ScRangeList; +class ScBaseCell; +class ScTokenArray; +struct ScTabOpParam; +class ScTableProtection; +struct ScCellMergeOption; + +// --------------------------------------------------------------------------- + +class ScDocFunc +{ +private: + ScDocShell& rDocShell; + + sal_Bool AdjustRowHeight( const ScRange& rRange, sal_Bool bPaint = true ); + void CreateOneName( ScRangeName& rList, + SCCOL nPosX, SCROW nPosY, SCTAB nTab, + SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + sal_Bool& rCancel, sal_Bool bApi ); + void NotifyInputHandler( const ScAddress& rPos ); + +public: + ScDocFunc( ScDocShell& rDocSh ): rDocShell(rDocSh) {} + ~ScDocFunc() {} + + DECL_LINK( NotifyDrawUndo, SdrUndoAction* ); + + sal_Bool DetectiveAddPred(const ScAddress& rPos); + sal_Bool DetectiveDelPred(const ScAddress& rPos); + sal_Bool DetectiveAddSucc(const ScAddress& rPos); + sal_Bool DetectiveDelSucc(const ScAddress& rPos); + sal_Bool DetectiveAddError(const ScAddress& rPos); + sal_Bool DetectiveMarkInvalid(SCTAB nTab); + sal_Bool DetectiveDelAll(SCTAB nTab); + sal_Bool DetectiveRefresh(sal_Bool bAutomatic = false); + void DetectiveCollectAllPreds(const ScRangeList& rSrcRanges, ::std::vector<ScTokenRef>& rRefTokens); + void DetectiveCollectAllSuccs(const ScRangeList& rSrcRanges, ::std::vector<ScTokenRef>& rRefTokens); + + sal_Bool DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags, + sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool TransliterateText( const ScMarkData& rMark, sal_Int32 nType, + sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool SetNormalString( const ScAddress& rPos, const String& rText, sal_Bool bApi ); + sal_Bool PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi ); + sal_Bool PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, + sal_Bool bInterpret, sal_Bool bApi ); + sal_Bool SetCellText( const ScAddress& rPos, const String& rText, + sal_Bool bInterpret, sal_Bool bEnglish, sal_Bool bApi, + const String& rFormulaNmsp, + const formula::FormulaGrammar::Grammar eGrammar ); + + // creates a new cell for use with PutCell + ScBaseCell* InterpretEnglishString( const ScAddress& rPos, const String& rText, + const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar, + short* pRetFormatType = NULL ); + + bool ShowNote( const ScAddress& rPos, bool bShow = true ); + inline bool HideNote( const ScAddress& rPos ) { return ShowNote( rPos, false ); } + + bool SetNoteText( const ScAddress& rPos, const String& rNoteText, sal_Bool bApi ); + bool ReplaceNote( const ScAddress& rPos, const String& rNoteText, const String* pAuthor, const String* pDate, sal_Bool bApi ); + + sal_Bool ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& rPattern, + sal_Bool bRecord, sal_Bool bApi ); + sal_Bool ApplyStyle( const ScMarkData& rMark, const String& rStyleName, + sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool InsertCells( const ScRange& rRange,const ScMarkData* pTabMark, + InsCellCmd eCmd, sal_Bool bRecord, sal_Bool bApi, + sal_Bool bPartOfPaste = false ); + sal_Bool DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, + DelCellCmd eCmd, sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, + sal_Bool bCut, sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi ); + + sal_Bool InsertTable( SCTAB nTab, const String& rName, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool RenameTable( SCTAB nTab, const String& rName, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool DeleteTable( SCTAB nTab, sal_Bool bRecord, sal_Bool bApi ); + + bool SetTabBgColor( SCTAB nTab, const Color& rColor, bool bRecord, bool bApi ); + bool SetTabBgColor( ScUndoTabColorInfo::List& rUndoTabColorList, bool bRecord, bool bApi ); + + sal_Bool SetTableVisible( SCTAB nTab, sal_Bool bVisible, sal_Bool bApi ); + + sal_Bool SetLayoutRTL( SCTAB nTab, sal_Bool bRTL, sal_Bool bApi ); + + SC_DLLPUBLIC sal_Bool SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges, + SCTAB nTab, ScSizeMode eMode, sal_uInt16 nSizeTwips, + sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool InsertPageBreak( sal_Bool bColumn, const ScAddress& rPos, + sal_Bool bRecord, sal_Bool bSetModified, sal_Bool bApi ); + sal_Bool RemovePageBreak( sal_Bool bColumn, const ScAddress& rPos, + sal_Bool bRecord, sal_Bool bSetModified, sal_Bool bApi ); + + void ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect ); + + sal_Bool Protect( SCTAB nTab, const String& rPassword, sal_Bool bApi ); + sal_Bool Unprotect( SCTAB nTab, const String& rPassword, sal_Bool bApi ); + + sal_Bool ClearItems( const ScMarkData& rMark, const sal_uInt16* pWhich, sal_Bool bApi ); + sal_Bool ChangeIndent( const ScMarkData& rMark, sal_Bool bIncrement, sal_Bool bApi ); + sal_Bool AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark, + sal_uInt16 nFormatNo, sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark, + const ScTokenArray* pTokenArray, + const String& rString, sal_Bool bApi, sal_Bool bEnglish, + const String& rFormulaNmsp, + const formula::FormulaGrammar::Grammar ); + + sal_Bool TabOp( const ScRange& rRange, const ScMarkData* pTabMark, + const ScTabOpParam& rParam, sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool FillSimple( const ScRange& rRange, const ScMarkData* pTabMark, + FillDir eDir, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool FillSeries( const ScRange& rRange, const ScMarkData* pTabMark, + FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, + double fStart, double fStep, double fMax, + sal_Bool bRecord, sal_Bool bApi ); + // FillAuto: rRange wird von Source-Range auf Dest-Range angepasst + SC_DLLPUBLIC sal_Bool FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, sal_uLong nCount, double fStep, double fMax, sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool FillAuto( ScRange& rRange, const ScMarkData* pTabMark, + FillDir eDir, sal_uLong nCount, sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, sal_Bool bApi ); + + sal_Bool MergeCells( const ScCellMergeOption& rOption, sal_Bool bContents, + sal_Bool bRecord, sal_Bool bApi ); + sal_Bool UnmergeCells( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi ); + bool UnmergeCells( const ScCellMergeOption& rOption, sal_Bool bRecord, sal_Bool bApi ); + + bool SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc = true ); // takes ownership of pNewRanges + bool ModifyRangeNames( const ScRangeName& rNewRanges ); + + /** + * Modify all range names, global scope names as well as sheet local ones, + * in one go. Note that this method will <b>not</b> destroy the instances + * passed as arguments (it creates copies); the caller is responsible for + * destroying them. + * + * @param pGlobal global scope range names. + * @param rTabs sheet local range names. + */ + void ModifyAllRangeNames( const ScRangeName* pGlobal, const ScRangeName::TabNameCopyMap& rTabs ); + + sal_Bool CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_Bool bApi ); + sal_Bool InsertNameList( const ScAddress& rStartPos, sal_Bool bApi ); + + sal_Bool InsertAreaLink( const String& rFile, const String& rFilter, + const String& rOptions, const String& rSource, + const ScRange& rDestRange, sal_uLong nRefresh, + sal_Bool bFitBlock, sal_Bool bApi ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx new file mode 100644 index 000000000000..e03bb84ac39d --- /dev/null +++ b/sc/source/ui/inc/docsh.hxx @@ -0,0 +1,479 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DOCSHELL_HXX +#define SC_DOCSHELL_HXX + + +#include <sfx2/objsh.hxx> + +#include <sfx2/docfac.hxx> +#include <sfx2/sfxmodelfactory.hxx> +#include <sfx2/viewsh.hxx> + +#include "scdllapi.h" +#include "scdll.hxx" +#include "document.hxx" +#include "shellids.hxx" +#include "refreshtimer.hxx" +#include "optutil.hxx" + +#include <boost/unordered_map.hpp> +#include <cppuhelper/implbase1.hxx> + +#include <sot/sotref.hxx> + +class ScEditEngineDefaulter; +class FontList; +class SfxStyleSheetBasePool; +class SfxStyleSheetHint; +struct ChartSelectionInfo; +class INetURLObject; + +class ScPaintItem; +class ScViewData; +class ScDocFunc; +class ScDrawLayer; +class ScTabViewShell; +class ScSbxDocHelper; +class ScAutoStyleList; +class ScRange; +class ScMarkData; +class ScPaintLockData; +class ScJobSetup; +class ScChangeAction; +class VirtualDevice; +class ScImportOptions; +class ScDocShellModificator; +class ScOptSolverSave; +class ScSheetSaveData; +class ScFlatBoolRowSegments; +struct ScColWidthParam; + +namespace sfx2 { class FileDialogHelper; } +struct DocShell_Impl; + +typedef ::boost::unordered_map< sal_uLong, sal_uLong > ScChangeActionMergeMap; + +//================================================================== + +//enum ScDBFormat { SC_FORMAT_SDF, SC_FORMAT_DBF }; + + // Extra-Flags fuer Repaint +#define SC_PF_LINES 1 +#define SC_PF_TESTMERGE 2 +#define SC_PF_WHOLEROWS 4 + +class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener +{ + static const sal_Char pStarCalcDoc[]; + static const sal_Char pStyleName[]; + + ScDocument aDocument; + + String aDdeTextFmt; + String aConvFilterName; //@ #BugId 54198 + + double nPrtToScreenFactor; +//! FontList* pFontList; + DocShell_Impl* pImpl; + ScDocFunc* pDocFunc; + + //SfxObjectCreateMode eShellMode; + + sal_Bool bIsInplace; // wird von der View gesetzt + sal_Bool bHeaderOn; + sal_Bool bFooterOn; + sal_Bool bNoInformLost; + sal_Bool bIsEmpty; + sal_Bool bIsInUndo; + sal_Bool bDocumentModifiedPending; + sal_uInt16 nDocumentLock; + sal_Int16 nCanUpdate; // stores the UpdateDocMode from loading a document till update links + sal_Bool bUpdateEnabled; + + ScDBData* pOldAutoDBRange; + + ScSbxDocHelper* pDocHelper; + + ScAutoStyleList* pAutoStyleList; + ScPaintLockData* pPaintLockData; + ScJobSetup* pOldJobSetup; + ScOptSolverSave* pSolverSaveData; + ScSheetSaveData* pSheetSaveData; + + ScDocShellModificator* pModificator; // #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading) + + SC_DLLPRIVATE void InitItems(); + SC_DLLPRIVATE void DoEnterHandler(); + SC_DLLPRIVATE void InitOptions(bool bForLoading); + SC_DLLPRIVATE void ResetDrawObjectShell(); + + // SUNWS needs a forward declared friend, otherwise types and members + // of the outer class are not accessible. + class PrepareSaveGuard; + friend class ScDocShell::PrepareSaveGuard; + /** Do things that need to be done before saving to our own format and + necessary clean ups in dtor. */ + class PrepareSaveGuard + { + public: + explicit PrepareSaveGuard( ScDocShell & rDocShell ); + ~PrepareSaveGuard(); + private: + ScDocShell & mrDocShell; + }; + + SC_DLLPRIVATE sal_Bool LoadXML( SfxMedium* pMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& ); + SC_DLLPRIVATE sal_Bool SaveXML( SfxMedium* pMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& ); + SC_DLLPRIVATE SCTAB GetSaveTab(); + + SC_DLLPRIVATE sal_uLong DBaseImport( const String& rFullFileName, CharSet eCharSet, + ScColWidthParam aColWidthParam[MAXCOLCOUNT], ScFlatBoolRowSegments& rRowHeightsRecalc ); + SC_DLLPRIVATE sal_uLong DBaseExport( const String& rFullFileName, CharSet eCharSet, + sal_Bool& bHasMemo ); + + SC_DLLPRIVATE static sal_Bool MoveFile( const INetURLObject& rSource, const INetURLObject& rDest ); + SC_DLLPRIVATE static sal_Bool KillFile( const INetURLObject& rURL ); + SC_DLLPRIVATE static sal_Bool IsDocument( const INetURLObject& rURL ); + + SC_DLLPRIVATE void LockPaint_Impl(sal_Bool bDoc); + SC_DLLPRIVATE void UnlockPaint_Impl(sal_Bool bDoc); + SC_DLLPRIVATE void LockDocument_Impl(sal_uInt16 nNew); + SC_DLLPRIVATE void UnlockDocument_Impl(sal_uInt16 nNew); + + SC_DLLPRIVATE void EnableSharedSettings( bool bEnable ); + SC_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > LoadSharedDocument(); + + SC_DLLPRIVATE void UseSheetSaveEntries(); + +protected: + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + +public: + TYPEINFO(); + + SFX_DECL_INTERFACE(SCID_DOC_SHELL) + SFX_DECL_OBJECTFACTORY(); + + ScDocShell( const ScDocShell& rDocShell ); + ScDocShell( const sal_uInt64 i_nSfxCreationFlags = SFXMODEL_EMBEDDED_OBJECT ); + ~ScDocShell(); + + using SotObject::GetInterface; + using SfxShell::Activate; // with sal_Bool bMDI + using SfxShell::Deactivate; // with sal_Bool bMDI + using SfxObjectShell::Print; // print styles + + virtual void Activate(); + virtual void Deactivate(); + + virtual ::svl::IUndoManager* + GetUndoManager(); + + virtual void FillClass( SvGlobalName * pClassName, + sal_uInt32 * pFormat, + String * pAppName, + String * pFullTypeName, + String * pShortTypeName, + sal_Int32 nFileFormat, + sal_Bool bTemplate = false ) const; + + virtual sal_Bool InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& ); + virtual sal_Bool Load( SfxMedium& rMedium ); + virtual sal_Bool LoadFrom( SfxMedium& rMedium ); + virtual sal_Bool ConvertFrom( SfxMedium &rMedium ); + virtual sal_Bool Save(); + virtual sal_Bool SaveAs( SfxMedium& rMedium ); + virtual sal_Bool ConvertTo( SfxMedium &rMedium ); + virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = false ); + virtual void PrepareReload(); + virtual sal_Bool IsInformationLost(); + virtual void LoadStyles( SfxObjectShell &rSource ); + virtual sal_Bool Insert( SfxObjectShell &rSource, + sal_uInt16 nSourceIdx1, sal_uInt16 nSourceIdx2, sal_uInt16 nSourceIdx3, + sal_uInt16 &nIdx1, sal_uInt16 &nIdx2, sal_uInt16 &nIdx3, sal_uInt16 &rIdxDeleted ); + + virtual sal_Bool SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& ); // SfxInPlaceObject + virtual sal_Bool DoSaveCompleted( SfxMedium * pNewStor); // SfxObjectShell + virtual sal_Bool QuerySlotExecutable( sal_uInt16 nSlotId ); + + virtual void Draw( OutputDevice *, const JobSetup & rSetup, + sal_uInt16 nAspect = ASPECT_CONTENT ); + + virtual void SetVisArea( const Rectangle & rVisArea ); + + using SfxObjectShell::GetVisArea; + virtual Rectangle GetVisArea( sal_uInt16 nAspect ) const; + + virtual Printer* GetDocumentPrinter(); + + virtual void SetModified( sal_Bool = sal_True ); + + void SetVisAreaOrSize( const Rectangle& rVisArea, sal_Bool bModifyStart ); + + virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog( Window *pParent, + const SfxItemSet &rSet ); + + void GetDocStat( ScDocStat& rDocStat ); + + ScDocument* GetDocument() { return &aDocument; } + ScDocFunc& GetDocFunc() { return *pDocFunc; } + + SfxPrinter* GetPrinter( sal_Bool bCreateIfNotExist = sal_True ); + sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL ); + + void UpdateFontList(); + + String CreateObjectName( const String& rPrefix ); + + ScDrawLayer* MakeDrawLayer(); + + void AsciiSave( SvStream& rStream, const ScImportOptions& rOpt ); + + void GetSbxState( SfxItemSet &rSet ); + void GetDrawObjState( SfxItemSet &rSet ); + + void Execute( SfxRequest& rReq ); + void GetState( SfxItemSet &rSet ); + void ExecutePageStyle ( SfxViewShell& rCaller, SfxRequest& rReq, SCTAB nCurTab ); + void GetStatePageStyle( SfxViewShell& rCaller, SfxItemSet& rSet, SCTAB nCurTab ); + + void CompareDocument( ScDocument& rOtherDoc ); + void MergeDocument( ScDocument& rOtherDoc, bool bShared = false, bool bCheckDuplicates = false, sal_uLong nOffset = 0, ScChangeActionMergeMap* pMergeMap = NULL, bool bInverseMap = false ); + bool MergeSharedDocument( ScDocShell* pSharedDocShell ); + + ScChangeAction* GetChangeAction( const ScAddress& rPos ); + void SetChangeComment( ScChangeAction* pAction, const String& rComment ); + void ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pParent,sal_Bool bPrevNext=sal_True ); + /// Protect/unprotect ChangeTrack and return <TRUE/> if + /// protection was successfully changed. + /// If bJustQueryIfProtected==sal_True protection is not + /// changed and <TRUE/> is returned if not protected or + /// password was entered correctly. + sal_Bool ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected = false ); + + void SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages ); + sal_Bool AdjustPrintZoom( const ScRange& rRange ); + + void LoadStylesArgs( ScDocShell& rSource, sal_Bool bReplace, sal_Bool bCellStyles, sal_Bool bPageStyles ); + + void PageStyleModified( const String& rStyleName, sal_Bool bApi ); + + void NotifyStyle( const SfxStyleSheetHint& rHint ); + void DoAutoStyle( const ScRange& rRange, const String& rStyle ); + + Window* GetActiveDialogParent(); + void ErrorMessage( sal_uInt16 nGlobStrId ); + sal_Bool IsEditable() const; + + sal_Bool AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ); + void UpdateAllRowHeights( const ScMarkData* pTabMark = NULL ); + void UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore = false ); + + void RefreshPivotTables( const ScRange& rSource ); + void DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True ); + void UseScenario( SCTAB nTab, const String& rName, sal_Bool bRecord = sal_True ); + SCTAB MakeScenario( SCTAB nTab, const String& rName, const String& rComment, + const Color& rColor, sal_uInt16 nFlags, + ScMarkData& rMark, sal_Bool bRecord = sal_True ); + void ModifyScenario( SCTAB nTab, const String& rName, const String& rComment, + const Color& rColor, sal_uInt16 nFlags ); + sal_uLong TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos, + SCTAB nDestPos, sal_Bool bInsertNew, + sal_Bool bNotifyAndPaint ); + + sal_Bool MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, sal_Bool bRecord ); + + void DoRecalc( sal_Bool bApi ); + void DoHardRecalc( sal_Bool bApi ); + + void UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize = false); + sal_Bool IsOle(); + + void DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ); + ScDBData* GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel ); + ScDBData* GetAnonymousDBData(const ScRange& rRange); + ScDBData* GetOldAutoDBRange(); // has to be deleted by caller! + void CancelAutoDBRange(); // called when dialog is cancelled + + virtual void ReconnectDdeLink(SfxObjectShell& rServer); + void UpdateLinks(); // Link-Eintraege aktuallisieren + sal_Bool ReloadTabLinks(); // Links ausfuehren (Inhalt aktualisieren) + + virtual void CheckConfigOptions(); + + void PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos ); + + void PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, + SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, sal_uInt16 nPart, + sal_uInt16 nExtFlags = 0 ); + void PostPaint( const ScRange& rRange, sal_uInt16 nPart, sal_uInt16 nExtFlags = 0 ); + + void PostPaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab ); + void PostPaintCell( const ScAddress& rPos ); + void PostPaintGridAll(); + void PostPaintExtras(); + + bool IsPaintLocked() const { return pPaintLockData != NULL; } + + void PostDataChanged(); + + void UpdatePaintExt( sal_uInt16& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, + SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab ); + void UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange ); + + void SetDocumentModified( sal_Bool bIsModified = sal_True ); + void SetDrawModified( sal_Bool bIsModified = sal_True ); + + void LockPaint(); + void UnlockPaint(); + sal_uInt16 GetLockCount() const; + void SetLockCount(sal_uInt16 nNew); + + void LockDocument(); + void UnlockDocument(); + + DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* ); + + virtual SfxStyleSheetBasePool* GetStyleSheetPool(); + + void SetInplace( sal_Bool bInplace ); + sal_Bool IsEmpty() const; + void SetEmpty(sal_Bool bSet); + + sal_Bool IsInUndo() const { return bIsInUndo; } + void SetInUndo(sal_Bool bSet); + + void CalcOutputFactor(); + double GetOutputFactor() const; + void GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet, + SCTAB nCurTab, + sal_Bool& rbHeader, + sal_Bool& rbFooter ); + + virtual long DdeGetData( const String& rItem, const String& rMimeType, + ::com::sun::star::uno::Any & rValue ); + virtual long DdeSetData( const String& rItem, const String& rMimeType, + const ::com::sun::star::uno::Any & rValue ); + virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem ); + + const String& GetDdeTextFmt() const { return aDdeTextFmt; } + + SfxBindings* GetViewBindings(); + + ScTabViewShell* GetBestViewShell( sal_Bool bOnlyVisible = sal_True ); + ScSbxDocHelper* GetDocHelperObject() { return pDocHelper; } + + void SetDocumentModifiedPending( sal_Bool bVal ) + { bDocumentModifiedPending = bVal; } + sal_Bool IsDocumentModifiedPending() const + { return bDocumentModifiedPending; } + + sal_Bool IsUpdateEnabled() const + { return bUpdateEnabled; } + void SetUpdateEnabled(sal_Bool bValue) + { bUpdateEnabled = bValue; } + + OutputDevice* GetRefDevice(); // WYSIWYG: Printer, otherwise VirtualDevice... + + static ScViewData* GetViewData(); + static SCTAB GetCurTab(); + + static ScDocShell* GetShellByNum( sal_uInt16 nDocNo ); + static String GetOwnFilterName(); + static String GetHtmlFilterName(); + static String GetWebQueryFilterName(); + static String GetAsciiFilterName(); + static String GetLotusFilterName(); + static String GetDBaseFilterName(); + static String GetDifFilterName(); + static sal_Bool HasAutomaticTableName( const String& rFilter ); + + DECL_LINK( RefreshDBDataHdl, ScRefreshTimer* ); + + void BeforeXMLLoading(); + void AfterXMLLoading(sal_Bool bRet); + + virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates ); + + const ScOptSolverSave* GetSolverSaveData() const { return pSolverSaveData; } // may be null + void SetSolverSaveData( const ScOptSolverSave& rData ); + sal_Bool AcceptStateUpdate() const; + ScSheetSaveData* GetSheetSaveData(); + + void ResetKeyBindings( ScOptionsUtil::KeyBindingType eType ); + + // passwword protection for Calc (derived from SfxObjectShell) + // see also: FID_CHG_RECORD, SID_CHG_PROTECT + virtual bool IsChangeRecording() const; + virtual bool HasChangeRecordProtection() const; + virtual void SetChangeRecording( bool bActivate ); + virtual bool SetProtectionPassword( const String &rPassword ); + virtual bool GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash ); +}; + + +void UpdateAcceptChangesDialog(); + + +SO2_DECL_REF(ScDocShell) +SO2_IMPL_REF(ScDocShell) + + +// Vor Modifizierungen des Dokuments anlegen und danach zerstoeren. +// Merkt sich im Ctor AutoCalcShellDisabled und IdleDisabled, schaltet sie ab +// und stellt sie im Dtor wieder her, AutoCalcShellDisabled ggbf. auch vor +// einem ScDocShell SetDocumentModified. +// SetDocumentModified hierdran aufrufen statt an der ScDocShell. +// Im Dtor wird wenn ScDocShell bDocumentModifiedPending gesetzt ist und +// bAutoCalcShellDisabled nicht gesetzt ist ein SetDocumentModified gerufen. +class SC_DLLPUBLIC ScDocShellModificator +{ + ScDocShell& rDocShell; + ScRefreshTimerProtector aProtector; + sal_Bool bAutoCalcShellDisabled; + sal_Bool bIdleDisabled; + + // not implemented + ScDocShellModificator( const ScDocShellModificator& ); + ScDocShellModificator& operator=( const ScDocShellModificator& ); + +public: + ScDocShellModificator( ScDocShell& ); + ~ScDocShellModificator(); + void SetDocumentModified(); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dpcontrol.hrc b/sc/source/ui/inc/dpcontrol.hrc new file mode 100644 index 000000000000..687f999970ad --- /dev/null +++ b/sc/source/ui/inc/dpcontrol.hrc @@ -0,0 +1,40 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __DPCONTROL_HRC__ +#define __DPCONTROL_HRC__ + +#include <sc.hrc> + +#define STR_MENU_SORT_ASC 1 +#define STR_MENU_SORT_DESC 2 +#define STR_MENU_SORT_CUSTOM 3 +#define STR_BTN_TOGGLE_ALL 4 +#define STR_BTN_SELECT_CURRENT 5 +#define STR_BTN_UNSELECT_CURRENT 6 + +#endif diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx new file mode 100644 index 000000000000..ec868b9e8ba0 --- /dev/null +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -0,0 +1,366 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DPCONTROL_HXX +#define SC_DPCONTROL_HXX + +#include "rtl/ustring.hxx" +#include "tools/gen.hxx" +#include "tools/fract.hxx" +#include "vcl/popupmenuwindow.hxx" +#include "vcl/button.hxx" +#include "vcl/scrbar.hxx" +#include "vcl/timer.hxx" +#include "svx/checklbx.hxx" + +#include <boost/shared_ptr.hpp> +#include <memory> +#include <boost/unordered_map.hpp> + +namespace com { namespace sun { namespace star { + + namespace accessibility { + class XAccessible; + } + +}}} + +class OutputDevice; +class Point; +class Size; +class StyleSettings; +class Window; +class ScDocument; +class ScAccessibleFilterMenu; + +/** + * This class takes care of physically drawing field button controls inside + * data pilot tables. + */ +class ScDPFieldButton +{ +public: + ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX = NULL, const Fraction* pZoomY = NULL, + ScDocument* pDoc = NULL); + ~ScDPFieldButton(); + + void setText(const ::rtl::OUString& rText); + void setBoundingBox(const Point& rPos, const Size& rSize, bool bLayoutRTL); + void setDrawBaseButton(bool b); + void setDrawPopupButton(bool b); + void setHasHiddenMember(bool b); + void setPopupPressed(bool b); + void setPopupLeft(bool b); + void draw(); + + void getPopupBoundingBox(Point& rPos, Size& rSize) const; + +private: + void drawPopupButton(); + +private: + Point maPos; + Size maSize; + ::rtl::OUString maText; + Fraction maZoomX; + Fraction maZoomY; + ScDocument* mpDoc; + OutputDevice* mpOutDev; + const StyleSettings* mpStyle; + bool mbBaseButton; + bool mbPopupButton; + bool mbHasHiddenMember; + bool mbPopupPressed; + bool mbPopupLeft; +}; + +// ============================================================================ + +class ScMenuFloatingWindow : public PopupMenuFloatingWindow +{ +public: + static size_t MENU_NOT_SELECTED; + /** + * Action to perform when an event takes place. Create a sub-class of + * this to implement the desired action. + */ + class Action + { + public: + virtual void execute() = 0; + }; + + explicit ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, sal_uInt16 nMenuStackLevel = 0); + virtual ~ScMenuFloatingWindow(); + + virtual void MouseMove(const MouseEvent& rMEvt); + virtual void MouseButtonDown(const MouseEvent& rMEvt); + virtual void MouseButtonUp(const MouseEvent& rMEvt); + virtual void KeyInput(const KeyEvent& rKEvt); + virtual void Paint(const Rectangle& rRect); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + void addMenuItem(const ::rtl::OUString& rText, bool bEnabled, Action* pAction); + ScMenuFloatingWindow* addSubMenuItem(const ::rtl::OUString& rText, bool bEnabled); + void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bEnsureSubMenu); + void selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer); + void clearSelectedMenuItem(); + ScMenuFloatingWindow* getSubMenuWindow(size_t nPos) const; + bool isMenuItemSelected(size_t nPos) const; + size_t getSelectedMenuItem() const; + + void setName(const ::rtl::OUString& rName); + const ::rtl::OUString& getName() const; + + void executeMenuItem(size_t nPos); + void getMenuItemPosSize(size_t nPos, Point& rPos, Size& rSize) const; + ScMenuFloatingWindow* getParentMenuWindow() const; + +protected: + + void drawMenuItem(size_t nPos); + void drawAllMenuItems(); + const Font& getLabelFont() const; + + void queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu); + void queueCloseSubMenu(); + void launchSubMenu(bool bSetMenuPos); + void endSubMenu(ScMenuFloatingWindow* pSubMenu); + + void fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const; + + ScDocument* getDoc(); + +protected: + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > mxAccessible; + +private: + struct SubMenuItemData; + void handleMenuTimeout(SubMenuItemData* pTimer); + + void resizeToFitMenuItems(); + void highlightMenuItem(size_t nPos, bool bSelected); + + size_t getEnclosingMenuItem(const Point& rPos) const; + size_t getSubMenuPos(ScMenuFloatingWindow* pSubMenu); + + /** + * Fire a menu highlight event since the accessibility framework needs + * this to track focus on menu items. + */ + void fireMenuHighlightedEvent(); + + /** + * Make sure that the specified submenu is permanently up, the submenu + * close timer is not active, and the correct menu item associated with + * the submenu is highlighted. + */ + void setSubMenuFocused(ScMenuFloatingWindow* pSubMenu); + + /** + * When a menu item of an invisible submenu is selected, we need to make + * sure that all its parent menu(s) are visible, with the right menu item + * highlighted in each of the parents. Calling this method ensures it. + */ + void ensureSubMenuVisible(ScMenuFloatingWindow* pSubMenu); + + /** + * Dismiss any visible child submenus when a menu item of a parent menu is + * selected. + */ + void ensureSubMenuNotVisible(); + + /** + * Dismiss all visible popup menus and set focus back to the application + * window. This method is called e.g. when a menu action is fired. + */ + void terminateAllPopupMenus(); + + DECL_LINK( PopupEndHdl, void* ); + +private: + + struct MenuItemData + { + ::rtl::OUString maText; + bool mbEnabled; + + ::boost::shared_ptr<Action> mpAction; + ::boost::shared_ptr<ScMenuFloatingWindow> mpSubMenuWin; + + MenuItemData(); + }; + + ::std::vector<MenuItemData> maMenuItems; + + struct SubMenuItemData + { + Timer maTimer; + ScMenuFloatingWindow* mpSubMenu; + size_t mnMenuPos; + + DECL_LINK( TimeoutHdl, void* ); + + SubMenuItemData(ScMenuFloatingWindow* pParent); + void reset(); + + private: + ScMenuFloatingWindow* mpParent; + }; + SubMenuItemData maOpenTimer; + SubMenuItemData maCloseTimer; + + Font maLabelFont; + + // Name of this menu window, taken from the menu item of the parent window + // that launches it (if this is a sub menu). If this is a top-level menu + // window, then this name can be anything. + ::rtl::OUString maName; + + size_t mnSelectedMenu; + size_t mnClickedMenu; + + ScDocument* mpDoc; + + ScMenuFloatingWindow* mpParentMenu; + ScMenuFloatingWindow* mpActiveSubMenu; +}; + +// ============================================================================ + +/** + * This class implements a popup window for field button, for quick access + * of hide-item list, and possibly more stuff related to field options. + */ +class ScDPFieldPopupWindow : public ScMenuFloatingWindow +{ +public: + /** + * Extended data that the client code may need to store. Create a + * sub-class of this and store data there. + */ + struct ExtendedData {}; + + explicit ScDPFieldPopupWindow(Window* pParent, ScDocument* pDoc); + virtual ~ScDPFieldPopupWindow(); + + virtual void MouseMove(const MouseEvent& rMEvt); + virtual long Notify(NotifyEvent& rNEvt); + virtual void Paint(const Rectangle& rRect); + virtual Window* GetPreferredKeyInputWindow(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + void setMemberSize(size_t n); + void addMember(const ::rtl::OUString& rName, bool bVisible); + void initMembers(); + + const Size& getWindowSize() const; + + void getResult(::boost::unordered_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rResult); + void close(bool bOK); + + /** + * Set auxiliary data that the client code might need. Note that this + * popup window class manages its life time; no explicit deletion of the + * instance is needed in the client code. + */ + void setExtendedData(ExtendedData* p); + + /** + * Get the store auxiliary data, or NULL if no such data is stored. + */ + ExtendedData* getExtendedData(); + + void setOKAction(Action* p); + +private: + struct Member + { + ::rtl::OUString maName; + bool mbVisible; + + Member(); + }; + + class CancelButton : public ::CancelButton + { + public: + CancelButton(ScDPFieldPopupWindow* pParent); + + virtual void Click(); + + private: + ScDPFieldPopupWindow* mpParent; + }; + + enum SectionType { + WHOLE, // entire window + LISTBOX_AREA_OUTER, // box enclosing the check box items. + LISTBOX_AREA_INNER, // box enclosing the check box items. + SINGLE_BTN_AREA, // box enclosing the single-action buttons. + CHECK_TOGGLE_ALL, // check box for toggling all items. + BTN_SINGLE_SELECT, + BTN_SINGLE_UNSELECT, + BTN_OK, // OK button + BTN_CANCEL, // Cancel button + }; + void getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const; + + void setAllMemberState(bool bSet); + void selectCurrentMemberOnly(bool bSet); + void cycleFocus(bool bReverse = false); + + DECL_LINK( ButtonHdl, Button* ); + DECL_LINK( TriStateHdl, TriStateBox* ); + DECL_LINK( CheckHdl, SvTreeListBox* ); + +private: + SvxCheckListBox maChecks; + + TriStateBox maChkToggleAll; + ImageButton maBtnSelectSingle; + ImageButton maBtnUnselectSingle; + + OKButton maBtnOk; + CancelButton maBtnCancel; + + ::std::vector<Window*> maTabStopCtrls; + size_t mnCurTabStop; + + ::std::vector<Member> maMembers; + ::std::auto_ptr<ExtendedData> mpExtendedData; + ::std::auto_ptr<Action> mpOKAction; + + const Size maWndSize; /// hard-coded window size. + TriState mePrevToggleAllState; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dpgroupdlg.hxx b/sc/source/ui/inc/dpgroupdlg.hxx new file mode 100644 index 000000000000..7a1770ab6844 --- /dev/null +++ b/sc/source/ui/inc/dpgroupdlg.hxx @@ -0,0 +1,168 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DPGROUPDLG_HXX +#define SC_DPGROUPDLG_HXX + +#include <vcl/fixed.hxx> +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/field.hxx> +#include <svx/checklbx.hxx> +#include "editfield.hxx" +#include "dpgroup.hxx" + +// ============================================================================ + +class ScDPGroupEditHelper +{ +public: + explicit ScDPGroupEditHelper( + RadioButton& rRbAuto, RadioButton& rRbMan, + Edit& rEdValue ); + + bool IsAuto() const; + double GetValue() const; + void SetValue( bool bAuto, double fValue ); + +private: + virtual bool ImplGetValue( double& rfValue ) const = 0; + virtual void ImplSetValue( double fValue ) = 0; + + DECL_LINK( ClickHdl, RadioButton* ); + +private: + RadioButton& mrRbAuto; + RadioButton& mrRbMan; + Edit& mrEdValue; +}; + +// ---------------------------------------------------------------------------- + +class ScDPNumGroupEditHelper : public ScDPGroupEditHelper +{ +public: + explicit ScDPNumGroupEditHelper( + RadioButton& rRbAuto, RadioButton& rRbMan, + ScDoubleField& rEdValue ); + +private: + virtual bool ImplGetValue( double& rfValue ) const; + virtual void ImplSetValue( double fValue ); + +private: + ScDoubleField& mrEdValue; +}; + +// ---------------------------------------------------------------------------- + +class ScDPDateGroupEditHelper : public ScDPGroupEditHelper +{ +public: + explicit ScDPDateGroupEditHelper( + RadioButton& rRbAuto, RadioButton& rRbMan, + DateField& rEdValue, const Date& rNullDate ); + +private: + virtual bool ImplGetValue( double& rfValue ) const; + virtual void ImplSetValue( double fValue ); + +private: + DateField& mrEdValue; + Date maNullDate; +}; + +// ============================================================================ +// ============================================================================ + +class ScDPNumGroupDlg : public ModalDialog +{ +public: + explicit ScDPNumGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo ); + + ScDPNumGroupInfo GetGroupInfo() const; + +private: + FixedLine maFlStart; + RadioButton maRbAutoStart; + RadioButton maRbManStart; + ScDoubleField maEdStart; + FixedLine maFlEnd; + RadioButton maRbAutoEnd; + RadioButton maRbManEnd; + ScDoubleField maEdEnd; + FixedLine maFlBy; + ScDoubleField maEdBy; + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + ScDPNumGroupEditHelper maStartHelper; + ScDPNumGroupEditHelper maEndHelper; +}; + +// ============================================================================ + +class ScDPDateGroupDlg : public ModalDialog +{ +public: + explicit ScDPDateGroupDlg( Window* pParent, const ScDPNumGroupInfo& rInfo, + sal_Int32 nDatePart, const Date& rNullDate ); + + ScDPNumGroupInfo GetGroupInfo() const; + sal_Int32 GetDatePart() const; + +private: + DECL_LINK( ClickHdl, RadioButton* ); + DECL_LINK( CheckHdl, SvxCheckListBox* ); + +private: + FixedLine maFlStart; + RadioButton maRbAutoStart; + RadioButton maRbManStart; + DateField maEdStart; + FixedLine maFlEnd; + RadioButton maRbAutoEnd; + RadioButton maRbManEnd; + DateField maEdEnd; + FixedLine maFlBy; + RadioButton maRbNumDays; + RadioButton maRbUnits; + NumericField maEdNumDays; + SvxCheckListBox maLbUnits; + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + ScDPDateGroupEditHelper maStartHelper; + ScDPDateGroupEditHelper maEndHelper; +}; + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx new file mode 100644 index 000000000000..17296dcbce10 --- /dev/null +++ b/sc/source/ui/inc/drawsh.hxx @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DRAWSH_HXX +#define SC_DRAWSH_HXX + +#include <sfx2/shell.hxx> +#include "shellids.hxx" +#include <sfx2/module.hxx> +#include <svx/svdmark.hxx> +#include <tools/link.hxx> + +class AbstractSvxNameDialog; +class ScViewData; +class ScDrawView; + +class ScDrawShell : public SfxShell +{ + ScViewData* pViewData; + + DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* ); + + void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk ); + +protected: + ScViewData* GetViewData() { return pViewData; } + +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_DRAW_SHELL) + + ScDrawShell(ScViewData* pData); + ~ScDrawShell(); + + void StateDisableItems( SfxItemSet &rSet ); + + void ExecDrawAttr(SfxRequest& rReq); + void GetDrawAttrState(SfxItemSet &rSet); + void GetAttrFuncState(SfxItemSet &rSet); + + void ExecDrawFunc(SfxRequest& rReq); + void GetDrawFuncState(SfxItemSet &rSet); + void GetState(SfxItemSet &rSet); + + void ExecFormText(SfxRequest& rReq); // StarFontWork + void GetFormTextState(SfxItemSet& rSet); + + void ExecuteHLink(SfxRequest& rReq); // Hyperlink + void GetHLinkState(SfxItemSet& rSet); + + void ExecFormatPaintbrush(SfxRequest& rReq); + void StateFormatPaintbrush(SfxItemSet& rSet); + + void ExecuteMacroAssign( SdrObject* pObj, Window* pWin ); + void ExecuteLineDlg( SfxRequest& rReq, sal_uInt16 nTabPage = 0xffff ); + void ExecuteAreaDlg( SfxRequest& rReq, sal_uInt16 nTabPage = 0xffff ); + void ExecuteTextAttrDlg( SfxRequest& rReq, sal_uInt16 nTabPage = 0xffff ); + + ScDrawView* GetDrawView(); + + sal_Bool AreAllObjectsOnLayer(sal_uInt16 nLayerNo,const SdrMarkList& rMark); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/drawutil.hxx b/sc/source/ui/inc/drawutil.hxx new file mode 100644 index 000000000000..d6bd314e4ef7 --- /dev/null +++ b/sc/source/ui/inc/drawutil.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DRAWUTIL_HXX +#define SC_DRAWUTIL_HXX + +#include "address.hxx" +#include <tools/solar.h> + +class Fraction; +class OutputDevice; +class ScDocument; + +class ScDrawUtil +{ +public: + static void CalcScale( ScDocument* pDoc, SCTAB nTab, + SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, + OutputDevice* pDev, const Fraction& rZoomX, const Fraction& rZoomY, + double nPPTX, double nPPTY, + Fraction& rScaleX, Fraction& rScaleY ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx new file mode 100644 index 000000000000..ca3eb42e208a --- /dev/null +++ b/sc/source/ui/inc/drawview.hxx @@ -0,0 +1,147 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DRAWVIEW_HXX +#define SC_DRAWVIEW_HXX + +#include <svx/fmview.hxx> + +#include "global.hxx" + +namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } } + +class ScDocument; +class ScViewData; +class ScDrawObjData; + +class ScDrawView: public FmFormView +{ + ScViewData* pViewData; + OutputDevice* pDev; //! needed ? + ScDocument* pDoc; + SCTAB nTab; + Fraction aScaleX; // Factor for Drawing-MapMode + Fraction aScaleY; + SdrDropMarkerOverlay* pDropMarker; + SdrObject* pDropMarkObj; + sal_Bool bInConstruct; + + void Construct(); + void UpdateBrowser(); + +protected: + virtual void ModelHasChanged(); + + // add custom handles (used by other apps, e.g. AnchorPos) + virtual void AddCustomHdl(); + + void ImplClearCalcDropMarker(); + +public: + ScDrawView( OutputDevice* pOut, ScViewData* pData ); + virtual ~ScDrawView(); + + virtual void MarkListHasChanged(); + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual void DoConnect(SdrOle2Obj* pOleObj); + + virtual void MakeVisible( const Rectangle& rRect, Window& rWin ); + + virtual void DeleteMarked(); + + void MarkDropObj( SdrObject* pObj ); + + void SetMarkedToLayer( sal_uInt8 nLayerNo ); + + void InvalidateAttribs(); + void InvalidateDrawTextAttrs(); + + sal_Bool BeginDrag( Window* pWindow, const Point& rStartPos ); + void DoCut(); + void DoCopy(); + + void GetScale( Fraction& rFractX, Fraction& rFractY ) const; + void RecalcScale(); + void UpdateWorkArea(); + SCTAB GetTab() const { return nTab; } + + void CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const; + + void SetPageAnchored(); + void SetCellAnchored(); + ScAnchorType GetAnchorType() const; + + void VCAddWin( Window* pWin ); + void VCRemoveWin( Window* pWin ); + + void UpdateIMap( SdrObject* pObj ); + + sal_uInt16 GetPopupMenuId(); + void UpdateUserViewOptions(); + + void SetMarkedOriginalSize(); + + sal_Bool SelectObject( const String& rName ); + bool HasMarkedControl() const; + bool HasMarkedInternal() const; + + bool InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV, sal_uLong nOptions=0); + + /** Returns the selected object, if it is the caption object of a cell note. + @param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */ + SdrObject* GetMarkedNoteCaption( ScDrawObjData** ppCaptData = 0 ); + + /** Locks/unlocks the specified layer in the draw page. + Unlocked layer is required to be able to edit the contained objects. */ + void LockCalcLayer( SdrLayerID nLayer, bool bLock = true ); + /** Unlocks the specified layer in the draw page. */ + inline void UnlockCalcLayer( SdrLayerID nLayer ) { LockCalcLayer( nLayer, false ); } + + /** Locks/unlocks the background layer that contains background objects. + Unlocked layer is required to be able to edit the objects. */ + inline void LockBackgroundLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_BACK, bLock ); } + /** Unlocks the background layer that contains background objects. */ + inline void UnlockBackgroundLayer() { LockBackgroundLayer( false ); } + + /** Locks/unlocks the internal layer that contains caption objects of cell notes. + Unlocked layer is required to be able to edit the contained objects. */ + inline void LockInternalLayer( bool bLock = true ) { LockCalcLayer( SC_LAYER_INTERN, bLock ); } + /** Unlocks the internal layer that contains caption objects of cell notes. */ + inline void UnlockInternalLayer() { LockInternalLayer( false ); } + + SdrEndTextEditKind ScEndTextEdit(); // calls SetDrawTextUndo(0) + ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable(); +}; + + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/drformsh.hxx b/sc/source/ui/inc/drformsh.hxx new file mode 100644 index 000000000000..ec32afef4d62 --- /dev/null +++ b/sc/source/ui/inc/drformsh.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef DRFORMSH_HXX +#define DRFORMSH_HXX + +#include <sfx2/shell.hxx> +#include "shellids.hxx" +#include <sfx2/module.hxx> +#include <svx/svdmark.hxx> + +class ScViewData; + + +#include "drawsh.hxx" + +class ScDrawFormShell: public ScDrawShell +{ +public: + + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_FORM_SHELL) + + ScDrawFormShell(ScViewData* pData); + virtual ~ScDrawFormShell(); + +// void Execute(SfxRequest &); +// void GetState(SfxItemSet &); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/drtxtob.hxx b/sc/source/ui/inc/drtxtob.hxx new file mode 100644 index 000000000000..ae6be419b942 --- /dev/null +++ b/sc/source/ui/inc/drtxtob.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DRTXTOB_HXX +#define SC_DRTXTOB_HXX + +#include <sfx2/shell.hxx> +#include <sfx2/module.hxx> +#include <tools/link.hxx> + +#include "shellids.hxx" + +sal_uInt16 ScGetFontWorkId(); // statt SvxFontWorkChildWindow::GetChildWindowId() + +class ScViewData; +class TransferableDataHelper; +class TransferableClipboardListener; + +class ScDrawTextObjectBar : public SfxShell +{ + ScViewData* pViewData; + TransferableClipboardListener* pClipEvtLstnr; + sal_Bool bPastePossible; + + DECL_LINK( ClipboardChanged, TransferableDataHelper* ); + +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_DRAW_TEXT_SHELL) + + ScDrawTextObjectBar(ScViewData* pData); + ~ScDrawTextObjectBar(); + + void StateDisableItems( SfxItemSet &rSet ); + + void Execute( SfxRequest &rReq ); + void ExecuteTrans( SfxRequest& rReq ); + void GetState( SfxItemSet& rSet ); + void GetClipState( SfxItemSet& rSet ); + + void ExecuteAttr( SfxRequest &rReq ); + void GetAttrState( SfxItemSet& rSet ); + void ExecuteToggle( SfxRequest &rReq ); + + sal_Bool ExecuteCharDlg( const SfxItemSet& rArgs, SfxItemSet& rOutSet ); + sal_Bool ExecuteParaDlg( const SfxItemSet& rArgs, SfxItemSet& rOutSet ); + + void ExecuteExtra( SfxRequest &rReq ); + void ExecFormText(SfxRequest& rReq); // StarFontWork + void GetFormTextState(SfxItemSet& rSet); + +private: + void ExecuteGlobal( SfxRequest &rReq ); // von Execute gerufen fuer ganze Objekte + void GetGlobalClipState( SfxItemSet& rSet ); + void ExecutePasteContents( SfxRequest &rReq ); + sal_Bool IsNoteEdit(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx new file mode 100644 index 000000000000..c1194f9bd5cc --- /dev/null +++ b/sc/source/ui/inc/drwtrans.hxx @@ -0,0 +1,115 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DRWTRANS_HXX +#define SC_DRWTRANS_HXX + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/embed/XEmbeddedObject.hpp> +#include <svtools/transfer.hxx> + +#include <sfx2/objsh.hxx> +#include "global.hxx" +#include "charthelper.hxx" +#include "rangelst.hxx" + + +class SdrModel; +class ScDocShell; +class INetBookmark; +class SdrObject; +class SdrView; +class ScDrawView; +class SdrOle2Obj; + +class ScDrawTransferObj : public TransferableHelper +{ +private: + SdrModel* pModel; + TransferableDataHelper aOleData; + TransferableObjectDescriptor aObjDesc; + SfxObjectShellRef aDocShellRef; + SfxObjectShellRef aDrawPersistRef; + + // extracted from model in ctor: + Size aSrcSize; + INetBookmark* pBookmark; + sal_Bool bGraphic; + sal_Bool bGrIsBit; + sal_Bool bOleObj; + // source information for drag&drop: + // (view is needed to handle drawing obejcts) + SdrView* pDragSourceView; + sal_uInt16 nDragSourceFlags; + sal_Bool bDragWasInternal; + + sal_uInt32 nSourceDocID; + + ScRangeListVector m_aProtectedChartRangesVector; + + + void InitDocShell(); + SdrOle2Obj* GetSingleObject(); + +public: + ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContainerShell, + const TransferableObjectDescriptor& rDesc ); + virtual ~ScDrawTransferObj(); + + virtual void AddSupportedFormats(); + virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, + const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + virtual void ObjectReleased(); + virtual void DragFinished( sal_Int8 nDropAction ); + + SdrModel* GetModel() { return pModel; } + + void SetDrawPersist( const SfxObjectShellRef& rRef ); + void SetDragSource( ScDrawView* pView ); + void SetDragSourceObj( SdrObject* pObj, SCTAB nTab ); + void SetDragSourceFlags( sal_uInt16 nFlags ); + void SetDragWasInternal(); + + SdrView* GetDragSourceView() { return pDragSourceView; } + sal_uInt16 GetDragSourceFlags() const { return nDragSourceFlags; } + + void SetSourceDocID( sal_uInt32 nVal ) + { nSourceDocID = nVal; } + sal_uInt32 GetSourceDocID() const { return nSourceDocID; } + + static ScDrawTransferObj* GetOwnClipboard( Window* pUIWin ); + virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException ); + static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + const ScRangeListVector& GetProtectedChartRangesVector() const { return m_aProtectedChartRangesVector; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx new file mode 100644 index 000000000000..480246708cba --- /dev/null +++ b/sc/source/ui/inc/dwfunctr.hxx @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SC_DWFUNCTR_HXX +#define _SC_DWFUNCTR_HXX + +#include <sfx2/childwin.hxx> +#include <sfx2/dockwin.hxx> +#include <svl/lstner.hxx> +#include <svtools/stdctrl.hxx> + +#include <vcl/lstbox.hxx> +#include <vcl/button.hxx> +#include <vcl/combobox.hxx> +#include "anyrefdg.hxx" +#include "global.hxx" // ScAddress +#include "privsplt.hxx" +#include "funcdesc.hxx" + +/************************************************************************* +|* +|* Ableitung vom SfxChildWindow als "Behaelter" fuer Controller +|* +\************************************************************************/ + +class ScFunctionChildWindow : public SfxChildWindow +{ + public: + ScFunctionChildWindow( Window*, sal_uInt16, SfxBindings*, + SfxChildWinInfo* ); + + SFX_DECL_CHILDWINDOW(ScFunctionChildWindow); +}; + +/************************************************************************* +|* +|* ScFuncDockWin +|* +\************************************************************************/ + +class ScFunctionDockWin : public SfxDockingWindow, public SfxListener +{ + +private: + Timer aTimer; + ScPrivatSplit aPrivatSplit; + ListBox aCatBox; + ListBox aFuncList; + ListBox aDDFuncList; + ListBox* pAllFuncList; + + SfxChildAlignment eSfxNewAlignment; + SfxChildAlignment eSfxOldAlignment; + ImageButton aInsertButton; + FixedText aFiFuncDesc; + sal_uInt16 nLeftSlot; + sal_uInt16 nRightSlot; + sal_uLong nMinWidth; + sal_uLong nMinHeight; + Size aOldSize; + sal_Bool bSizeFlag; + sal_Bool bInit; + short nDockMode; + Point aSplitterInitPos; + const ScFuncDesc* pFuncDesc; + sal_uInt16 nArgs; + String** pArgArr; + + + ::std::vector< const formula::IFunctionDescription*> aLRUList; + + void UpdateFunctionList(); + void UpdateLRUList(); + void DoEnter(sal_Bool bOk); //@@ ??? + void SetDescription(); + void SetLeftRightSize(); + void SetTopBottonSize(); + void SetMyWidthLeRi(Size &aNewSize); + void SetMyHeightLeRi(Size &aNewSize); + void SetMyWidthToBo(Size &aNewSize); + void SetMyHeightToBo(Size &aNewSize); + void UseSplitterInitPos(); + + DECL_LINK( SetSelectionHdl, void* ); + DECL_LINK( SelHdl, ListBox* ); + DECL_LINK(SetSplitHdl,ScPrivatSplit*); + DECL_LINK( TimerHdl, Timer*); + +protected: + + virtual sal_Bool Close(); + virtual void Resize(); + virtual void Resizing( Size& rSize ); + virtual void SetSize(); + virtual void ToggleFloatingMode(); + virtual void StateChanged( StateChangedType nStateChange ); + + + virtual SfxChildAlignment CheckAlignment(SfxChildAlignment, + SfxChildAlignment eAlign); + +public: + ScFunctionDockWin( SfxBindings* pBindings, + SfxChildWindow *pCW, + Window* pParent, + const ResId& rResId ); + + ~ScFunctionDockWin(); + + using SfxDockingWindow::Notify; + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + void SetSlotIDs( sal_uInt16 nLeft, sal_uInt16 nRight ) + { nLeftSlot = nLeft; nRightSlot = nRight; } + + void InitLRUList(); + + void Initialize (SfxChildWinInfo* pInfo); + virtual void FillInfo(SfxChildWinInfo&) const; +}; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/editable.hxx b/sc/source/ui/inc/editable.hxx new file mode 100644 index 000000000000..7e0e0472da65 --- /dev/null +++ b/sc/source/ui/inc/editable.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_EDITABLE_HXX +#define SC_EDITABLE_HXX + +#include "address.hxx" +#include <tools/solar.h> + +class ScDocument; +class ScViewFunc; +class ScMarkData; +class ScRange; + + +class ScEditableTester +{ + sal_Bool bIsEditable; + sal_Bool bOnlyMatrix; + +public: + // no test in ctor + ScEditableTester(); + + // calls TestBlock + ScEditableTester( ScDocument* pDoc, SCTAB nTab, + SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ); + + // calls TestSelectedBlock + ScEditableTester( ScDocument* pDoc, + SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, + const ScMarkData& rMark ); + + // calls TestRange + ScEditableTester( ScDocument* pDoc, const ScRange& rRange ); + + // calls TestSelection + ScEditableTester( ScDocument* pDoc, const ScMarkData& rMark ); + + // calls TestView + ScEditableTester( ScViewFunc* pView ); + + ~ScEditableTester() {} + + // Several calls to the Test... methods check if *all* of the ranges + // are editable. For several independent checks, Reset() has to be used. + void TestBlock( ScDocument* pDoc, SCTAB nTab, + SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ); + void TestSelectedBlock( ScDocument* pDoc, + SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, + const ScMarkData& rMark ); + void TestRange( ScDocument* pDoc, const ScRange& rRange ); + void TestSelection( ScDocument* pDoc, const ScMarkData& rMark ); + void TestView( ScViewFunc* pView ); + + sal_Bool IsEditable() const { return bIsEditable; } + sal_Bool IsFormatEditable() const { return bIsEditable || bOnlyMatrix; } + sal_uInt16 GetMessageId() const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/editfield.hxx b/sc/source/ui/inc/editfield.hxx new file mode 100644 index 000000000000..bfae24f4fd9f --- /dev/null +++ b/sc/source/ui/inc/editfield.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_EDITFIELD_HXX +#define SC_EDITFIELD_HXX + +#include <vcl/field.hxx> + +// ============================================================================ + +/** An edit control that contains a double precision floating-point value. */ +class ScDoubleField : public Edit +{ +public: + explicit ScDoubleField( Window* pParent, const ResId& rResId ); + + bool GetValue( double& rfValue ) const; + void SetValue( double fValue, + sal_Int32 nDecPlaces = 12, + bool bEraseTrailingDecZeros = true ); +}; + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/editsh.hxx b/sc/source/ui/inc/editsh.hxx new file mode 100644 index 000000000000..bd6b75ae2ede --- /dev/null +++ b/sc/source/ui/inc/editsh.hxx @@ -0,0 +1,88 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_EDITSH_HXX +#define SC_EDITSH_HXX + +#include <sfx2/shell.hxx> +#include <sfx2/module.hxx> +#include <tools/link.hxx> + +#include "shellids.hxx" +#include <editeng/editview.hxx> + +class EditView; +class ScViewData; +class ScInputHandler; +class SvxURLField; +class TransferableDataHelper; +class TransferableClipboardListener; + +class ScEditShell : public SfxShell +{ +private: + EditView* pEditView; + ScViewData* pViewData; + TransferableClipboardListener* pClipEvtLstnr; + sal_Bool bPastePossible; + sal_Bool bIsInsertMode; + + const SvxURLField* GetURLField(); + ScInputHandler* GetMyInputHdl(); + + DECL_LINK( ClipboardChanged, TransferableDataHelper* ); + +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_EDIT_SHELL) + + ScEditShell(EditView* pView, ScViewData* pData); + ~ScEditShell(); + + void SetEditView(EditView* pView); + EditView* GetEditView() {return pEditView;} + + void Execute(SfxRequest& rReq); + void ExecuteTrans(SfxRequest& rReq); + void GetState(SfxItemSet &rSet); + void GetClipState(SfxItemSet& rSet); + + void ExecuteAttr(SfxRequest& rReq); + void GetAttrState(SfxItemSet &rSet); + + void ExecuteUndo(SfxRequest& rReq); + void GetUndoState(SfxItemSet &rSet); + + String GetSelectionText( sal_Bool bWholeWord ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/expftext.hxx b/sc/source/ui/inc/expftext.hxx new file mode 100644 index 000000000000..e0d7717037fe --- /dev/null +++ b/sc/source/ui/inc/expftext.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SC_EXPFTEXT_HXX +#define _SC_EXPFTEXT_HXX + +#include <vcl/fixed.hxx> +#include "scdllapi.h" + +class SC_DLLPUBLIC ScExpandedFixedText: public FixedText +{ + protected: + + void RequestHelp( const HelpEvent& rHEvt ); + + public: + ScExpandedFixedText( Window* pWindow, const ResId& rResId); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx new file mode 100644 index 000000000000..edd8aec6a568 --- /dev/null +++ b/sc/source/ui/inc/fieldwnd.hxx @@ -0,0 +1,394 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FIELDWND_HXX +#define SC_FIELDWND_HXX + +#include <vector> +#include "address.hxx" +#include "dpglobal.hxx" +#include <vcl/ctrl.hxx> +#include <vcl/fixed.hxx> +#include <vcl/scrbar.hxx> +#include <cppuhelper/weakref.hxx> + +class ScDPLayoutDlg; +class ScAccessibleDataPilotControl; + +//=================================================================== + +/** Type of content area. */ +enum ScDPFieldType +{ + TYPE_PAGE, /// Area for all page fields. + TYPE_ROW, /// Area for all row fields. + TYPE_COL, /// Area for all column fields. + TYPE_DATA, /// Area for all data fields. + TYPE_SELECT /// Selection area with all fields. +}; + +//------------------------------------------------------------------- + +/** + * Represents a field area in the DataPilot layout dialog. This base class + * handles storage of field names and the accessibility object. + */ +class ScDPFieldControlBase : public Control +{ +protected: + typedef ::std::pair<String, bool> FieldName; // true = text fits into button + typedef ::std::vector<FieldName> FieldNames; + +public: + + /** + * Custom scroll bar to pass the command event to its parent window. + * We need this to pass the mouse wheel events to its parent field + * control to have mouse wheel events appaer to be properly handled by the + * scroll bar. + */ + class ScrollBar : public ::ScrollBar + { + public: + ScrollBar(Window* pParent, WinBits nStyle); + virtual void Command( const CommandEvent& rCEvt ); + private: + Window* mpParent; + }; + + ScDPFieldControlBase( + ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ); + virtual ~ScDPFieldControlBase(); + + virtual void CalcSize() = 0; + + virtual bool IsValidIndex( size_t nIndex ) const = 0; + /** @return The pixel position of a field (without bound check). */ + virtual Point GetFieldPosition( size_t nIndex ) = 0; + /** Calculates the field index at a specific pixel position. + @param rnIndex The index of the field is returned here. + @return TRUE, if the index value is valid. */ + virtual bool GetFieldIndex( const Point& rPos, size_t& rnIndex ) = 0; + /** @return The pixel size of a field. */ + virtual Size GetFieldSize() const = 0; + + /** @return The description of the control which is used for the accessibility objects. */ + virtual String GetDescription() const = 0; + /** @return The type of the FieldWindow. */ + virtual ScDPFieldType GetFieldType() const = 0; + virtual void ScrollToShowSelection() = 0; + virtual void ScrollToEnd() = 0; + virtual void ResetScrollBar() = 0; + virtual void HandleWheelScroll(long nNotch) = 0; + + /** Reads the FixedText's text with mnemonic and hides the FixedText. */ + void UseMnemonic(); + + /** @return The name of the control without shortcut. */ + ::rtl::OUString GetName() const; + void SetName(const ::rtl::OUString& rName); + + /** @return TRUE, if the field with the given index exists. */ + bool IsExistingIndex( size_t nIndex ) const; + + /** Inserts a field to the specified index. */ + void AddField( const String& rText, size_t nNewIndex ); + + /** Inserts a field using the specified pixel position. + @param rPos The coordinates to insert the field. + @param rnIndex The new index of the field is returned here. + @return true, if the field has been created. */ + bool AddField( const String& rText, const Point& rPos, size_t& rnIndex ); + + bool AppendField(const String& rText, size_t& rnIndex); + + /** Removes a field from the specified index. */ + void DelField( size_t nDelIndex ); + + /** @return The count of existing fields. */ + size_t GetFieldCount() const; + + bool IsEmpty() const; + + /** Removes all fields. */ + void ClearFields(); + /** Changes the text on an existing field. */ + void SetFieldText( const String& rText, size_t nIndex ); + /** Returns the text of an existing field. */ + const String& GetFieldText( size_t nIndex ) const; + + /** Calculates a field index at a specific pixel position. Returns in every + case the index of an existing field. + @param rnIndex The index of the field is returned here. + @return TRUE, if the index value is valid. */ + void GetExistingIndex( const Point& rPos, size_t& rnIndex ); + + size_t GetSelectedField() const; + void SetSelectedField(size_t nSelected); + + /** Notifies this control that the offset of the first field has been changed. + The control has to adjust the selection to keep the same field selected + on scrolling with scrollbar. */ + void ModifySelectionOffset( long nOffsetDiff ); + /** Selects the next field. Called i.e. after moving a field from SELECT area. */ + void SelectNext(); + /** Grabs focus and sets new selection. */ + void GrabFocusWithSel( size_t nIndex ); + + virtual void Paint( const Rectangle& rRect ); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + virtual void Command( const CommandEvent& rCEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void GetFocus(); + virtual void LoseFocus(); + +protected: + FieldNames& GetFieldNames(); + const FieldNames& GetFieldNames() const; + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + void FieldFocusChanged(size_t nOldSelected, size_t nFieldSelected); + void AccessibleSetFocus(bool bOn); + + /** Updates the tab stop style bits. */ + void UpdateStyle(); + + /** Draws the background. */ + void DrawBackground( OutputDevice& rDev ); + + /** Draws a field into the specified rectangle. */ + void DrawField( + OutputDevice& rDev, const Rectangle& rRect, FieldName& rText, bool bFocus ); + + ScDPLayoutDlg* GetParentDlg() const; + + void AppendPaintable(Window* p); + void DrawPaintables(); + void DrawInvertSelection(); + Size GetStdFieldBtnSize() const; + + /** @return The new selection index after moving to the given direction. */ + virtual size_t CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const = 0; + + /** + * @param nIndex logical index of a field name, independent of scroll + * offsets. + * @return Display position of the button. The first displayed button is + * always 0 no matter what the current scroll offset is. In case + * the field specified by the index is outside the visible range, + * <code>INVALID_INDEX</code> is returned. + */ + virtual size_t GetDisplayPosition(size_t nIndex) const = 0; + + /** Draws the complete control. */ + virtual void Redraw() = 0; + +private: + /** @return TRUE, if the field with the given index exists and the text is + too long for the button control. */ + bool IsShortenedText( size_t nIndex ) const; + + /** Moves the selected field to nDestIndex. */ + void MoveField( size_t nDestIndex ); + /** Moves the selected field to the given direction. */ + void MoveFieldRel( SCsCOL nDX, SCsROW nDY ); + + /** Sets selection to the field with index nIndex. */ + void SetSelection( size_t nIndex ); + /** Sets selection to first field. */ + void SetSelectionHome(); + /** Sets selection to last field. */ + void SetSelectionEnd(); + /** Sets selection to new position relative to current. */ + void MoveSelection( SCsCOL nDX, SCsROW nDY ); + +private: + typedef ::std::vector<Window*> Paintables; + Paintables maPaintables; + + FieldNames maFieldNames; /// String array of the field names and flags, if text fits into button. + ScDPLayoutDlg* mpDlg; + FixedText* mpCaption; /// FixedText containing the name of the control. + ::rtl::OUString maName; + + size_t mnFieldSelected; /// Currently selected field. + + com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAccessible; + ScAccessibleDataPilotControl* pAccessible; +}; + +// ============================================================================ + +/** + * Base class for field control with a horizontal scroll bar at the bottom. + * Page, column, data and select fields are derived from this class. + */ +class ScDPHorFieldControl : public ScDPFieldControlBase +{ +protected: + virtual size_t CalcNewFieldIndex(SCsCOL nDX, SCsROW nDY) const; + virtual size_t GetDisplayPosition(size_t nIndex) const; + virtual void Redraw(); + +public: + ScDPHorFieldControl( + ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption ); + + virtual ~ScDPHorFieldControl(); + + virtual void CalcSize(); + virtual bool IsValidIndex( size_t nIndex ) const; + virtual Point GetFieldPosition(size_t nIndex); + virtual Size GetFieldSize() const; + virtual bool GetFieldIndex( const Point& rPos, size_t& rnIndex ); + virtual String GetDescription() const; + + virtual void ScrollToEnd(); + virtual void ScrollToShowSelection(); + virtual void ResetScrollBar(); + virtual void HandleWheelScroll(long nNotch); + +private: + bool GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize); + void HandleScroll(); + + DECL_LINK(ScrollHdl, ScrollBar*); + DECL_LINK(EndScrollHdl, ScrollBar*); + +private: + + ScrollBar maScroll; + + size_t mnFieldBtnRowCount; + size_t mnFieldBtnColCount; +}; + +// ============================================================================ + +class ScDPPageFieldControl : public ScDPHorFieldControl +{ +public: + ScDPPageFieldControl( + ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption); + virtual ~ScDPPageFieldControl(); + + virtual ScDPFieldType GetFieldType() const; + virtual String GetDescription() const; +}; + +// ============================================================================ + +class ScDPColFieldControl : public ScDPHorFieldControl +{ +public: + ScDPColFieldControl( + ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption); + virtual ~ScDPColFieldControl(); + + virtual ScDPFieldType GetFieldType() const; + virtual String GetDescription() const; +}; + +// ============================================================================ + +/** + * Row field control with a vertical scroll bar. + */ +class ScDPRowFieldControl : public ScDPFieldControlBase +{ +public: + ScDPRowFieldControl( + ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption ); + + virtual ~ScDPRowFieldControl(); + + virtual void CalcSize(); + virtual bool IsValidIndex( size_t nIndex ) const; + virtual Point GetFieldPosition( size_t nIndex ); + virtual Size GetFieldSize() const; + virtual bool GetFieldIndex( const Point& rPos, size_t& rnIndex ); + virtual String GetDescription() const; + virtual ScDPFieldType GetFieldType() const; + + virtual void ScrollToEnd(); + virtual void ScrollToShowSelection(); + virtual void ResetScrollBar(); + virtual void HandleWheelScroll(long nNotch); + +protected: + virtual size_t CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const; + virtual size_t GetDisplayPosition(size_t nIndex) const; + virtual void Redraw(); + +private: + bool GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize); + void HandleScroll(); + + DECL_LINK(ScrollHdl, ScrollBar*); + DECL_LINK(EndScrollHdl, ScrollBar*); + +private: + + ScDPFieldControlBase::ScrollBar maScroll; + size_t mnColumnBtnCount; +}; + +// ============================================================================ + +class ScDPSelectFieldControl : public ScDPHorFieldControl +{ +public: + ScDPSelectFieldControl( + ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption); + virtual ~ScDPSelectFieldControl(); + + virtual ScDPFieldType GetFieldType() const; + virtual String GetDescription() const; +}; + +// ============================================================================ + +class ScDPDataFieldControl : public ScDPHorFieldControl +{ +public: + ScDPDataFieldControl( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ); + virtual ~ScDPDataFieldControl(); + + virtual ScDPFieldType GetFieldType() const; + virtual Size GetFieldSize() const; + virtual String GetDescription() const; +}; + +#endif // SC_FIELDWND_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/filldlg.hxx b/sc/source/ui/inc/filldlg.hxx new file mode 100644 index 000000000000..abecfa27c75a --- /dev/null +++ b/sc/source/ui/inc/filldlg.hxx @@ -0,0 +1,133 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FILLDLG_HXX +#define SC_FILLDLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> +#include "global.hxx" + +class ScDocument; + +//---------------------------------------------------------------------------- + +#include "scui_def.hxx" +//============================================================================ + +class ScFillSeriesDlg : public ModalDialog +{ +public: + ScFillSeriesDlg( Window* pParent, + ScDocument& rDocument, + FillDir eFillDir, + FillCmd eFillCmd, + FillDateCmd eFillDateCmd, + String aStartStr, + double fStep, + double fMax, + sal_uInt16 nPossDir ); + ~ScFillSeriesDlg(); + + FillDir GetFillDir() const { return theFillDir; } + FillCmd GetFillCmd() const { return theFillCmd; } + FillDateCmd GetFillDateCmd() const { return theFillDateCmd; } + double GetStart() const { return fStartVal; } + double GetStep() const { return fIncrement; } + double GetMax() const { return fEndVal; } + + String GetStartStr() const { return aEdStartVal.GetText(); } + + void SetEdStartValEnabled(sal_Bool bFlag=false); + +private: + FixedText aFtStartVal; + Edit aEdStartVal; + String aStartStrVal; + + FixedText aFtEndVal; + Edit aEdEndVal; + + FixedText aFtIncrement; + Edit aEdIncrement; + FixedLine aFlDirection; + RadioButton aBtnDown; + RadioButton aBtnRight; + RadioButton aBtnUp; + RadioButton aBtnLeft; + + FixedLine aFlSep1; + FixedLine aFlType; + RadioButton aBtnArithmetic; + RadioButton aBtnGeometric; + RadioButton aBtnDate; + RadioButton aBtnAutoFill; + + FixedLine aFlSep2; + FixedLine aFlTimeUnit; + RadioButton aBtnDay; + RadioButton aBtnDayOfWeek; + RadioButton aBtnMonth; + RadioButton aBtnYear; + sal_Bool bStartValFlag; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + const String errMsgInvalidVal; + + //---------------------------------------------------------- + + ScDocument& rDoc; + FillDir theFillDir; + FillCmd theFillCmd; + FillDateCmd theFillDateCmd; + double fStartVal; + double fIncrement; + double fEndVal; + +#ifdef _FILLDLG_CXX +private: + void Init( sal_uInt16 nPossDir ); + sal_Bool CheckStartVal(); + sal_Bool CheckIncrementVal(); + sal_Bool CheckEndVal(); + + DECL_LINK( OKHdl, void * ); + DECL_LINK( DisableHdl, Button * ); +#endif +}; + + + +#endif // SC_FILLDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx new file mode 100644 index 000000000000..c8fce8662d92 --- /dev/null +++ b/sc/source/ui/inc/filtdlg.hxx @@ -0,0 +1,263 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FILTDLG_HXX +#define SC_FILTDLG_HXX + +#include <vcl/morebtn.hxx> +#include <vcl/combobox.hxx> +#include <vcl/lstbox.hxx> +#include <svtools/stdctrl.hxx> +#include "global.hxx" // -> ScQueryParam +#include "address.hxx" +#include "anyrefdg.hxx" + + +//---------------------------------------------------------------------------- + +class ScFilterOptionsMgr; +class ScRangeData; +class ScViewData; +class ScDocument; +class ScQueryItem; +class TypedScStrCollection; + +//================================================================== +// Shared resource objects: + +#define _COMMON_FILTER_RSCOBJS \ + CheckBox aBtnCase; \ + CheckBox aBtnRegExp; \ + CheckBox aBtnHeader; \ + CheckBox aBtnUnique; \ + CheckBox aBtnCopyResult; \ + ListBox aLbCopyArea; \ + formula::RefEdit aEdCopyArea; \ + formula::RefButton aRbCopyArea; \ + CheckBox aBtnDestPers; \ + FixedText aFtDbAreaLabel; \ + FixedInfo aFtDbArea; \ + const String aStrUndefined; \ + const String aStrNoName; \ + const String aStrNone; + + +#define _INIT_COMMON_FILTER_RSCOBJS \ + aBtnCase ( this, ScResId( BTN_CASE ) ), \ + aBtnRegExp ( this, ScResId( BTN_REGEXP ) ), \ + aBtnHeader ( this, ScResId( BTN_HEADER ) ), \ + aBtnUnique ( this, ScResId( BTN_UNIQUE ) ), \ + aBtnCopyResult ( this, ScResId( BTN_COPY_RESULT ) ), \ + aLbCopyArea ( this, ScResId( LB_COPY_AREA ) ), \ + aEdCopyArea ( this, this, ScResId( ED_COPY_AREA ) ), \ + aRbCopyArea ( this, ScResId( RB_COPY_AREA ), &aEdCopyArea, this ), \ + aBtnDestPers ( this, ScResId( BTN_DEST_PERS ) ), \ + aFtDbAreaLabel ( this, ScResId( FT_DBAREA_LABEL ) ), \ + aFtDbArea ( this, ScResId( FT_DBAREA ) ), \ + aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ), \ + aStrNoName ( ScGlobal::GetRscString(STR_DB_NONAME) ), \ + aStrNone ( ScResId( SCSTR_NONE ) ), + + +//============================================================================ +class ScFilterDlg : public ScAnyRefDlg +{ +public: + ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + const SfxItemSet& rArgSet ); + ~ScFilterDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + + virtual sal_Bool Close(); + void SliderMoved(); + sal_uInt16 GetSliderPos(); + void RefreshEditRow( sal_uInt16 nOffset ); + +private: + FixedLine aFlCriteria; + //---------------------------- + ListBox aLbConnect1; + ListBox aLbField1; + ListBox aLbCond1; + ComboBox aEdVal1; + //---------------------------- + ListBox aLbConnect2; + ListBox aLbField2; + ListBox aLbCond2; + ComboBox aEdVal2; + //---------------------------- + ListBox aLbConnect3; + ListBox aLbField3; + ListBox aLbCond3; + ComboBox aEdVal3; + //---------------------------- + ListBox aLbConnect4; + ListBox aLbField4; + ListBox aLbCond4; + ComboBox aEdVal4; + //---------------------------- + FixedText aFtConnect; + FixedText aFtField; + FixedText aFtCond; + FixedText aFtVal; + FixedLine aFlSeparator; + + ScrollBar aScrollBar; + + FixedLine aFlOptions; + MoreButton aBtnMore; + HelpButton aBtnHelp; + OKButton aBtnOk; + CancelButton aBtnCancel; + + _COMMON_FILTER_RSCOBJS + + const String aStrEmpty; + const String aStrNotEmpty; + const String aStrRow; + const String aStrColumn; + + ScFilterOptionsMgr* pOptionsMgr; + + const sal_uInt16 nWhichQuery; + const ScQueryParam theQueryData; + ScQueryItem* pOutItem; + ScViewData* pViewData; + ScDocument* pDoc; + SCTAB nSrcTab; + + ComboBox* aValueEdArr[4]; + ListBox* aFieldLbArr[4]; + ListBox* aCondLbArr[4]; + ListBox* aConnLbArr[4]; + bool mbHasDates[MAXQUERY]; + sal_Bool bRefreshExceptQuery[MAXQUERY]; + sal_uInt16 nFieldCount; + sal_Bool bRefInputMode; + + TypedScStrCollection* pEntryLists[MAXCOLCOUNT]; + sal_uInt16 nHeaderPos[MAXCOLCOUNT]; + + // Hack: RefInput control + Timer* pTimer; + +#ifdef _FILTDLG_CXX +private: + void Init ( const SfxItemSet& rArgSet ); + void FillFieldLists (); + void FillAreaList (); + void UpdateValueList ( sal_uInt16 nList ); + void UpdateHdrInValueList( sal_uInt16 nList ); + void ClearValueList ( sal_uInt16 nList ); + sal_uInt16 GetFieldSelPos ( SCCOL nField ); + ScQueryItem* GetOutputItem (); + + // Handler: + DECL_LINK( LbSelectHdl, ListBox* ); + DECL_LINK( ValModifyHdl, ComboBox* ); + DECL_LINK( CheckBoxHdl, CheckBox* ); + DECL_LINK( EndDlgHdl, Button* ); + DECL_LINK( MoreClickHdl, MoreButton* ); + DECL_LINK( ScrollHdl, ScrollBar* ); + + // Hack: RefInput control + DECL_LINK( TimeOutHdl, Timer* ); +#endif +}; + + +//============================================================================ +class ScSpecialFilterDlg : public ScAnyRefDlg +{ +public: + ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + const SfxItemSet& rArgSet ); + ~ScSpecialFilterDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + + virtual sal_Bool Close(); + +private: + FixedText aFtFilterArea; + ListBox aLbFilterArea; + formula::RefEdit aEdFilterArea; + formula::RefButton aRbFilterArea; + + FixedLine aFlOptions; + + _COMMON_FILTER_RSCOBJS + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + MoreButton aBtnMore; + + ScFilterOptionsMgr* pOptionsMgr; + + const sal_uInt16 nWhichQuery; + const ScQueryParam theQueryData; + ScQueryItem* pOutItem; + ScViewData* pViewData; + ScDocument* pDoc; + + formula::RefEdit* pRefInputEdit; + sal_Bool bRefInputMode; + + // Hack: RefInput control + Timer* pTimer; + +#ifdef _SFILTDLG_CXX +private: + void Init( const SfxItemSet& rArgSet ); + ScQueryItem* GetOutputItem( const ScQueryParam& rParam, + const ScRange& rSource ); + + // Handler + DECL_LINK( FilterAreaSelHdl, ListBox* ); + DECL_LINK( FilterAreaModHdl, formula::RefEdit* ); + DECL_LINK( EndDlgHdl, Button* ); + DECL_LINK( ScrollHdl, ScrollBar* ); + + // Hack: RefInput control + DECL_LINK( TimeOutHdl, Timer* ); +#endif +}; + + + +#endif // SC_FILTDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/filter.hrc b/sc/source/ui/inc/filter.hrc new file mode 100644 index 000000000000..62a299c3240e --- /dev/null +++ b/sc/source/ui/inc/filter.hrc @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "sc.hrc" // -> RID_SCDLG_FILTER + // -> RID_SCDLG_SPEC_FILTER + // -> RID_SCDLG_PIVOTFILTER + +// allgemein + +#define BTN_OK 1 +#define BTN_CANCEL 1 +#define BTN_HELP 1 +#define BTN_MORE 1 + +#define BTN_UNIQUE 1 +#define BTN_CASE 2 +#define BTN_REGEXP 3 +#define BTN_HEADER 4 +#define BTN_COPY_RESULT 5 +#define LB_COPY_AREA 6 +#define ED_COPY_AREA 7 +#define RB_COPY_AREA 8 +#define FL_OPTIONS 9 +#define FT_DBAREA_LABEL 10 +#define FT_DBAREA 11 +#define BTN_DEST_PERS 12 + +// Filter: +#define FT_OP 20 +#define FT_FIELD 21 +#define FT_COND 22 +#define FT_VAL 23 +#define LB_FIELD1 24 +#define LB_FIELD2 25 +#define LB_FIELD3 26 +#define LB_OP1 27 +#define LB_OP2 28 +#define LB_COND1 29 +#define LB_COND2 30 +#define LB_COND3 31 +#define ED_VAL1 32 +#define ED_VAL2 33 +#define ED_VAL3 34 +#define FL_CRITERIA 35 +#define FL_SEPARATOR 36 +#define LB_OP3 37 +#define LB_FIELD4 38 +#define LB_COND4 39 +#define ED_VAL4 40 +#define LB_SCROLL 41 +#define LB_OP4 42 + +// Spezialfilter + +#define FT_CRITERIA_AREA 50 +#define LB_CRITERIA_AREA 51 +#define ED_CRITERIA_AREA 52 +#define RB_CRITERIA_AREA 53 + +// IAccessibility2 Implementation +#define STR_COPY_AREA_TO 5054 +#define RID_FILTER_OPERATOR 5055 +#define RID_FILTER_FIELDNAME 5056 +#define RID_FILTER_CONDITION 5057 +#define RID_FILTER_VALUE 5058 diff --git a/sc/source/ui/inc/foptmgr.hxx b/sc/source/ui/inc/foptmgr.hxx new file mode 100644 index 000000000000..5ba7345cd314 --- /dev/null +++ b/sc/source/ui/inc/foptmgr.hxx @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FOPTMGR_HXX +#define SC_FOPTMGR_HXX + +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/button.hxx> + +//---------------------------------------------------------------------------- + +class FixedInfo; +namespace formula +{ + class RefButton; +} +class MoreButton; +class Dialog; +struct ScQueryParam; +class ScDocument; +class ScViewData; + +//---------------------------------------------------------------------------- + +class ScFilterOptionsMgr +{ +public: + ScFilterOptionsMgr( Dialog* ptrDlg, + ScViewData* ptrViewData, + const ScQueryParam& refQueryData, + MoreButton& refBtnMore, + CheckBox& refBtnCase, + CheckBox& refBtnRegExp, + CheckBox& refBtnHeader, + CheckBox& refBtnUnique, + CheckBox& refBtnCopyResult, + CheckBox& refBtnDestPers, + ListBox& refLbCopyArea, + Edit& refEdCopyArea, + formula::RefButton& refRbCopyArea, + FixedText& refFtDbAreaLabel, + FixedInfo& refFtDbArea, + FixedLine& refFlOptions, + const String& refStrNoName, + const String& refStrUndefined ); + ~ScFilterOptionsMgr(); + + sal_Bool VerifyPosStr ( const String& rPosStr ) const; + +private: + Dialog* pDlg; + ScViewData* pViewData; + ScDocument* pDoc; + + MoreButton& rBtnMore; + CheckBox& rBtnCase; + CheckBox& rBtnRegExp; + CheckBox& rBtnHeader; + CheckBox& rBtnUnique; + CheckBox& rBtnCopyResult; + CheckBox& rBtnDestPers; + ListBox& rLbCopyPos; + Edit& rEdCopyPos; + formula::RefButton& rRbCopyPos; + FixedText& rFtDbAreaLabel; + FixedInfo& rFtDbArea; + FixedLine& rFlOptions; + + const String& rStrNoName; + const String& rStrUndefined; + + const ScQueryParam& rQueryData; + +#ifdef _FOPTMGR_CXX +private: + void Init(); + + // Handler: + DECL_LINK( EdPosModifyHdl, Edit* ); + DECL_LINK( LbPosSelHdl, ListBox* ); + DECL_LINK( BtnCopyResultHdl, CheckBox* ); +#endif +}; + + + +#endif // SC_FOPTMGR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/formatsh.hxx b/sc/source/ui/inc/formatsh.hxx new file mode 100644 index 000000000000..7dc1919ea30e --- /dev/null +++ b/sc/source/ui/inc/formatsh.hxx @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FORMATSH_HXX +#define SC_FORMATSH_HXX + +#include <sfx2/shell.hxx> +#include "shellids.hxx" +#include <sfx2/module.hxx> +#include <svx/svdmark.hxx> + +class ScViewData; + +class ScFormatShell: public SfxShell +{ + ScViewData* pViewData; + +protected: + + ScViewData* GetViewData(){return pViewData;} + const ScViewData* GetViewData() const {return pViewData;} + +public: + + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_FORMAT_SHELL) + + ScFormatShell(ScViewData* pData); + virtual ~ScFormatShell(); + + void ExecuteNumFormat( SfxRequest& rReq ); + void GetNumFormatState( SfxItemSet& rSet ); + + void ExecuteAttr( SfxRequest& rReq ); + void GetAttrState( SfxItemSet& rSet ); + + void ExecuteAlignment( SfxRequest& rReq ); + + void ExecuteTextAttr( SfxRequest& rReq ); + void GetTextAttrState( SfxItemSet& rSet ); + + void GetAlignState( SfxItemSet& rSet ); + void GetBorderState( SfxItemSet& rSet ); + + void ExecuteStyle( SfxRequest& rReq ); + void GetStyleState( SfxItemSet& rSet ); + + void ExecuteTextDirection( SfxRequest& rReq ); + void GetTextDirectionState( SfxItemSet& rSet ); + + void ExecFormatPaintbrush( SfxRequest& rReq ); + void StateFormatPaintbrush( SfxItemSet& rSet ); + +private: + short GetCurrentNumberFormatType(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/formdata.hxx b/sc/source/ui/inc/formdata.hxx new file mode 100644 index 000000000000..395809357763 --- /dev/null +++ b/sc/source/ui/inc/formdata.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FORMDATA_HXX +#define SC_FORMDATA_HXX + +#include <tools/string.hxx> +#include <tools/gen.hxx> +#include <formula/formdata.hxx> +class ScInputHandler; +class ScDocShell; + +//============================================================================ + +class ScFormEditData : public formula::FormEditData +{ +public: + ScFormEditData(); + virtual ~ScFormEditData(); + + ScInputHandler* GetInputHandler() { return pInputHandler;} + ScDocShell* GetDocShell() { return pScDocShell;} + + void SetInputHandler(ScInputHandler* pHdl) { pInputHandler=pHdl;} + void SetDocShell(ScDocShell* pSds) { pScDocShell=pSds;} + + + virtual void SaveValues(); + +private: + ScFormEditData( const ScFormEditData& ); +// const ScFormEditData& operator=( const ScFormEditData& r ); + + + ScInputHandler* pInputHandler; + ScDocShell* pScDocShell; +}; + + + +#endif // SC_CRNRDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx new file mode 100644 index 000000000000..306aaa565d8d --- /dev/null +++ b/sc/source/ui/inc/formula.hxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FORMULA_HXX +#define SC_FORMULA_HXX + +#include "anyrefdg.hxx" +#include "global.hxx" // ScAddress +#include <svtools/stdctrl.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/group.hxx> +#include <svtools/svmedit.hxx> +#include <vcl/tabpage.hxx> + +#ifndef _SVSTDARR_STRINGS + +#define _SVSTDARR_STRINGS +#include <svl/svstdarr.hxx> + +#endif +#include "compiler.hxx" +#include "cell.hxx" + +#include "formula/formula.hxx" +#include "IAnyRefDialog.hxx" +#include "anyrefdg.hxx" +#include <formula/IFunctionDescription.hxx> + +class ScViewData; +class ScDocument; +class ScFuncDesc; +class ScInputHandler; +class ScDocShell; +class SvLBoxEntry; + +//============================================================================ +typedef ScTabViewShell* PtrTabViewShell; +//============================================================================ + +class ScFormulaDlg : public formula::FormulaDlg, + public IAnyRefDialog, + public formula::IFormulaEditorHelper +{ + ScFormulaReferenceHelper m_aHelper; + ScFormulaCell* pCell; + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> m_xParser; + ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> m_xOpCodeMapper; + + static ScDocument* pDoc; + static ScAddress aCursorPos; +public: + ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, + Window* pParent, ScViewData* pViewData ,formula::IFunctionManager* _pFunctionMgr); + ~ScFormulaDlg(); + + // IFormulaEditorHelper + virtual void notifyChange(); + virtual void fill(); + virtual bool calculateValue(const String& _sExpression,String& _rResult); + virtual void doClose(sal_Bool _bOk); + virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc); + virtual void showReference(const String& _sFormula); + virtual void dispatch(sal_Bool _bOK,sal_Bool _bMartixChecked); + virtual void setDispatcherLock( sal_Bool bLock ); + virtual void setReferenceInput(const formula::FormEditData* _pData); + virtual void deleteFormData(); + virtual void clear(); + virtual void switchBack(); + virtual formula::FormEditData* getFormEditData() const; + virtual void setCurrentFormula(const String& _sReplacement); + virtual void setSelection(xub_StrLen _nStart,xub_StrLen _nEnd); + virtual void getSelection(xub_StrLen& _nStart,xub_StrLen& _nEnd) const; + virtual String getCurrentFormula() const; + + virtual formula::IFunctionManager* getFunctionManager(); + virtual ::std::auto_ptr<formula::FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaParser> getFormulaParser() const; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const; + virtual ::com::sun::star::table::CellAddress getReferencePosition() const; + + virtual sal_Bool Close(); + + // sc::IAnyRefDialog + virtual void ShowReference(const String& _sRef); + virtual void HideReference( sal_Bool bDoneRefMode = sal_True ); + virtual void SetReference( const ScRange& rRef, ScDocument* pD ); + + virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + virtual void RefInputDone( sal_Bool bForced = false ); + virtual sal_Bool IsTableLocked() const; + virtual sal_Bool IsRefInputMode() const; + + virtual sal_Bool IsDocAllowed( SfxObjectShell* pDocSh ) const; + virtual void AddRefEntry(); + virtual void SetActive(); + virtual void ViewShellChanged( ScTabViewShell* pScViewShell ); +protected: + + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); + sal_uLong FindFocusWin(Window *pWin); + void SaveLRUEntry(const ScFuncDesc* pFuncDesc); + void HighlightFunctionParas(const String& aFormula); + + sal_Bool IsInputHdl(ScInputHandler* pHdl); + ScInputHandler* GetNextInputHandler(ScDocShell* pDocShell,PtrTabViewShell* ppViewSh); +}; + + + +#endif // SC_CRNRDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fuconarc.hxx b/sc/source/ui/inc/fuconarc.hxx new file mode 100644 index 000000000000..232d5c0e1b79 --- /dev/null +++ b/sc/source/ui/inc/fuconarc.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUCONARC_HXX +#define SC_FUCONARC_HXX + +#include "fuconstr.hxx" + +/************************************************************************* +|* +|* Rechteck zeichnen +|* +\************************************************************************/ + +class FuConstArc : public FuConstruct +{ + public: + FuConstArc( ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + + virtual ~FuConstArc(); + // Mouse- & Key-Events + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + // Create default drawing objects via keyboard + virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle); +}; + + + +#endif // _SD_FUCONARC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fuconcustomshape.hxx b/sc/source/ui/inc/fuconcustomshape.hxx new file mode 100644 index 000000000000..6fb89242cbc0 --- /dev/null +++ b/sc/source/ui/inc/fuconcustomshape.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUCONCUSTOMSHAPE_HXX +#define SC_FUCONCUSTOMSHAPE_HXX + +#include "fuconstr.hxx" + +class FuConstCustomShape : public FuConstruct +{ + rtl::OUString aCustomShape; + + void SetAttributes( SdrObject* pObj ); + +public: + FuConstCustomShape(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + + virtual ~FuConstCustomShape(); + // Mouse- & Key-Events + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + // Create default drawing objects via keyboard + virtual SdrObject* CreateDefaultObject( const sal_uInt16 nID, const Rectangle& rRectangle ); + + // #i33136# + virtual bool doConstructOrthogonal() const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fuconpol.hxx b/sc/source/ui/inc/fuconpol.hxx new file mode 100644 index 000000000000..0104388ac03a --- /dev/null +++ b/sc/source/ui/inc/fuconpol.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUCONPOL_HXX +#define SC_FUCONPOL_HXX + +#include "fuconstr.hxx" + +/************************************************************************* +|* +|* Basisklasse fuer alle Funktionen +|* +\************************************************************************/ + +class FuConstPolygon : public FuConstruct +{ + Point aLastPos; + + public: + FuConstPolygon(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + + virtual ~FuConstPolygon(); + // Mouse- & Key-Events + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + // Create default drawing objects via keyboard + virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle); +}; + + +#endif // _FUCONPOL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fuconrec.hxx b/sc/source/ui/inc/fuconrec.hxx new file mode 100644 index 000000000000..5c0cf72735c7 --- /dev/null +++ b/sc/source/ui/inc/fuconrec.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUCONREC_HXX +#define SC_FUCONREC_HXX + +#include "fuconstr.hxx" + +/************************************************************************* +|* +|* Rechteck zeichnen +|* +\************************************************************************/ + +class FuConstRectangle : public FuConstruct +{ + public: + FuConstRectangle(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + + virtual ~FuConstRectangle(); + // Mouse- & Key-Events + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + // Create default drawing objects via keyboard + virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle); +}; + + + +#endif // _SD_FUCONREC_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fuconstr.hxx b/sc/source/ui/inc/fuconstr.hxx new file mode 100644 index 000000000000..5468e2f60f6a --- /dev/null +++ b/sc/source/ui/inc/fuconstr.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUCONSTR_HXX +#define SC_FUCONSTR_HXX + +#include "fudraw.hxx" + + +/************************************************************************/ + +#define MIN_FREEHAND_DISTANCE 10 + + +/************************************************************************* +|* +|* Rechteck zeichnen +|* +\************************************************************************/ + +class FuConstruct : public FuDraw +{ + public: + FuConstruct(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + + virtual ~FuConstruct(); + // Mouse- & Key-Events + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + virtual sal_uInt8 Command(const CommandEvent& rCEvt); + + sal_Bool SimpleMouseButtonUp(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren +}; + + + +#endif // _SD_FUCONSTR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fuconuno.hxx b/sc/source/ui/inc/fuconuno.hxx new file mode 100644 index 000000000000..efb19ccf39e7 --- /dev/null +++ b/sc/source/ui/inc/fuconuno.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUCONUNO_HXX +#define SC_FUCONUNO_HXX + +#include "fuconstr.hxx" + + +/************************************************************************* +|* +|* Control zeichnen +|* +\************************************************************************/ + +class FuConstUnoControl : public FuConstruct +{ +protected: + sal_uInt32 nInventor; + sal_uInt16 nIdentifier; + +public: + FuConstUnoControl(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + + virtual ~FuConstUnoControl(); + // Mouse- & Key-Events + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + // Create default drawing objects via keyboard + virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle); +}; + + + +#endif // _SD_FUCONCTL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fudraw.hxx b/sc/source/ui/inc/fudraw.hxx new file mode 100644 index 000000000000..c2820c5c0569 --- /dev/null +++ b/sc/source/ui/inc/fudraw.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUDRAW_HXX +#define SC_FUDRAW_HXX + +#include "fupoor.hxx" +#include <vcl/pointr.hxx> + +/************************************************************************* +|* +|* Basisklasse fuer alle Drawmodul-spezifischen Funktionen +|* +\************************************************************************/ + +class FuDraw : public FuPoor +{ + protected: + Pointer aNewPointer; + Pointer aOldPointer; + + public: + FuDraw(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + virtual ~FuDraw(); + + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + + virtual void ScrollStart(); + virtual void ScrollEnd(); + + virtual void Activate(); + virtual void Deactivate(); + + virtual void ForcePointer(const MouseEvent* pMEvt); + + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + + // II + virtual void SelectionHasChanged(); + + sal_Bool IsSizingOrMovingNote( const MouseEvent& rMEvt ) const; + + private: + void DoModifiers(const MouseEvent& rMEvt); + void ResetModifiers(); +}; + + + +#endif // _SD_FUDRAW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fuedipo.hxx b/sc/source/ui/inc/fuedipo.hxx new file mode 100644 index 000000000000..892fd748fbb8 --- /dev/null +++ b/sc/source/ui/inc/fuedipo.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUEDIPO_HXX +#define SC_FUEDIPO_HXX + +#include "fudraw.hxx" + + +/************************************************************************* +|* +|* Basisklasse fuer alle Funktionen +|* +\************************************************************************/ + +class FuEditPoints : public FuDraw +{ + public: + FuEditPoints(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + + virtual ~FuEditPoints(); + // Mouse- & Key-Events + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren +}; + + + +#endif // _SD_FUEDIPO_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fuinsert.hxx b/sc/source/ui/inc/fuinsert.hxx new file mode 100644 index 000000000000..2964971244d6 --- /dev/null +++ b/sc/source/ui/inc/fuinsert.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef SC_FUINSERT_HXX +#define SC_FUINSERT_HXX + +#include "fupoor.hxx" + +class FuInsertGraphic : public FuPoor +{ + public: + FuInsertGraphic( ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + virtual ~FuInsertGraphic(); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren +}; + +/************************************************************************/ + +class FuInsertOLE : public FuPoor +{ + public: + FuInsertOLE( ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + virtual ~FuInsertOLE(); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren +}; + +/************************************************************************/ + +class FuInsertChart : public FuPoor +{ + public: + FuInsertChart( ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + virtual ~FuInsertChart(); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren +}; + +/************************************************************************/ + +class FuInsertMedia : public FuPoor +{ + public: + FuInsertMedia( ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + virtual ~FuInsertMedia(); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren +}; + +#endif // _SD_FUINSERT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fumark.hxx b/sc/source/ui/inc/fumark.hxx new file mode 100644 index 000000000000..58f22302ea24 --- /dev/null +++ b/sc/source/ui/inc/fumark.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUMARK_HXX +#define SC_FUMARK_HXX + +#include "fupoor.hxx" +#include "rangelst.hxx" // ScRangeListRef + + +/************************************************************************* +|* +|* Funktion zum Aufziehen eines Rechtecks +|* +\************************************************************************/ + +class FuMarkRect : public FuPoor +{ + protected: + Point aBeginPos; + Rectangle aZoomRect; + sal_Bool bVisible; + sal_Bool bStartDrag; + ScRangeListRef aSourceRange; + + public: + FuMarkRect(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + virtual ~FuMarkRect(); + + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + + virtual void ScrollStart(); + virtual void ScrollEnd(); + + virtual void Activate(); + virtual void Deactivate(); + + virtual void ForcePointer(const MouseEvent* pMEvt); + + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + virtual sal_uInt8 Command(const CommandEvent& rCEvt); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/funcpage.hxx b/sc/source/ui/inc/funcpage.hxx new file mode 100644 index 000000000000..ca24748cc5a7 --- /dev/null +++ b/sc/source/ui/inc/funcpage.hxx @@ -0,0 +1,128 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUNCPAGE_HXX +#define SC_FUNCPAGE_HXX + +#include "funcutl.hxx" +#include "global.hxx" // ScAddress +#include <svtools/stdctrl.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/group.hxx> +#include <svtools/svmedit.hxx> +#include <vcl/tabpage.hxx> + +#ifndef _SVSTDARR_STRINGS + +#define _SVSTDARR_STRINGS +#include <svl/svstdarr.hxx> + +#endif +#include <vcl/tabctrl.hxx> +#include "parawin.hxx" +#include <svtools/svtreebx.hxx> +#include "compiler.hxx" +#include "cell.hxx" + + +class ScViewData; +class ScFuncName_Impl; +class ScDocument; +class ScFuncDesc; + +//============================================================================ + +#define LRU_MAX 10 + +//============================================================================ +class ScListBox : public ListBox +{ +protected: + + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual long PreNotify( NotifyEvent& rNEvt ); + +public: + ScListBox( Window* pParent, const ResId& rResId ); +}; + + + + +//============================================================================ +class ScFuncPage : public TabPage +{ +private: + + Link aDoubleClickLink; + Link aSelectionLink; + FixedText aFtCategory; + ListBox aLbCategory; + FixedText aFtFunction; + ScListBox aLbFunction; + ImageButton aIBFunction; + + const ScFuncDesc* aLRUList[LRU_MAX]; + + + DECL_LINK( SelHdl, ListBox* ); + DECL_LINK( DblClkHdl, ListBox* ); + +protected: + + void UpdateFunctionList(); + void InitLRUList(); + + +public: + + ScFuncPage( Window* pParent); + + void SetCategory(sal_uInt16 nCat); + void SetFunction(sal_uInt16 nFunc); + void SetFocus(); + sal_uInt16 GetCategory(); + sal_uInt16 GetFunction(); + sal_uInt16 GetFunctionEntryCount(); + + sal_uInt16 GetFuncPos(const ScFuncDesc*); + const ScFuncDesc* GetFuncDesc( sal_uInt16 nPos ) const; + String GetSelFunctionName() const; + + void SetDoubleClickHdl( const Link& rLink ) { aDoubleClickLink = rLink; } + const Link& GetDoubleClickHdl() const { return aDoubleClickLink; } + + void SetSelectHdl( const Link& rLink ) { aSelectionLink = rLink; } + const Link& GetSelectHdl() const { return aSelectionLink; } + +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/funcutl.hxx b/sc/source/ui/inc/funcutl.hxx new file mode 100644 index 000000000000..d7878714e4f2 --- /dev/null +++ b/sc/source/ui/inc/funcutl.hxx @@ -0,0 +1,197 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUNCUTL_HXX +#define SC_FUNCUTL_HXX + +#include <vcl/scrbar.hxx> +#include <vcl/fixed.hxx> +#include <svtools/svmedit.hxx> +#include "anyrefdg.hxx" // formula::RefButton + + +//============================================================================ +// class ValWnd + +class ValWnd : public Window +{ +public: + ValWnd( Window* pParent, const ResId& rId ); + + void SetValue( const String& rStrVal ); + +protected: + virtual void Paint( const Rectangle& rRect ); + +private: + String aStrValue; + Rectangle aRectOut; +}; + + +//============================================================================ +// class ScEditBox + +class ScEditBox : public Control +{ +private: + + MultiLineEdit* pMEdit; + Link aSelChangedLink; + Selection aOldSel; + sal_Bool bMouseFlag; + DECL_LINK( ChangedHdl, ScEditBox* ); + +protected: + + virtual long PreNotify( NotifyEvent& rNEvt ); + virtual void SelectionChanged(); + virtual void Resize(); + virtual void GetFocus(); + + +public: + ScEditBox( Window* pParent, const ResId& rResId ); + + ~ScEditBox(); + + MultiLineEdit* GetEdit() {return pMEdit;} + + void SetSelChangedHdl( const Link& rLink ) { aSelChangedLink = rLink; } + const Link& GetSelChangedHdl() const { return aSelChangedLink; } + + void UpdateOldSel(); +}; + + + +//============================================================================ +// class ArgEdit + +class ArgEdit : public formula::RefEdit +{ +public: + ArgEdit( Window* pParent, const ResId& rResId ); + + void Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit, + ScrollBar& rArgSlider, sal_uInt16 nArgCount ); + +protected: + virtual void KeyInput( const KeyEvent& rKEvt ); + +private: + ArgEdit* pEdPrev; + ArgEdit* pEdNext; + ScrollBar* pSlider; + sal_uInt16 nArgs; +}; + + +//============================================================================ +// class ArgInput + +class ArgInput +{ +private: + + Link aFxClickLink; + Link aRefClickLink; + Link aFxFocusLink; + Link aRefFocusLink; + Link aEdFocusLink; + Link aEdModifyLink; + + FixedText* pFtArg; + ImageButton* pBtnFx; + ArgEdit* pEdArg; + formula::RefButton* pRefBtn; + + DECL_LINK( FxBtnClickHdl, ImageButton* ); + DECL_LINK( RefBtnClickHdl,formula::RefButton* ); + DECL_LINK( FxBtnFocusHdl, ImageButton* ); + DECL_LINK( RefBtnFocusHdl,formula::RefButton* ); + DECL_LINK( EdFocusHdl, ArgEdit* ); + DECL_LINK( EdModifyHdl,ArgEdit* ); + +protected: + + virtual void FxClick(); + virtual void RefClick(); + virtual void FxFocus(); + virtual void RefFocus(); + virtual void EdFocus(); + virtual void EdModify(); + +public: + + ArgInput(); + + void InitArgInput ( FixedText* pftArg, + ImageButton* pbtnFx, + ArgEdit* pedArg, + formula::RefButton* prefBtn); + + void SetArgName(const String &aArg); + String GetArgName(); + void SetArgNameFont(const Font&); + + void SetArgVal(const String &aVal); + String GetArgVal(); + + void SetArgSelection (const Selection& rSel ); + + ArgEdit* GetArgEdPtr() {return pEdArg;} + + + void SetFxClickHdl( const Link& rLink ) { aFxClickLink = rLink; } + const Link& GetFxClickHdl() const { return aFxClickLink; } + + void SetRefClickHdl( const Link& rLink ) { aRefClickLink = rLink; } + const Link& GetRefClickHdl() const { return aRefClickLink; } + + void SetFxFocusHdl( const Link& rLink ) { aFxFocusLink = rLink; } + const Link& GetFxFocusHdl() const { return aFxFocusLink; } + + void SetRefFocusHdl( const Link& rLink ) { aRefFocusLink = rLink; } + const Link& GetRefFocusHdl() const { return aRefFocusLink; } + + void SetEdFocusHdl( const Link& rLink ) { aEdFocusLink = rLink; } + const Link& GetEdFocusHdl() const { return aEdFocusLink; } + + void SetEdModifyHdl( const Link& rLink ) { aEdModifyLink = rLink; } + const Link& GetEdModifyHdl() const { return aEdModifyLink; } + + void Hide(); + void Show(); + +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fupoor.hxx b/sc/source/ui/inc/fupoor.hxx new file mode 100644 index 000000000000..5638b3bc6f68 --- /dev/null +++ b/sc/source/ui/inc/fupoor.hxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _SC_FUPOOR_HXX +#define _SC_FUPOOR_HXX + +#include <vcl/event.hxx> +#include <vcl/timer.hxx> +#include <sfx2/request.hxx> + +class ScDrawView; +class ScTabViewShell; +class Window; +class SdrModel; +class Dialog; + +// Create default drawing objects via keyboard +class SdrObject; + +// Return-Werte fuer Command +#define SC_CMD_NONE 0 +#define SC_CMD_USED 1 +#define SC_CMD_IGNORE 2 + +/************************************************************************* +|* +|* Basisklasse fuer alle Funktionen +|* +\************************************************************************/ + +class FuPoor +{ +protected: + ScDrawView* pView; + ScTabViewShell* pViewShell; + Window* pWindow; + SdrModel* pDrDoc; + + SfxRequest aSfxRequest; + Dialog* pDialog; + + Timer aScrollTimer; // fuer Autoscrolling + DECL_LINK( ScrollHdl, Timer * ); + void ForceScroll(const Point& aPixPos); + + Timer aDragTimer; // fuer Drag&Drop + DECL_LINK( DragTimerHdl, Timer * ); + DECL_LINK( DragHdl, void * ); + sal_Bool bIsInDragMode; + Point aMDPos; // Position von MouseButtonDown + + // member to hold state of the mouse buttons for creation + // of own MouseEvents (like in ScrollHdl) +private: + sal_uInt16 mnCode; + +public: + FuPoor(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + virtual ~FuPoor(); + + // see member + void SetMouseButtonCode(sal_uInt16 nNew) { if(nNew != mnCode) mnCode = nNew; } + sal_uInt16 GetMouseButtonCode() const { return mnCode; } + + virtual void Paint(const Rectangle&, Window*) {} + + virtual void DoCut(); + virtual void DoCopy(); + virtual void DoPaste(); + + // Mouse- & Key-Events; Returnwert=TRUE: Event wurde bearbeitet + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent&) { return false; } + + // moved from inline to *.cxx + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); // { return FALSE; } + + // moved from inline to *.cxx + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); // { return FALSE; } + + virtual sal_uInt8 Command(const CommandEvent& rCEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + virtual void ScrollStart() {} // diese Funktionen werden von + virtual void ScrollEnd() {} // ForceScroll aufgerufen + + void SetWindow(Window* pWin) { pWindow = pWin; } + + sal_uInt16 GetSlotID() const { return( aSfxRequest.GetSlot() ); } + + sal_Bool IsDetectiveHit( const Point& rLogicPos ); + + void StopDragTimer(); + + // Create default drawing objects via keyboard + virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle); + +protected: + void ImpForceQuadratic(Rectangle& rRect); + +public: + // #i33136# + virtual bool doConstructOrthogonal() const; +}; + + + +#endif // _SD_FUPOOR_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/fusel.hxx b/sc/source/ui/inc/fusel.hxx new file mode 100644 index 000000000000..d13ddc3e9558 --- /dev/null +++ b/sc/source/ui/inc/fusel.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUSEL_HXX +#define SC_FUSEL_HXX + +#include "fudraw.hxx" + +//class Outliner; +//class OutlinerView; +class SdrPageView; + + +/************************************************************************* +|* +|* Basisklasse fuer alle Funktionen +|* +\************************************************************************/ + +class FuSelection : public FuDraw +{ +public: + FuSelection(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq ); + + virtual ~FuSelection(); + // Mouse- & Key-Events + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + virtual sal_uInt8 Command(const CommandEvent& rCEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + void ActivateNoteHandles(SdrObject* pObj); + +protected: +// Outliner* pOutliner; +// OutlinerView* pOutlinerView; + sal_Bool bVCAction; + +private: + sal_Bool TestDetective( SdrPageView* pPV, const Point& rPos ); // -> fusel2 + + bool IsNoteCaptionMarked() const; + bool IsNoteCaptionClicked( const Point& rPos ) const; +}; + + + +#endif // _SD_FUSEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/futext.hxx b/sc/source/ui/inc/futext.hxx new file mode 100644 index 000000000000..f3150424ba50 --- /dev/null +++ b/sc/source/ui/inc/futext.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_FUTEXT_HXX +#define SC_FUTEXT_HXX + +#include "fuconstr.hxx" + +class SdrObject; +class SdrTextObj; +class SdrOutliner; + +/************************************************************************* +|* +|* Basisklasse fuer Textfunktionen +|* +\************************************************************************/ +class FuText : public FuConstruct +{ +protected: +// sal_uInt16 nOldObjectBar; + SdrTextObj* pTextObj; + +public: + FuText(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* pView, + SdrModel* pDoc, SfxRequest& rReq); + + virtual ~FuText(); + + virtual sal_Bool KeyInput(const KeyEvent& rKEvt); + virtual sal_Bool MouseMove(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt); + virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + virtual void ForcePointer(const MouseEvent* pMEvt); + + virtual void SelectionHasChanged(); + + void SetInEditMode( SdrObject* pObj = NULL, const Point* pMousePixel = NULL, + sal_Bool bCursorToEnd = false, const KeyEvent* pInitialKey = NULL ); + void StopEditMode(sal_Bool bTextDirection = false); + void StopDragMode(SdrObject* pObject); + + // Create default drawing objects via keyboard + virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle); + +private: + SdrOutliner* MakeOutliner(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/graphsh.hxx b/sc/source/ui/inc/graphsh.hxx new file mode 100644 index 000000000000..64c3e053368b --- /dev/null +++ b/sc/source/ui/inc/graphsh.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef GRAPHSH_HXX +#define GRAPHSH_HXX + +#include <sfx2/shell.hxx> +#include "shellids.hxx" +#include <sfx2/module.hxx> +#include <svx/svdmark.hxx> + +class ScViewData; + +#include "drawsh.hxx" + +class ScGraphicShell: public ScDrawShell +{ +public: + + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_GRAPHIC_SHELL) + + ScGraphicShell(ScViewData* pData); + virtual ~ScGraphicShell(); + + void Execute(SfxRequest& rReq); + void GetAttrState(SfxItemSet &rSet); + + void ExecuteFilter(SfxRequest& rReq); + void GetFilterState(SfxItemSet &rSet); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/gridmerg.hxx b/sc/source/ui/inc/gridmerg.hxx new file mode 100644 index 000000000000..86cae4fdfab8 --- /dev/null +++ b/sc/source/ui/inc/gridmerg.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_GRIDMERG_HXX +#define SC_GRIDMERG_HXX + +#include <tools/solar.h> + +class OutputDevice; + +class ScGridMerger +{ +private: + OutputDevice* pDev; + long nOneX; + long nOneY; + long nFixStart; + long nFixEnd; + long nVarStart; + long nVarDiff; + long nCount; + sal_Bool bVertical; + sal_Bool bOptimize; + + void AddLine( long nStart, long nEnd, long nPos ); + +public: + ScGridMerger( OutputDevice* pOutDev, long nOnePixelX, long nOnePixelY ); + ~ScGridMerger(); + + void AddHorLine( long nX1, long nX2, long nY ); + void AddVerLine( long nX, long nY1, long nY2 ); + void Flush(); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx new file mode 100644 index 000000000000..a3762b40d421 --- /dev/null +++ b/sc/source/ui/inc/gridwin.hxx @@ -0,0 +1,419 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_GRIDWIN_HXX +#define SC_GRIDWIN_HXX + +#include <tools/string.hxx> +#include <svtools/transfer.hxx> +#include "viewutil.hxx" +#include "viewdata.hxx" +#include "cbutton.hxx" +#include <svx/sdr/overlay/overlayobject.hxx> +#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> +#include <basegfx/matrix/b2dhommatrix.hxx> + +#include <vector> +#include <memory> +#include <boost/shared_ptr.hpp> + +// --------------------------------------------------------------------------- + +struct ScTableInfo; +class ScViewSelectionEngine; +class ScDPObject; +class ScDPFieldPopupWindow; +class ScDPFieldButton; +class ScOutputData; +class ScFilterListBox; +class AutoFilterPopup; +class SdrObject; +class SdrEditView; +class ScNoteMarker; +class FloatingWindow; +class SdrHdlList; +class ScTransferObj; +struct SpellCallbackInfo; + + // Maus-Status (nMouseStatus) + +#define SC_GM_NONE 0 +#define SC_GM_TABDOWN 1 +#define SC_GM_DBLDOWN 2 +#define SC_GM_FILTER 3 +#define SC_GM_IGNORE 4 +#define SC_GM_WATERUNDO 5 +#define SC_GM_URLDOWN 6 + + // Page-Drag-Modus + +#define SC_PD_NONE 0 +#define SC_PD_RANGE_L 1 +#define SC_PD_RANGE_R 2 +#define SC_PD_RANGE_T 4 +#define SC_PD_RANGE_B 8 +#define SC_PD_RANGE_TL (SC_PD_RANGE_T|SC_PD_RANGE_L) +#define SC_PD_RANGE_TR (SC_PD_RANGE_T|SC_PD_RANGE_R) +#define SC_PD_RANGE_BL (SC_PD_RANGE_B|SC_PD_RANGE_L) +#define SC_PD_RANGE_BR (SC_PD_RANGE_B|SC_PD_RANGE_R) +#define SC_PD_BREAK_H 16 +#define SC_PD_BREAK_V 32 + + +class ScHideTextCursor +{ +private: + ScViewData* pViewData; + ScSplitPos eWhich; + +public: + ScHideTextCursor( ScViewData* pData, ScSplitPos eW ); + ~ScHideTextCursor(); +}; + +// --------------------------------------------------------------------------- +// predefines +namespace sdr { namespace overlay { class OverlayObjectList; }} + +class ScGridWindow : public Window, public DropTargetHelper, public DragSourceHelper +{ + // ScFilterListBox wird immer fuer Auswahlliste benutzt + friend class ScFilterListBox; + +private: + // #114409# + ::sdr::overlay::OverlayObjectList* mpOOCursors; + ::sdr::overlay::OverlayObjectList* mpOOSelection; + ::sdr::overlay::OverlayObjectList* mpOOSelectionBorder; + ::sdr::overlay::OverlayObjectList* mpOOAutoFill; + ::sdr::overlay::OverlayObjectList* mpOODragRect; + ::sdr::overlay::OverlayObjectList* mpOOHeader; + ::sdr::overlay::OverlayObjectList* mpOOShrink; + + ::boost::shared_ptr<Rectangle> mpAutoFillRect; + + /** + * Stores current visible column and row ranges, used to avoid expensive + * operations on objects that are outside visible area. + */ + struct VisibleRange + { + SCCOL mnCol1; + SCCOL mnCol2; + SCROW mnRow1; + SCROW mnRow2; + + VisibleRange(); + + bool isInside(SCCOL nCol, SCROW nRow) const; + }; + VisibleRange maVisibleRange; + +private: + ScViewData* pViewData; + ScSplitPos eWhich; + ScHSplitPos eHWhich; + ScVSplitPos eVWhich; + + ScNoteMarker* pNoteMarker; + + ScFilterListBox* pFilterBox; + FloatingWindow* pFilterFloat; + ::std::auto_ptr<ScDPFieldPopupWindow> mpDPFieldPopup; + ::std::auto_ptr<ScDPFieldButton> mpFilterButton; + + sal_uInt16 nCursorHideCount; + + sal_Bool bMarking; + + sal_uInt16 nButtonDown; + sal_Bool bEEMouse; // Edit-Engine hat Maus + sal_uInt8 nMouseStatus; + sal_uInt8 nNestedButtonState; // track nested button up/down calls + + sal_Bool bDPMouse; // DataPilot-D&D (neue Pivottabellen) + long nDPField; + ScDPObject* pDragDPObj; //! name? + + sal_Bool bRFMouse; // RangeFinder-Drag + sal_Bool bRFSize; + sal_uInt16 nRFIndex; + SCsCOL nRFAddX; + SCsROW nRFAddY; + + sal_uInt16 nPagebreakMouse; // Pagebreak-Modus Drag + SCCOLROW nPagebreakBreak; + SCCOLROW nPagebreakPrev; + ScRange aPagebreakSource; + ScRange aPagebreakDrag; + sal_Bool bPagebreakDrawn; + + sal_uInt8 nPageScript; + + long nLastClickX; + long nLastClickY; + + sal_Bool bDragRect; + SCCOL nDragStartX; + SCROW nDragStartY; + SCCOL nDragEndX; + SCROW nDragEndY; + InsCellCmd meDragInsertMode; + + sal_uInt16 nCurrentPointer; + + sal_Bool bIsInScroll; + sal_Bool bIsInPaint; + + ScDDComboBoxButton aComboButton; + + Point aCurMousePos; + + sal_uInt16 nPaintCount; + Rectangle aRepaintPixel; + sal_Bool bNeedsRepaint; + + sal_Bool bAutoMarkVisible; + ScAddress aAutoMarkPos; + + sal_Bool bListValButton; + ScAddress aListValPos; + + Rectangle aInvertRect; + + DECL_LINK( PopupModeEndHdl, FloatingWindow* ); + DECL_LINK( PopupSpellingHdl, SpellCallbackInfo* ); + + sal_Bool TestMouse( const MouseEvent& rMEvt, sal_Bool bAction ); + + sal_Bool DoPageFieldSelection( SCCOL nCol, SCROW nRow ); + bool DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ); + void DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ); + + void DPMouseMove( const MouseEvent& rMEvt ); + void DPMouseButtonUp( const MouseEvent& rMEvt ); + void DPTestMouse( const MouseEvent& rMEvt, sal_Bool bMove ); + + /** + * Check if the mouse click is on a field popup button. + * + * @return bool true if the field popup menu has been launched and no + * further mouse event handling is necessary, false otherwise. + */ + bool DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj); + void DPLaunchFieldPopupMenu( + const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, ScDPObject* pDPObj); + + void RFMouseMove( const MouseEvent& rMEvt, sal_Bool bUp ); + + void PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp ); + + void UpdateDragRect( sal_Bool bShowRange, const Rectangle& rPosRect ); + + sal_Bool IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab ); + void ExecFilter( sal_uLong nSel, SCCOL nCol, SCROW nRow, + const String& aValue, bool bCheckForDates ); + void FilterSelect( sal_uLong nSel ); + + void ExecDataSelect( SCCOL nCol, SCROW nRow, const String& rStr ); + + void ExecPageFieldSelect( SCCOL nCol, SCROW nRow, sal_Bool bHasSelection, const String& rStr ); + + sal_Bool HasScenarioButton( const Point& rPosPixel, ScRange& rScenRange ); + + sal_Bool DropScroll( const Point& rMousePos ); + + sal_Int8 AcceptPrivateDrop( const AcceptDropEvent& rEvt ); + sal_Int8 ExecutePrivateDrop( const ExecuteDropEvent& rEvt ); + sal_Int8 DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPosX, SCROW nDestPosY, + const Point& rLogicPos, sal_Int8 nDndAction ); + + void HandleMouseButtonDown( const MouseEvent& rMEvt ); + + sal_Bool DrawMouseButtonDown(const MouseEvent& rMEvt); + sal_Bool DrawMouseButtonUp(const MouseEvent& rMEvt); + sal_Bool DrawMouseMove(const MouseEvent& rMEvt); + sal_Bool DrawKeyInput(const KeyEvent& rKEvt); + sal_Bool DrawCommand(const CommandEvent& rCEvt); + sal_Bool DrawHasMarkedObj(); + void DrawEndAction(); + void DrawMarkDropObj( SdrObject* pObj ); + SdrObject* GetEditObject(); + sal_Bool IsMyModel(SdrEditView* pSdrView); + + void DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sal_uLong nLayer ); + void DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pContentDev ); + void DrawAfterScroll(/*BOOL bVal*/); + Rectangle GetListValButtonRect( const ScAddress& rButtonPos ); + + void DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, OutputDevice* pContentDev ); + + sal_Bool GetEditUrl( const Point& rPos, + String* pName=0, String* pUrl=0, String* pTarget=0 ); + sal_Bool GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos, + String* pName=0, String* pUrl=0, String* pTarget=0 ); + + sal_Bool HitRangeFinder( const Point& rMouse, sal_Bool& rCorner, sal_uInt16* pIndex = NULL, + SCsCOL* pAddX = NULL, SCsROW* pAddY = NULL ); + + sal_uInt16 HitPageBreak( const Point& rMouse, ScRange* pSource = NULL, + SCCOLROW* pBreak = NULL, SCCOLROW* pPrev = NULL ); + + void PasteSelection( const Point& rPosPixel ); + + void SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX, SCsROW nCellY ); + + void GetSelectionRects( ::std::vector< Rectangle >& rPixelRects ); + +protected: + using Window::Resize; + virtual void Resize( const Size& rSize ); + virtual void PrePaint(); + virtual void Paint( const Rectangle& rRect ); + virtual void KeyInput(const KeyEvent& rKEvt); + virtual void GetFocus(); + virtual void LoseFocus(); + + virtual void RequestHelp( const HelpEvent& rEvt ); + virtual void Command( const CommandEvent& rCEvt ); + + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); + virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); + +public: + ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhichPos ); + ~ScGridWindow(); + + // #i70788# flush and get overlay + ::sdr::overlay::OverlayManager* getOverlayManager(); + void flushOverlayManager(); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual long PreNotify( NotifyEvent& rNEvt ); + virtual void Tracking( const TrackingEvent& rTEvt ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + void FakeButtonUp(); + + Point GetMousePosPixel() const; + void UpdateStatusPosSize(); + + void ClickExtern(); + + void SetPointer( const Pointer& rPointer ); + + void MoveMouseStatus( ScGridWindow &rDestWin ); + + void ScrollPixel( long nDifX, long nDifY ); + void UpdateEditViewPos(); + + void UpdateFormulas(); + + void DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSelect ); + void DoScenarioMenue( const ScRange& rScenRange ); + + void LaunchPageFieldMenu( SCCOL nCol, SCROW nRow ); + void LaunchDPFieldMenu( SCCOL nCol, SCROW nRow ); + + ::com::sun::star::sheet::DataPilotFieldOrientation GetDPFieldOrientation( SCCOL nCol, SCROW nRow ) const; + + void DrawButtons( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + ScTableInfo& rTabInfo, OutputDevice* pContentDev ); + + using Window::Draw; + void Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + ScUpdateMode eMode = SC_UPDATE_ALL ); + + void InvertSimple( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + sal_Bool bTestMerge = false, sal_Bool bRepeat = false ); + + void CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress); + + void HideCursor(); + void ShowCursor(); + void UpdateAutoFillMark(sal_Bool bMarked, const ScRange& rMarkRange); + + void UpdateListValPos( sal_Bool bVisible, const ScAddress& rPos ); + + sal_Bool ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKeyboard ); + void HideNoteMarker(); + + MapMode GetDrawMapMode( sal_Bool bForce = false ); + + void ContinueDrag(); + + void StopMarking(); + void UpdateInputContext(); + + void CheckInverted() { if (nPaintCount) bNeedsRepaint = sal_True; } + + void DoInvertRect( const Rectangle& rPixel ); + + void CheckNeedsRepaint(); + + void UpdateDPFromFieldPopupMenu(); + void UpdateVisibleRange(); + + // #114409# + void CursorChanged(); + void DrawLayerCreated(); + + void DeleteCopySourceOverlay(); + void UpdateCopySourceOverlay(); + void DeleteCursorOverlay(); + void UpdateCursorOverlay(); + void DeleteSelectionOverlay(); + void UpdateSelectionOverlay(); + void DeleteAutoFillOverlay(); + void UpdateAutoFillOverlay(); + void DeleteDragRectOverlay(); + void UpdateDragRectOverlay(); + void DeleteHeaderOverlay(); + void UpdateHeaderOverlay(); + void DeleteShrinkOverlay(); + void UpdateShrinkOverlay(); + void UpdateAllOverlays(); + +protected: + // #114409# + void ImpCreateOverlayObjects(); + void ImpDestroyOverlayObjects(); + +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/groupdlg.hxx b/sc/source/ui/inc/groupdlg.hxx new file mode 100644 index 000000000000..1510d1cf6154 --- /dev/null +++ b/sc/source/ui/inc/groupdlg.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_GROUPDLG_HXX +#define SC_GROUPDLG_HXX + + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> + +//------------------------------------------------------------------------ + +class ScGroupDlg : public ModalDialog +{ +public: + ScGroupDlg( Window* pParent, + sal_uInt16 nResId, + sal_Bool bUnGroup = false, + sal_Bool bRows = sal_True ); + ~ScGroupDlg(); + + sal_Bool GetColsChecked() const; + +private: + FixedLine aFlFrame; + RadioButton aBtnRows; + RadioButton aBtnCols; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; +}; + + +#endif // SC_STRINDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/hdrcont.hxx b/sc/source/ui/inc/hdrcont.hxx new file mode 100644 index 000000000000..da614f7fa762 --- /dev/null +++ b/sc/source/ui/inc/hdrcont.hxx @@ -0,0 +1,141 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_HDRCONT_HXX +#define SC_HDRCONT_HXX + +#include <vcl/window.hxx> +#include <vcl/seleng.hxx> +#include "address.hxx" + +// --------------------------------------------------------------------------- + + +#define HDR_HORIZONTAL 0 +#define HDR_VERTICAL 1 + +#define HDR_SIZE_OPTIMUM 0xFFFF + + + // Groesse des Sliders +#define HDR_SLIDERSIZE 2 + +class ScHeaderControl : public Window +{ +private: + SelectionEngine* pSelEngine; + Font aNormFont; + Font aBoldFont; + sal_Bool bBoldSet; + + sal_uInt16 nFlags; + sal_Bool bVertical; // Vertikal = Zeilenheader + + long nWidth; + long nSmallWidth; + long nBigWidth; + + SCCOLROW nSize; + + SCCOLROW nMarkStart; + SCCOLROW nMarkEnd; + sal_Bool bMarkRange; + + sal_Bool bDragging; // Groessen aendern + SCCOLROW nDragNo; + long nDragStart; + long nDragPos; + sal_Bool bDragMoved; + + sal_Bool bIgnoreMove; + + long GetScrPos( SCCOLROW nEntryNo ); + SCCOLROW GetMousePos( const MouseEvent& rMEvt, sal_Bool& rBorder ); + bool IsSelectionAllowed(SCCOLROW nPos) const; + void ShowDragHelp(); + + void DoPaint( SCCOLROW nStart, SCCOLROW nEnd ); + + void DrawShadedRect( long nStart, long nEnd, const Color& rBaseColor ); + +protected: + // von Window ueberladen + + virtual void Paint( const Rectangle& rRect ); + + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void Tracking( const TrackingEvent& rTEvt ); + + virtual void RequestHelp( const HelpEvent& rHEvt ); + + // neue Methoden + + virtual SCCOLROW GetPos() = 0; // aktuelle Position (Scrolling) + virtual sal_uInt16 GetEntrySize( SCCOLROW nEntryNo ) = 0; // Breite / Hoehe (Pixel) + virtual String GetEntryText( SCCOLROW nEntryNo ) = 0; + + virtual SCCOLROW GetHiddenCount( SCCOLROW nEntryNo ); + virtual sal_Bool IsLayoutRTL(); + virtual sal_Bool IsMirrored(); + + virtual void SetEntrySize( SCCOLROW nPos, sal_uInt16 nNewWidth ) = 0; + virtual void HideEntries( SCCOLROW nStart, SCCOLROW nEnd ) = 0; + + virtual void SetMarking( sal_Bool bSet ); + virtual void SelectWindow(); + virtual sal_Bool IsDisabled(); + virtual sal_Bool ResizeAllowed(); + virtual String GetDragHelp( long nVal ); + + virtual void DrawInvert( long nDragPos ); + virtual void Command( const CommandEvent& rCEvt ); + +public: + ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEngine, + SCCOLROW nNewSize, sal_uInt16 nNewFlags ); + ~ScHeaderControl(); + + void SetIgnoreMove(sal_Bool bSet) { bIgnoreMove = bSet; } + + void StopMarking(); + + void SetMark( sal_Bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd ); + + long GetWidth() const { return nWidth; } + long GetSmallWidth() const { return nSmallWidth; } + long GetBigWidth() const { return nBigWidth; } + void SetWidth( long nNew ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/hfedtdlg.hxx b/sc/source/ui/inc/hfedtdlg.hxx new file mode 100644 index 000000000000..0f63f2e7bae9 --- /dev/null +++ b/sc/source/ui/inc/hfedtdlg.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_HFEDTDLG_HXX +#define SC_HFEDTDLG_HXX + +#include <sfx2/tabdlg.hxx> +#include <svx/pageitem.hxx> + + +#include "sc.hrc" + + +//================================================================== + +class ScHFEditDlg : public SfxTabDialog +{ + SvxNumType eNumType; +public: + ScHFEditDlg( SfxViewFrame* pFrame, + Window* pParent, + const SfxItemSet& rCoreSet, + const String& rPageStyle, + sal_uInt16 nResId = RID_SCDLG_HFEDIT ); + + ~ScHFEditDlg(); + + virtual void PageCreated( sal_uInt16 nId, SfxTabPage& rPage ); +}; + + +#endif // SC_HFEDTDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/highred.hrc b/sc/source/ui/inc/highred.hrc new file mode 100644 index 000000000000..b6a4a1a4023c --- /dev/null +++ b/sc/source/ui/inc/highred.hrc @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // -> RID_SCDLG_CHANGES + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 5 + +#define CB_HIGHLIGHT_ACCEPT 6 +#define CB_HIGHLIGHT_REJECT 7 + +#define FL_FILTER 10 +#define TP_FILTER 11 +#define TP_VIEW 12 +#define CB_HIGHLIGHT 13 + +#define FT_ASSIGN 14 +#define ED_ASSIGN 15 +#define RB_ASSIGN 16 + +#define STR_INSERT_COLS 20 +#define STR_INSERT_ROWS 21 +#define STR_INSERT_TABS 22 +#define STR_DELETE_COLS 23 +#define STR_DELETE_ROWS 24 +#define STR_DELETE_TABS 25 +#define STR_MOVE 26 +#define STR_CONTENT 27 +#define STR_REJECT 28 + +// Bitmaps +#define BMP_STR_CLOSE 31 +#define BMP_STR_OPEN 32 +#define BMP_STR_END 33 +#define BMP_STR_ERROR 34 diff --git a/sc/source/ui/inc/highred.hxx b/sc/source/ui/inc/highred.hxx new file mode 100644 index 000000000000..d3b6b24513a0 --- /dev/null +++ b/sc/source/ui/inc/highred.hxx @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_HIGHRED_HXX +#define SC_HIGHRED_HXX + +#include <vcl/morebtn.hxx> +#include <vcl/combobox.hxx> +#include <vcl/group.hxx> +#include <svtools/headbar.hxx> +#include <svtools/svtabbx.hxx> + + +#include "rangenam.hxx" +#include "anyrefdg.hxx" + +#include <vcl/morebtn.hxx> +#include <vcl/lstbox.hxx> + +#include <svx/ctredlin.hxx> +#include <svx/simptabl.hxx> +#include "chgtrack.hxx" +#include "chgviset.hxx" + +class ScViewData; +class ScDocument; + +#ifndef FLT_DATE_BEFORE +#define FLT_DATE_BEFORE 0 +#define FLT_DATE_SINCE 1 +#define FLT_DATE_EQUAL 2 +#define FLT_DATE_NOTEQUAL 3 +#define FLT_DATE_BETWEEN 4 +#define FLT_DATE_SAVE 5 +#endif + +//================================================================== + +class ScHighlightChgDlg : public ScAnyRefDlg +{ +private: + + CheckBox aHighlightBox; + FixedLine aFlFilter; + SvxTPFilter aFilterCtr; + CheckBox aCbAccept; + CheckBox aCbReject; + + OKButton aOkButton; + CancelButton aCancelButton; + HelpButton aHelpButton; + + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; + + ScViewData* pViewData; + ScDocument* pDoc; + ScRangeName aLocalRangeName; + Selection theCurSel; + Size MinSize; + ScRangeList aRangeList; + ScChangeViewSettings aChangeViewSet; + + void Init(); + + DECL_LINK( RefHandle, SvxTPFilter* ); + DECL_LINK(HighLightHandle, CheckBox*); + DECL_LINK(OKBtnHdl, PushButton*); + + +protected: + + virtual void RefInputDone( sal_Bool bForced = false ); + +public: + ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScViewData* ptrViewData); + + ~ScHighlightChgDlg(); + + virtual void SetActive(); + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + virtual sal_Bool Close(); + virtual sal_Bool IsRefInputMode() const; + +}; + + +#endif // SC_NAMEDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/hintwin.hxx b/sc/source/ui/inc/hintwin.hxx new file mode 100644 index 000000000000..f199698178bc --- /dev/null +++ b/sc/source/ui/inc/hintwin.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_HINTWIN_HXX +#define SC_HINTWIN_HXX + +#include <vcl/window.hxx> + +class ScHintWindow : public Window +{ +private: + String aTitle; + String aMessage; + Point aTextStart; + long nTextHeight; + Font aTextFont; + Font aHeadFont; + +protected: + virtual void Paint( const Rectangle& rRect ); + +public: + ScHintWindow( Window* pParent, const String& rTit, const String& rMsg ); + ~ScHintWindow(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/hiranges.hxx b/sc/source/ui/inc/hiranges.hxx new file mode 100644 index 000000000000..e14c74938bdd --- /dev/null +++ b/sc/source/ui/inc/hiranges.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_HIRANGES_HXX +#define SC_HIRANGES_HXX + +#include <tools/color.hxx> +#include "global.hxx" +#include "address.hxx" + +//================================================================== + +struct ScHighlightEntry +{ + ScRange aRef; + Color aColor; + + ScHighlightEntry( const ScRange& rR, const Color& rC ) : + aRef(rR), aColor(rC) {} +}; + +class ScHighlightRanges +{ + List aEntries; + +public: + ScHighlightRanges(); + ~ScHighlightRanges(); + + sal_uLong Count() const { return aEntries.Count(); } + void Insert( ScHighlightEntry* pNew ) { aEntries.Insert(pNew, LIST_APPEND); } + ScHighlightEntry* GetObject( sal_uLong nIndex ) const + { return (ScHighlightEntry*)aEntries.GetObject(nIndex); } +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/imoptdlg.hxx b/sc/source/ui/inc/imoptdlg.hxx new file mode 100644 index 000000000000..016b0e863304 --- /dev/null +++ b/sc/source/ui/inc/imoptdlg.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_IMOPTDLG_HXX +#define SC_IMOPTDLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <vcl/combobox.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/button.hxx> +#include <svx/txencbox.hxx> +#include "scdllapi.h" +#include "global.hxx" + +//=================================================================== + +class SC_DLLPUBLIC ScImportOptions +{ +public: + ScImportOptions() + : nFieldSepCode(0), nTextSepCode(0), + eCharSet(RTL_TEXTENCODING_DONTKNOW), bFixedWidth(false), + bSaveAsShown(false), bQuoteAllText(false) + {} + ScImportOptions( const String& rStr ); + + ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, const String& rStr ) + : nFieldSepCode(nFieldSep), nTextSepCode(nTextSep), aStrFont(rStr), + bFixedWidth(false), bSaveAsShown(false), bQuoteAllText(false) + { eCharSet = ScGlobal::GetCharsetValue(aStrFont); } + + ScImportOptions( sal_Unicode nFieldSep, sal_Unicode nTextSep, rtl_TextEncoding nEnc ) + : nFieldSepCode(nFieldSep), nTextSepCode(nTextSep), + bFixedWidth(false), bSaveAsShown(false), bQuoteAllText(false) + { SetTextEncoding( nEnc ); } + + ScImportOptions( const ScImportOptions& rCpy ) + : nFieldSepCode (rCpy.nFieldSepCode), + nTextSepCode (rCpy.nTextSepCode), + aStrFont (rCpy.aStrFont), + eCharSet (rCpy.eCharSet), + bFixedWidth (rCpy.bFixedWidth), + bSaveAsShown (rCpy.bSaveAsShown), + bQuoteAllText (rCpy.bQuoteAllText) + {} + + ScImportOptions& operator=( const ScImportOptions& rCpy ) + { + nFieldSepCode = rCpy.nFieldSepCode; + nTextSepCode = rCpy.nTextSepCode; + aStrFont = rCpy.aStrFont; + eCharSet = rCpy.eCharSet; + bFixedWidth = rCpy.bFixedWidth; + bSaveAsShown = rCpy.bSaveAsShown; + bQuoteAllText = rCpy.bQuoteAllText; + return *this; + } + + sal_Bool operator==( const ScImportOptions& rCmp ) + { + return + nFieldSepCode == rCmp.nFieldSepCode + && nTextSepCode == rCmp.nTextSepCode + && eCharSet == rCmp.eCharSet + && aStrFont == rCmp.aStrFont + && bFixedWidth == rCmp.bFixedWidth + && bSaveAsShown == rCmp.bSaveAsShown + && bQuoteAllText == rCmp.bQuoteAllText; + } + String BuildString() const; + + void SetTextEncoding( rtl_TextEncoding nEnc ); + + sal_Unicode nFieldSepCode; + sal_Unicode nTextSepCode; + String aStrFont; + CharSet eCharSet; + sal_Bool bFixedWidth; + sal_Bool bSaveAsShown; + sal_Bool bQuoteAllText; +}; + + +#endif // SC_IMOPTDLG_HXX + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx new file mode 100644 index 000000000000..a4c28b1150e7 --- /dev/null +++ b/sc/source/ui/inc/impex.hxx @@ -0,0 +1,195 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_IMPEX_HXX +#define SC_IMPEX_HXX + +#include <osl/endian.h> +#include <sot/exchange.hxx> +#include "global.hxx" +#include "address.hxx" + +class ScDocShell; +class ScDocument; +class SvStream; +class SfxMedium; +class ScAsciiOptions; + +/** + * These options control how multi-line cells are converted during export in + * certain lossy formats (such as csv). + */ +struct ScExportTextOptions +{ + enum NewlineConversion { ToSystem, ToSpace, None }; + ScExportTextOptions( NewlineConversion eNewlineConversion = ToSystem, sal_Unicode cSeparatorConvertTo = 0, bool bAddQuotes = false ) : + meNewlineConversion( eNewlineConversion ), mcSeparatorConvertTo( cSeparatorConvertTo ), mbAddQuotes( bAddQuotes ) {} + + NewlineConversion meNewlineConversion; + sal_Unicode mcSeparatorConvertTo; // Convert separator to this character + bool mbAddQuotes; +}; + +class SC_DLLPUBLIC ScImportExport +{ + ScDocShell* pDocSh; + ScDocument* pDoc; + ScDocument* pUndoDoc; + ScRange aRange; + String aStreamPath; + String aNonConvertibleChars; + sal_uLong nSizeLimit; + sal_Unicode cSep; // Separator + sal_Unicode cStr; // String Delimiter + sal_Bool bFormulas; // Formeln im Text? + sal_Bool bIncludeFiltered; // include filtered rows? (default true) + sal_Bool bAll; // keine Selektion + sal_Bool bSingle; // Einfachselektion + sal_Bool bUndo; // Mit Undo? + sal_Bool bOverflow; // zuviele Zeilen/Spalten + bool mbApi; + ScExportTextOptions mExportTextOptions; + + ScAsciiOptions* pExtOptions; // erweiterte Optionen + + sal_Bool StartPaste(); // Protect-Check, Undo einrichten + void EndPaste(); // Undo/Redo-Aktionen, Repaint + sal_Bool Doc2Text( SvStream& ); + sal_Bool Text2Doc( SvStream& ); + sal_Bool Doc2Sylk( SvStream& ); + sal_Bool Sylk2Doc( SvStream& ); + sal_Bool Doc2HTML( SvStream&, const String& ); + sal_Bool Doc2RTF( SvStream& ); + sal_Bool Doc2Dif( SvStream& ); + sal_Bool Dif2Doc( SvStream& ); + sal_Bool ExtText2Doc( SvStream& ); // mit pExtOptions + sal_Bool RTF2Doc( SvStream&, const String& rBaseURL ); + sal_Bool HTML2Doc( SvStream&, const String& rBaseURL ); + +public: + ScImportExport( ScDocument* ); // Gesamtdokument + ScImportExport( ScDocument*, const String& ); // Bereichs/Zellangabe + ScImportExport( ScDocument*, const ScAddress& ); + ScImportExport( ScDocument*, const ScRange& ); + ~ScImportExport(); + + void SetExtOptions( const ScAsciiOptions& rOpt ); + + sal_Bool IsDoubleRef() const { return sal_Bool( !( bAll || bSingle ) ); } + sal_Bool IsSingleRef() const { return bSingle; } + sal_Bool IsNoRef() const { return bAll; } + sal_Bool IsRef() const { return sal_Bool( !bAll ); } + + const ScRange& GetRange() const { return aRange; } + + sal_Bool IsUndo() const { return bUndo; } + void SetUndo( sal_Bool b ) { bUndo = b; } + + static sal_Bool IsFormatSupported( sal_uLong nFormat ); + static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p, + String& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted ); + static void WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, sal_Bool bZero = false ); + static void WriteUnicodeOrByteEndl( SvStream& rStrm ); + static inline sal_Bool IsEndianSwap( const SvStream& rStrm ); + + //! only if stream is only used in own (!) memory + static inline void SetNoEndianSwap( SvStream& rStrm ); + + sal_Unicode GetSeparator() const { return cSep; } + void SetSeparator( sal_Unicode c ) { cSep = c; } + sal_Unicode GetDelimiter() const { return cStr; } + void SetDelimiter( sal_Unicode c ) { cStr = c; } + sal_Bool IsFormulas() const { return bFormulas; } + void SetFormulas( sal_Bool b ) { bFormulas = b; } + sal_Bool IsIncludeFiltered() const { return bIncludeFiltered; } + void SetIncludeFiltered( sal_Bool b ) { bIncludeFiltered = b; } + + void SetSizeLimit( sal_uLong nNew ) { nSizeLimit = nNew; } // momentan nur fuer Ascii + + void SetStreamPath( const String& rPath ) { aStreamPath = rPath; } + const String& GetStreamPath() const { return aStreamPath; } + + sal_Bool ImportString( const ::rtl::OUString&, sal_uLong=FORMAT_STRING ); + sal_Bool ExportString( ::rtl::OUString&, sal_uLong=FORMAT_STRING ); + sal_Bool ExportByteString( ByteString&, rtl_TextEncoding, sal_uLong=FORMAT_STRING ); + + sal_Bool ImportStream( SvStream&, const String& rBaseURL, sal_uLong=FORMAT_STRING ); + sal_Bool ExportStream( SvStream&, const String& rBaseURL, sal_uLong=FORMAT_STRING ); + + sal_Bool ImportData( const String& rMimeType, + const ::com::sun::star::uno::Any & rValue ); + sal_Bool ExportData( const String& rMimeType, + ::com::sun::star::uno::Any & rValue ); + + sal_Bool IsOverflow() const { return bOverflow; } // nach dem Importieren + + const String& GetNonConvertibleChars() const { return aNonConvertibleChars; } + + bool IsApi() const { return mbApi; } + void SetApi( bool bApi ) { mbApi = bApi; } + const ScExportTextOptions& GetExportTextOptions() { return mExportTextOptions; } + void SetExportTextOptions( const ScExportTextOptions& options ) { mExportTextOptions = options; } +}; + + +inline sal_Bool ScImportExport::IsEndianSwap( const SvStream& rStrm ) +{ +#ifdef OSL_BIGENDIAN + return rStrm.GetNumberFormatInt() != NUMBERFORMAT_INT_BIGENDIAN; +#else + return rStrm.GetNumberFormatInt() != NUMBERFORMAT_INT_LITTLEENDIAN; +#endif +} + +inline void ScImportExport::SetNoEndianSwap( SvStream& rStrm ) +{ +#ifdef OSL_BIGENDIAN + rStrm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); +#else + rStrm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); +#endif +} + + +// Helper class for importing clipboard strings as streams. +class ScImportStringStream : public SvMemoryStream +{ +public: + ScImportStringStream( const ::rtl::OUString rStr ) + : SvMemoryStream( (void*)rStr.getStr(), + rStr.getLength() * sizeof(sal_Unicode), STREAM_READ) + { + SetStreamCharSet( RTL_TEXTENCODING_UNICODE ); + SetEndianSwap( false ); + } +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx new file mode 100644 index 000000000000..76c4daca74cc --- /dev/null +++ b/sc/source/ui/inc/inputhdl.hxx @@ -0,0 +1,304 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_INPUTHDL_HXX +#define SC_INPUTHDL_HXX + +#include "global.hxx" +#include "address.hxx" +#include <tools/fract.hxx> +#include <tools/gen.hxx> +#include <editeng/svxenum.hxx> + +class ScDocument; +class ScTabView; +class ScTabViewShell; +class ScInputWindow; +class ScPatternAttr; +class EditEngine; +class ScEditEngineDefaulter; +class EditView; +class EditTextObject; +class ScInputHdlState; +class TypedScStrCollection; +class ScRangeFindList; +class Timer; +class KeyEvent; +class CommandEvent; + +struct ESelection; + +//======================================================================== +// ScInputHandler +//======================================================================== + +class ScInputHandler +{ +private: + ScInputWindow* pInputWin; + + ScEditEngineDefaulter* pEngine; // editierte Daten in der Tabelle + EditView* pTableView; // aktive EditView dazu + EditView* pTopView; // EditView in der Eingabezeile + + TypedScStrCollection* pColumnData; + TypedScStrCollection* pFormulaData; + TypedScStrCollection* pFormulaDataPara; + Window* pTipVisibleParent; + sal_uLong nTipVisible; + Window* pTipVisibleSecParent; + sal_uLong nTipVisibleSec; + String aManualTip; + String aAutoSearch; + sal_uInt16 nAutoPos; + sal_Bool bUseTab; // Blaettern moeglich + + sal_Bool bTextValid; // Text noch nicht in Edit-Engine + String aCurrentText; + + String aFormText; // fuer Funktions-Autopilot + xub_StrLen nFormSelStart; // Selektion fuer Funktions-Autopilot + xub_StrLen nFormSelEnd; + + sal_uInt16 nAutoPar; // autom.parentheses than can be overwritten + + ScAddress aCursorPos; + ScInputMode eMode; + sal_Bool bModified; + sal_Bool bSelIsRef; + sal_Bool bFormulaMode; + sal_Bool bInRangeUpdate; + sal_Bool bParenthesisShown; + sal_Bool bCreatingFuncView; + sal_Bool bInEnterHandler; + sal_Bool bCommandErrorShown; + sal_Bool bInOwnChange; + + sal_Bool bProtected; + sal_Bool bCellHasPercentFormat; + sal_uLong nValidation; + SvxCellHorJustify eAttrAdjust; + + Fraction aScaleX; // fuer Ref-MapMode + Fraction aScaleY; + + ScTabViewShell* pRefViewSh; + ScTabViewShell* pActiveViewSh; + + const ScPatternAttr* pLastPattern; + SfxItemSet* pEditDefaults; + sal_Bool bLastIsSymbol; + + ScInputHdlState* pLastState; + Timer* pDelayTimer; + + ScRangeFindList* pRangeFindList; + + static sal_Bool bAutoComplete; // aus App-Optionen + static sal_Bool bOptLoaded; + +#ifdef _INPUTHDL_CXX +private: + void UpdateActiveView(); + void SyncViews( EditView* pSourceView = NULL ); + /** + * @param cTyped typed character. If 0, look at existing document content + * for text or number. + * @param bInputActivated true if the cell input mode is activated (via + * F2), false otherwise. + * @return true if the new edit mode has been started. + */ + bool StartTable( sal_Unicode cTyped, bool bFromCommand, bool bInputActivated ); + void RemoveSelection(); + void UpdateFormulaMode(); + void InvalidateAttribs(); + void ImplCreateEditEngine(); + DECL_LINK( DelayTimer, Timer* ); + void GetColData(); + void UseColData(); + void NextAutoEntry( sal_Bool bBack ); + void UpdateAdjust( sal_Unicode cTyped ); + void GetFormulaData(); + void UseFormulaData(); + void NextFormulaEntry( sal_Bool bBack ); + void PasteFunctionData(); + void PasteManualTip(); + EditView* GetFuncEditView(); + void RemoveAdjust(); + void RemoveRangeFinder(); + void DeleteRangeFinder(); + void UpdateParenthesis(); + void UpdateAutoCorrFlag(); + void ResetAutoPar(); + void AutoParAdded(); + sal_Bool CursorAtClosingPar(); + void SkipClosingPar(); + DECL_LINK( ModifyHdl, void* ); + DECL_LINK( ShowHideTipVisibleParentListener, VclWindowEvent* ); + DECL_LINK( ShowHideTipVisibleSecParentListener, VclWindowEvent* ); +#endif + +public: + ScInputHandler(); + virtual ~ScInputHandler(); + + void SetMode( ScInputMode eNewMode ); + sal_Bool IsInputMode() const { return (eMode != SC_INPUT_NONE); } + sal_Bool IsEditMode() const { return (eMode != SC_INPUT_NONE && + eMode != SC_INPUT_TYPE); } + sal_Bool IsTopMode() const { return (eMode == SC_INPUT_TOP); } + + const String& GetEditString(); + const String& GetFormString() const { return aFormText; } + + const ScAddress& GetCursorPos() const { return aCursorPos; } + + sal_Bool GetTextAndFields( ScEditEngineDefaulter& rDestEngine ); + + sal_Bool KeyInput( const KeyEvent& rKEvt, sal_Bool bStartEdit = false ); + void EnterHandler( sal_uInt8 nBlockMode = 0 ); + void CancelHandler(); + void SetReference( const ScRange& rRef, ScDocument* pDoc ); + void AddRefEntry(); + + sal_Bool InputCommand( const CommandEvent& rCEvt, sal_Bool bForce ); + + void InsertFunction( const String& rFuncName, sal_Bool bAddPar = sal_True ); + void ClearText(); + + void InputSelection( EditView* pView ); + void InputChanged( EditView* pView, sal_Bool bFromNotify = false ); + + void ViewShellGone(ScTabViewShell* pViewSh); + void SetRefViewShell(ScTabViewShell* pRefVsh) {pRefViewSh=pRefVsh;} + + void NotifyChange( const ScInputHdlState* pState, sal_Bool bForce = false, + ScTabViewShell* pSourceSh = NULL, + sal_Bool bStopEditing = sal_True); + void UpdateCellAdjust( SvxCellHorJustify eJust ); + + void ResetDelayTimer(); //BugId 54702 + + void HideTip(); + void HideTipBelow(); + void ShowTipCursor(); + void ShowTip( const String& rText ); // am Cursor + void ShowTipBelow( const String& rText ); + + void SetRefScale( const Fraction& rX, const Fraction& rY ); + void UpdateRefDevice(); + + EditView* GetActiveView(); + EditView* GetTableView() { return pTableView; } + EditView* GetTopView() { return pTopView; } + + sal_Bool DataChanging( sal_Unicode cTyped = 0, sal_Bool bFromCommand = false ); + void DataChanged( sal_Bool bFromTopNotify = false ); + + sal_Bool TakesReturn() const { return ( nTipVisible != 0 ); } + + void SetModified() { bModified = sal_True; } + + sal_Bool GetSelIsRef() const { return bSelIsRef; } + void SetSelIsRef(sal_Bool bSet) { bSelIsRef = bSet; } + + void ShowRefFrame(); + + ScRangeFindList* GetRangeFindList() { return pRangeFindList; } + + void UpdateRange( sal_uInt16 nIndex, const ScRange& rNew ); + + // Kommunikation mit Funktionsautopilot + void InputGetSelection ( xub_StrLen& rStart, xub_StrLen& rEnd ); + void InputSetSelection ( xub_StrLen nStart, xub_StrLen nEnd ); + void InputReplaceSelection ( const String& rStr ); + String InputGetFormulaStr (); + + sal_Bool IsFormulaMode() const { return bFormulaMode; } + ScInputWindow* GetInputWindow() { return pInputWin; } + void SetInputWindow( ScInputWindow* pNew ) { pInputWin = pNew; } + void StopInputWinEngine( sal_Bool bAll ); + + sal_Bool IsInEnterHandler() const { return bInEnterHandler; } + sal_Bool IsInOwnChange() const { return bInOwnChange; } + + sal_Bool IsModalMode( SfxObjectShell* pDocSh ); + + void ForgetLastPattern(); + + void UpdateSpellSettings( sal_Bool bFromStartTab = false ); + + void FormulaPreview(); + + Size GetTextSize(); // in 1/100mm + + // eigentlich private, fuer SID_INPUT_SUM public + void InitRangeFinder( const String& rFormula ); + + static void SetAutoComplete(sal_Bool bSet) { bAutoComplete = bSet; } +}; + +//======================================================================== +// ScInputHdlState +//======================================================================== +class ScInputHdlState +{ + friend class ScInputHandler; + +public: + ScInputHdlState( const ScAddress& rCurPos, + const ScAddress& rStartPos, + const ScAddress& rEndPos, + const String& rString, + const EditTextObject* pData ); + ScInputHdlState( const ScInputHdlState& rCpy ); + ~ScInputHdlState(); + + ScInputHdlState& operator= ( const ScInputHdlState& r ); + int operator==( const ScInputHdlState& r ) const; + int operator!=( const ScInputHdlState& r ) const + { return !operator==( r ); } + + const ScAddress& GetPos() const { return aCursorPos; } + const ScAddress& GetStartPos() const { return aStartPos; } + const ScAddress& GetEndPos() const { return aEndPos; } + const String& GetString() const { return aString; } + const EditTextObject* GetEditData() const { return pEditData; } + +private: + ScAddress aCursorPos; + ScAddress aStartPos; + ScAddress aEndPos; + String aString; + EditTextObject* pEditData; +}; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx new file mode 100644 index 000000000000..27bc405f24c5 --- /dev/null +++ b/sc/source/ui/inc/inputwin.hxx @@ -0,0 +1,228 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_INPUTWIN_HXX +#define SC_INPUTWIN_HXX + +#include <vector> +#include <vcl/toolbox.hxx> +#include <sfx2/childwin.hxx> +#include <svl/lstner.hxx> +#include <vcl/combobox.hxx> +#include <vcl/window.hxx> +#include <svtools/transfer.hxx> + +class ScEditEngineDefaulter; +class EditView; +struct ESelection; +class ScInputHandler; +class ScAccessibleEditLineTextData; +struct EENotify; +class ScRangeList; + +//======================================================================== + +class ScTextWnd : public Window, public DragSourceHelper // edit window +{ +public: + ScTextWnd( Window* pParent ); + virtual ~ScTextWnd(); + + void SetTextString( const String& rString ); + const String& GetTextString() const; + + sal_Bool IsInputActive(); + EditView* GetEditView(); + + // fuer FunktionsAutopiloten + void MakeDialogEditView(); + + void StartEditEngine(); + void StopEditEngine( sal_Bool bAll ); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + + void SetFormulaMode( sal_Bool bSet ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + void InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData ); + void RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData ); + + DECL_LINK( NotifyHdl, EENotify* ); + +protected: + virtual void Paint( const Rectangle& rRec ); + virtual void Resize(); + + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void Command( const CommandEvent& rCEvt ); + virtual void KeyInput(const KeyEvent& rKEvt); + virtual void GetFocus(); + virtual void LoseFocus(); + + virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); + + virtual String GetText() const; + +private: + void ImplInitSettings(); + void UpdateAutoCorrFlag(); + +private: + typedef ::std::vector< ScAccessibleEditLineTextData* > AccTextDataVector; + + String aString; + Font aTextFont; + ScEditEngineDefaulter* pEditEngine; // erst bei Bedarf angelegt + EditView* pEditView; + AccTextDataVector maAccTextDatas; // #i105267# text datas may be cloned, remember all copies + sal_Bool bIsRTL; + sal_Bool bIsInsertMode; + sal_Bool bFormulaMode; + + // #102710#; this flag should be true if a key input or a command is handled + // it prevents the call of InputChanged in the ModifyHandler of the EditEngine + sal_Bool bInputMode; +}; + +//======================================================================== + +class ScPosWnd : public ComboBox, public SfxListener // Positionsanzeige +{ +private: + String aPosStr; + Accelerator* pAccel; + sal_uLong nTipVisible; + sal_Bool bFormulaMode; + sal_Bool bTopHadFocus; + +public: + ScPosWnd( Window* pParent ); + virtual ~ScPosWnd(); + + void SetPos( const String& rPosStr ); // angezeigter Text + void SetFormulaMode( sal_Bool bSet ); + +protected: + virtual void Select(); + virtual void Modify(); + + virtual long Notify( NotifyEvent& rNEvt ); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + +private: + void FillRangeNames(); + void FillFunctions(); + void DoEnter(); + void HideTip(); + + void ReleaseFocus_Impl(); +}; + +//======================================================================== + +class ScInputWindow : public ToolBox // Parent-Toolbox +{ +public: + ScInputWindow( Window* pParent, SfxBindings* pBind ); + virtual ~ScInputWindow(); + + virtual void Resize(); + virtual void Select(); + + void SetFuncString( const String& rString, sal_Bool bDoEdit = sal_True ); + void SetPosString( const String& rStr ); + void SetTextString( const String& rString ); + + void SetOkCancelMode(); + void SetSumAssignMode(); + void EnableButtons( sal_Bool bEnable = sal_True ); + + void SetFormulaMode( sal_Bool bSet ); + + sal_Bool IsInputActive(); + EditView* GetEditView(); + + void TextGrabFocus(); + void TextInvalidate(); + void SwitchToTextWin(); + + void PosGrabFocus(); + + // Fuer FunktionsAutopiloten + void MakeDialogEditView(); + + void StopEditEngine( sal_Bool bAll ); + + void SetInputHandler( ScInputHandler* pNew ); + + ScInputHandler* GetInputHandler(){ return pInputHdl;} + + void StateChanged( StateChangedType nType ); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + + +protected: + virtual void SetText( const String& rString ); + virtual String GetText() const; + + sal_Bool UseSubTotal( ScRangeList* pRangeList ) const; + +private: + ScPosWnd aWndPos; + ScTextWnd aTextWindow; + ScInputHandler* pInputHdl; + SfxBindings* pBindings; + String aTextOk; + String aTextCancel; + String aTextSum; + String aTextEqual; + sal_Bool bIsOkCancelMode; +}; + +//================================================================== + +class ScInputWindowWrapper : public SfxChildWindow +{ +public: + ScInputWindowWrapper( Window* pParent, + sal_uInt16 nId, + SfxBindings* pBindings, + SfxChildWinInfo* pInfo ); + + SFX_DECL_CHILDWINDOW(ScInputWindowWrapper); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/inscldlg.hxx b/sc/source/ui/inc/inscldlg.hxx new file mode 100644 index 000000000000..41608bccdf83 --- /dev/null +++ b/sc/source/ui/inc/inscldlg.hxx @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_INSCLDLG_HXX +#define SC_INSCLDLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> + + +#include "global.hxx" + +//------------------------------------------------------------------------ + +class ScInsertCellDlg : public ModalDialog +{ +private: + FixedLine aFlFrame; + RadioButton aBtnCellsDown; + RadioButton aBtnCellsRight; + RadioButton aBtnInsRows; + RadioButton aBtnInsCols; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + +public: + ScInsertCellDlg( Window* pParent,sal_Bool bDisallowCellMove = false ); + ~ScInsertCellDlg(); + + InsCellCmd GetInsCellCmd() const; +}; + + +#endif // SC_INSCLDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/inscodlg.hxx b/sc/source/ui/inc/inscodlg.hxx new file mode 100644 index 000000000000..0b893ed0f7cc --- /dev/null +++ b/sc/source/ui/inc/inscodlg.hxx @@ -0,0 +1,118 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_INSCODLG_HXX +#define SC_INSCODLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include "global.hxx" + +//------------------------------------------------------------------------ +#include "scui_def.hxx" + +class ScInsertContentsDlg : public ModalDialog +{ +public: + ScInsertContentsDlg( Window* pParent, + sal_uInt16 nCheckDefaults = 0, + const String* pStrTitle = NULL ); + ~ScInsertContentsDlg(); + + sal_uInt16 GetInsContentsCmdBits() const; + sal_uInt16 GetFormulaCmdBits() const; + sal_Bool IsSkipEmptyCells() const {return aBtnSkipEmptyCells.IsChecked();} + sal_Bool IsTranspose() const {return aBtnTranspose.IsChecked();} + sal_Bool IsLink() const {return aBtnLink.IsChecked();} + InsCellCmd GetMoveMode(); + + void SetOtherDoc( sal_Bool bSet ); + void SetFillMode( sal_Bool bSet ); + void SetChangeTrack( sal_Bool bSet ); + void SetCellShiftDisabled( int nDisable ); + +private: + FixedLine aFlFrame; + CheckBox aBtnInsAll; + CheckBox aBtnInsStrings; + CheckBox aBtnInsNumbers; + CheckBox aBtnInsDateTime; + CheckBox aBtnInsFormulas; + CheckBox aBtnInsNotes; + CheckBox aBtnInsAttrs; + CheckBox aBtnInsObjects; + + FixedLine aFlSep1; + FixedLine aFlOptions; + CheckBox aBtnSkipEmptyCells; + CheckBox aBtnTranspose; + CheckBox aBtnLink; + + FixedLine aFlOperation; + RadioButton aRbNoOp; + RadioButton aRbAdd; + RadioButton aRbSub; + RadioButton aRbMul; + RadioButton aRbDiv; + + FixedLine aFlSep2; + FixedLine aFlMove; + RadioButton aRbMoveNone; + RadioButton aRbMoveDown; + RadioButton aRbMoveRight; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + sal_Bool bOtherDoc; + sal_Bool bFillMode; + sal_Bool bChangeTrack; + sal_Bool bMoveDownDisabled; + sal_Bool bMoveRightDisabled; + + static sal_Bool bPreviousAllCheck; + static sal_uInt16 nPreviousChecks; + static sal_uInt16 nPreviousChecks2; + static sal_uInt16 nPreviousFormulaChecks; + static sal_uInt16 nPreviousMoveMode; // enum InsCellCmd + + void DisableChecks( sal_Bool bInsAllChecked = sal_True ); + void TestModes(); + + // Handler + DECL_LINK( InsAllHdl, void* ); + DECL_LINK( LinkBtnHdl, void* ); +}; + + +#endif // SC_INSCODLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/instbdlg.hrc b/sc/source/ui/inc/instbdlg.hrc new file mode 100644 index 000000000000..dbe7e98e342a --- /dev/null +++ b/sc/source/ui/inc/instbdlg.hrc @@ -0,0 +1,48 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <sc.hrc> // -> RID_SCDLG_INSERT_TABLE + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 3 + +#define FL_POSITION 10 +#define RB_BEFORE 11 +#define RB_BEHIND 12 + +#define FL_TABLE 20 +#define RB_NEW 21 +#define FT_COUNT 22 +#define NF_COUNT 23 +#define FT_NAME 24 +#define ED_TABNAME 25 +#define RB_FROMFILE 26 +#define LB_TABLES 27 +#define BTN_BROWSE 28 +#define CB_LINK 29 +#define FT_PATH 30 diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx new file mode 100644 index 000000000000..718e6d107b9b --- /dev/null +++ b/sc/source/ui/inc/instbdlg.hxx @@ -0,0 +1,126 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_INSTBDLG_HXX +#define SC_INSTBDLG_HXX + +#include "address.hxx" + +#include <vcl/button.hxx> +#include <vcl/group.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/edit.hxx> +#include <vcl/fixed.hxx> +#include <vcl/dialog.hxx> + +#include <sfx2/objsh.hxx> +#include <vcl/field.hxx> +#include "expftext.hxx" + +#include <layout/layout.hxx> +#include <layout/layout-pre.hxx> + +class ScViewData; +class ScDocument; +class ScDocShell; + +namespace sfx2 { class DocumentInserter; } +namespace sfx2 { class FileDialogHelper; } + +//------------------------------------------------------------------------ + +class ScInsertTableDlg : public ModalDialog +{ +public: + ScInsertTableDlg( Window* pParent, ScViewData& rViewData, SCTAB nTabCount, bool bFromFile ); + ~ScInsertTableDlg(); + + virtual short Execute(); // ueberladen, um Dialog-Parent zu setzen + + sal_Bool GetTablesFromFile() { return aBtnFromFile.IsChecked(); } + sal_Bool GetTablesAsLink() { return aBtnLink.IsChecked(); } + + const String* GetFirstTable( sal_uInt16* pN = NULL ); + const String* GetNextTable( sal_uInt16* pN = NULL ); + ScDocShell* GetDocShellTables() { return pDocShTables; } + sal_Bool IsTableBefore() { return aBtnBefore.IsChecked(); } + SCTAB GetTableCount() { return nTableCount;} + +private: + FixedLine aFlPos; + RadioButton aBtnBefore; + RadioButton aBtnBehind; + FixedLine aFlTable; + RadioButton aBtnNew; + RadioButton aBtnFromFile; + FixedText aFtCount; + NumericField aNfCount; + FixedText aFtName; + Edit aEdName; + MultiListBox aLbTables; + ScExpandedFixedText aFtPath; + PushButton aBtnBrowse; + CheckBox aBtnLink; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + Timer aBrowseTimer; + ScViewData& rViewData; + ScDocument& rDoc; + ScDocShell* pDocShTables; + sfx2::DocumentInserter* pDocInserter; + SfxObjectShellRef aDocShTablesRef; + + bool bMustClose; + sal_uInt16 nSelTabIndex; // fuer GetFirstTable() / GetNextTable() + String aStrCurSelTable; + SCTAB nTableCount; + +#ifdef SC_INSTBDLG_CXX + void Init_Impl( bool bFromFile ); + void SetNewTable_Impl(); + void SetFromTo_Impl(); + void FillTables_Impl( ScDocument* pSrcDoc ); + void DoEnable_Impl(); + + DECL_LINK( BrowseHdl_Impl, PushButton* ); + DECL_LINK( ChoiceHdl_Impl, RadioButton* ); + DECL_LINK( SelectHdl_Impl, MultiListBox* ); + DECL_LINK( CountHdl_Impl, NumericField* ); + DECL_LINK( DoEnterHdl, PushButton* ); + DECL_LINK( BrowseTimeoutHdl, Timer* ); + DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* ); +#endif +}; + +#include <layout/layout-post.hxx> + +#endif // SC_INSTBDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/invmerge.hxx b/sc/source/ui/inc/invmerge.hxx new file mode 100644 index 000000000000..ebe03a91988f --- /dev/null +++ b/sc/source/ui/inc/invmerge.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_INVMERGE_HXX +#define SC_INVMERGE_HXX + +#include <tools/gen.hxx> + +#include <vector> + +class Window; + +class ScInvertMerger +{ +private: + Window* pWin; + ::std::vector< Rectangle >* pRects; + Rectangle aTotalRect; + Rectangle aLineRect; + + void FlushLine(); + void FlushTotal(); + +public: + ScInvertMerger( Window* pWindow ); + ScInvertMerger( ::std::vector< Rectangle >* pRectangles ); + ~ScInvertMerger(); + + void AddRect( const Rectangle& rRect ); + void Flush(); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/lbseldlg.hxx b/sc/source/ui/inc/lbseldlg.hxx new file mode 100644 index 000000000000..2f1c50828324 --- /dev/null +++ b/sc/source/ui/inc/lbseldlg.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_LBSELDLG_HXX +#define SC_LBSELDLG_HXX + + +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> + +#include <vcl/button.hxx> + + +#include <vcl/dialog.hxx> + +//------------------------------------------------------------------------ + +class ScSelEntryDlg : public ModalDialog +{ +private: + FixedLine aFlLbTitle; + ListBox aLb; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + DECL_LINK( DblClkHdl, void * ); + +public: + ScSelEntryDlg( Window* pParent, + sal_uInt16 nResId, + const String& aTitle, + const String& aLbTitle, + List& aEntryList ); + ~ScSelEntryDlg(); + + String GetSelectEntry() const; +}; + + +#endif // SC_LBSELDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/linkarea.hrc b/sc/source/ui/inc/linkarea.hrc new file mode 100644 index 000000000000..401739474acb --- /dev/null +++ b/sc/source/ui/inc/linkarea.hrc @@ -0,0 +1,41 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <sc.hrc> + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 3 +#define FL_LOCATION 4 +#define CB_URL 5 +#define BTN_BROWSE 6 +#define FT_HINT 7 +#define FT_RANGES 8 +#define LB_RANGES 9 +#define BTN_RELOAD 10 +#define NF_DELAY 11 +#define FT_SECONDS 12 diff --git a/sc/source/ui/inc/linkarea.hxx b/sc/source/ui/inc/linkarea.hxx new file mode 100644 index 000000000000..2a5ab6a18ccb --- /dev/null +++ b/sc/source/ui/inc/linkarea.hxx @@ -0,0 +1,101 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_LINKAREA_HXX +#define SC_LINKAREA_HXX + +#include <com/sun/star/embed/XEmbeddedObject.hpp> +#include <vcl/dialog.hxx> + +#include <vcl/button.hxx> +#include <vcl/field.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <svtools/stdctrl.hxx> +#include <svtools/inettbc.hxx> + +namespace sfx2 { class DocumentInserter; } +namespace sfx2 { class FileDialogHelper; } + +class ScDocShell; + +//------------------------------------------------------------------------ + +class ScLinkedAreaDlg : public ModalDialog +{ +private: + FixedLine aFlLocation; + SvtURLBox aCbUrl; + PushButton aBtnBrowse; + FixedInfo aTxtHint; + FixedText aFtRanges; + MultiListBox aLbRanges; + CheckBox aBtnReload; + NumericField aNfDelay; + FixedText aFtSeconds; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + ScDocShell* pSourceShell; + sfx2::DocumentInserter* pDocInserter; + + SfxObjectShellRef aSourceRef; + ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject > xSourceObject; + + DECL_LINK( FileHdl, ComboBox* ); + DECL_LINK( BrowseHdl, PushButton* ); + DECL_LINK( RangeHdl, MultiListBox* ); + DECL_LINK( ReloadHdl, CheckBox* ); + DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* ); + + void UpdateSourceRanges(); + void UpdateEnable(); + void LoadDocument( const String& rFile, const String& rFilter, + const String& rOptions ); + +public: + ScLinkedAreaDlg( Window* pParent ); + ~ScLinkedAreaDlg(); + + void InitFromOldLink( const String& rFile, const String& rFilter, + const String& rOptions, const String& rSource, + sal_uLong nRefresh ); + + virtual short Execute(); // overwritten to set dialog parent + + String GetURL(); + String GetFilter(); // may be empty + String GetOptions(); // filter options + String GetSource(); // separated by ";" + sal_uLong GetRefresh(); // 0 if disabled +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/lnktrans.hxx b/sc/source/ui/inc/lnktrans.hxx new file mode 100644 index 000000000000..23b89f0d2d41 --- /dev/null +++ b/sc/source/ui/inc/lnktrans.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_LNKTRANS_HXX +#define SC_LNKTRANS_HXX + +#include <svtools/transfer.hxx> + + +class ScLinkTransferObj : public TransferableHelper +{ +private: + String aLinkURL; + String aLinkText; + +public: + ScLinkTransferObj(); + virtual ~ScLinkTransferObj(); + + void SetLinkURL( const String& rURL, const String& rText ); + + virtual void AddSupportedFormats(); + virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + virtual void ObjectReleased(); + virtual void DragFinished( sal_Int8 nDropAction ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/mediash.hxx b/sc/source/ui/inc/mediash.hxx new file mode 100644 index 000000000000..58fccaae74f2 --- /dev/null +++ b/sc/source/ui/inc/mediash.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef MEDIASH_HXX +#define MEDIASH_HXX + +#include <sfx2/shell.hxx> +#include "shellids.hxx" +#include <sfx2/module.hxx> +#include <svx/svdmark.hxx> + +class ScViewData; + +#include "drawsh.hxx" + +class ScMediaShell: public ScDrawShell +{ +public: + + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_MEDIA_SHELL) + + ScMediaShell(ScViewData* pData); + virtual ~ScMediaShell(); + + void ExecuteMedia(SfxRequest& rReq); + void GetMediaState(SfxItemSet &rSet); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/miscdlgs.hrc b/sc/source/ui/inc/miscdlgs.hrc new file mode 100644 index 000000000000..3f1faa5492aa --- /dev/null +++ b/sc/source/ui/inc/miscdlgs.hrc @@ -0,0 +1,183 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // -> RID_SCDLG_DELCELL + // -> RID_SCDLG_INSCELL + // -> RID_SCDLG_DELCONT + // -> RID_SCDLG_INSCONT + // -> RID_SCDLG_MOVETAB + // -> RID_SCDLG_STRINPUT + // -> RID_SCDLG_MTRINPUT + // -> RID_SCDLG_SELENTRY + // -> RID_SCDLG_FILLSERIES + // -> RID_SCDLG_AUTOFORMAT + +// allgemein +#define BTN_OK 100 +#define BTN_CANCEL 102 +#define BTN_HELP 103 +#define BTN_MORE 104 +#define BTN_ADD 105 +#define BTN_REMOVE 106 +#define FT_LABEL 110 +#define FL_FRAME 112 +#define STR_BTN_CLOSE 200 + +// Zellen loeschen/einfuegen Dialog +#define BTN_CELLSUP 10 +#define BTN_CELLSDOWN 11 +#define BTN_CELLSRIGHT 12 +#define BTN_CELLSLEFT 13 +#define BTN_DELROWS 14 +#define BTN_DELCOLS 15 +#define BTN_INSROWS 16 +#define BTN_INSCOLS 17 + +// Inhalte loeschen/einfuegen Dialog +#define BTN_DELALL 10 +#define BTN_DELSTRINGS 11 +#define BTN_DELNUMBERS 12 +#define BTN_DELDATETIME 13 +#define BTN_DELFORMULAS 14 +#define BTN_DELATTRS 15 +#define BTN_DELNOTES 16 +#define BTN_DELOBJECTS 17 +#define BTN_INSALL 20 +#define BTN_INSSTRINGS 21 +#define BTN_INSNUMBERS 22 +#define BTN_INSDATETIME 23 +#define BTN_INSFORMULAS 24 +#define BTN_INSATTRS 25 +#define BTN_INSNOTES 26 +#define BTN_OP_NOOP 27 +#define BTN_OP_ADD 28 +#define BTN_OP_SUB 29 +#define BTN_OP_MUL 30 +#define BTN_OP_DIV 31 +#define FL_OPERATION 32 +#define BTN_SKIP_EMPTY 33 +#define BTN_TRANSPOSE 34 +#define BTN_LINK 35 +#define FL_OPTIONS 36 +#define BTN_MV_NONE 37 +#define BTN_MV_DOWN 38 +#define BTN_MV_RIGHT 39 +#define FL_MOVE 40 +#define BTN_INSOBJECTS 41 +#define FL_SEP1 51 +#define FL_SEP2 52 + +// Tabelle einfuegen/loeschen +#define FT_DEST 1 +#define LB_DEST 2 +#define FT_INSERT 3 +#define LB_INSERT 4 +#define BTN_COPY 5 +#define STR_NEWDOC 6 +#define BTN_MOVE 7 +#define FL_ACTION 8 +#define FL_LOCATION 9 +#define FL_NAME 11 +#define FT_TABNAME 12 +#define FT_TABNAME_WARN 13 +#define STR_CURRENTDOC 14 +#define STR_TABNAME_WARN_USED 15 +#define STR_TABNAME_WARN_EMPTY 16 +#define STR_TABNAME_WARN_INVALID 17 + +// Eingabe eines Strings +#define ED_INPUT 10 + +// Eingabe einer Metrik +#define ED_VALUE 1 +#define BTN_DEFVAL 1 + +// Auswahl aus einer (String-)ListBox +#define FL_ENTRYLIST 10 +#define LB_ENTRYLIST 11 + +// Reihen fuellen +#define FL_DIRECTION 1 +#define BTN_LEFT 2 +#define BTN_RIGHT 3 +#define BTN_TOP 4 +#define BTN_BOTTOM 5 +#define FL_SEP11 10 +#define FL_TYPE 11 +#define BTN_ARITHMETIC 12 +#define BTN_GEOMETRIC 13 +#define BTN_DATE 14 +#define BTN_AUTOFILL 15 +#define FL_SEP12 20 +#define FL_TIME_UNIT 21 +#define BTN_DAY 22 +#define BTN_DAY_OF_WEEK 23 +#define BTN_MONTH 24 +#define BTN_YEAR 25 +#define FT_INCREMENT 30 +#define ED_INCREMENT 39 +#define FT_END_VALUE 40 +#define ED_END_VALUES 49 +#define STR_VALERR 50 +#define FT_START_VALUE 51 +#define ED_START_VALUES 52 + +// Autoformat +#define LB_FORMAT 1 +#define FL_FORMAT 9 +#define WND_PREVIEW 19 +#define BTN_NUMFORMAT 20 +#define BTN_BORDER 21 +#define BTN_FONT 23 +#define BTN_PATTERN 24 +#define BTN_ALIGNMENT 25 +#define BTN_ADJUST 26 +#define BTN_RENAME 27 +#define FL_FORMATTING 29 +#define STR_ADD_TITLE 100 +#define STR_ADD_LABEL 101 +#define STR_DEL_TITLE 102 +#define STR_DEL_MSG 103 +#define STR_RENAME_TITLE 104 + // Autoformat-Preview: +#define STR_JAN 121 +#define STR_FEB 122 +#define STR_MAR 123 +#define STR_NORTH 124 +#define STR_MID 125 +#define STR_SOUTH 126 +#define STR_SUM 127 + +// Gruppierung setzen/aufheben: +#define BTN_GROUP_COLS 1 +#define BTN_GROUP_ROWS 3 +#define STR_GROUP 1 +#define STR_UNGROUP 2 + +// Tab Bg Color +#define TAB_BG_COLOR_CT_BORDER 1 +#define TAB_BG_COLOR_SET_BGDCOLOR 2 diff --git a/sc/source/ui/inc/msgpool.hxx b/sc/source/ui/inc/msgpool.hxx new file mode 100644 index 000000000000..25f182e74872 --- /dev/null +++ b/sc/source/ui/inc/msgpool.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_MSGPOOL_HXX +#define SC_MSGPOOL_HXX + +#include "scitems.hxx" +#include <svl/srchitem.hxx> + + +#include <svl/itempool.hxx> +#include <svl/stritem.hxx> +#include <svl/eitem.hxx> + +#include "uiitems.hxx" + + +//------------------------------------------------------------------------ + +class ScDocumentPool; + +//------------------------------------------------------------------------ + +class ScMessagePool: public SfxItemPool +{ + SfxStringItem aGlobalStringItem; + SvxSearchItem aGlobalSearchItem; + ScSortItem aGlobalSortItem; + ScQueryItem aGlobalQueryItem; + ScSubTotalItem aGlobalSubTotalItem; + ScConsolidateItem aGlobalConsolidateItem; + ScPivotItem aGlobalPivotItem; + ScSolveItem aGlobalSolveItem; + ScUserListItem aGlobalUserListItem; + + SfxBoolItem aPrintWarnItem; + + SfxPoolItem** ppPoolDefaults; + ScDocumentPool* pDocPool; + +public: + ScMessagePool(); +protected: + virtual ~ScMessagePool(); +public: + + virtual SfxMapUnit GetMetric( sal_uInt16 nWhich ) const; +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/mtrindlg.hxx b/sc/source/ui/inc/mtrindlg.hxx new file mode 100644 index 000000000000..c6e0e1b117e2 --- /dev/null +++ b/sc/source/ui/inc/mtrindlg.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_MTRINDLG_HXX +#define SC_MTRINDLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/field.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> + + +//------------------------------------------------------------------------ + +class ScMetricInputDlg : public ModalDialog +{ +public: + ScMetricInputDlg( Window* pParent, + sal_uInt16 nResId, // Ableitung fuer jeden Dialog! + long nCurrent, + long nDefault, + FieldUnit eFUnit = FUNIT_MM, + sal_uInt16 nDecimals = 2, + long nMaximum = 1000, + long nMinimum = 0, + long nFirst = 1, + long nLast = 100 ); + ~ScMetricInputDlg(); + + long GetInputValue( FieldUnit eUnit = FUNIT_TWIP ) const; + +private: + FixedText aFtEditTitle; + MetricField aEdValue; + CheckBox aBtnDefVal; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + long nDefaultValue; + long nCurrentValue; + + void CalcPositions(); + DECL_LINK( SetDefValHdl, CheckBox * ); + DECL_LINK( ModifyHdl, MetricField * ); +}; + +#endif // SC_MTRINDLG_HXX + + + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx new file mode 100644 index 000000000000..d563650fca05 --- /dev/null +++ b/sc/source/ui/inc/mvtabdlg.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_MVTABDLG_HXX +#define SC_MVTABDLG_HXX + + +#include "address.hxx" +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> + +#include <layout/layout.hxx> +#include <layout/layout-pre.hxx> + +//------------------------------------------------------------------------ + +class ScMoveTableDlg : public ModalDialog +{ +public: + ScMoveTableDlg( Window* pParent, const String& rDefault ); + ~ScMoveTableDlg(); + + sal_uInt16 GetSelectedDocument () const; + SCTAB GetSelectedTable () const; + bool GetCopyTable () const; + bool GetRenameTable () const; + void GetTabNameString( String& rString ) const; + void SetForceCopyTable (); + void EnableCopyTable (sal_Bool bFlag=true); + void EnableRenameTable (sal_Bool bFlag=true); + +private: + void ResetRenameInput(); + void CheckNewTabName(); + ScDocument* GetSelectedDoc(); + +private: + FixedLine aFlAction; + RadioButton aBtnMove; + RadioButton aBtnCopy; + FixedLine aFlLocation; + FixedText aFtDoc; + ListBox aLbDoc; + FixedText aFtTable; + ListBox aLbTable; + FixedLine aFlName; + FixedText aFtTabName; + Edit aEdTabName; + FixedText aFtWarn; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + String maStrTabNameUsed; + String maStrTabNameEmpty; + String maStrTabNameInvalid; + + const String& mrDefaultName; + + sal_uInt16 nDocument; + SCTAB nTable; + bool bCopyTable:1; + bool bRenameTable:1; + bool mbEverEdited:1; + + //-------------------------------------- + void Init (); + void InitBtnRename (); + void InitDocListBox (); + DECL_LINK( OkHdl, void * ); + DECL_LINK( SelHdl, ListBox * ); + DECL_LINK( CheckBtnHdl, void * ); + DECL_LINK( CheckNameHdl, Edit * ); +}; + +#include <layout/layout-post.hxx> + +#endif // SC_MVTABDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/namecrea.hxx b/sc/source/ui/inc/namecrea.hxx new file mode 100644 index 000000000000..1f494d685cb3 --- /dev/null +++ b/sc/source/ui/inc/namecrea.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_NAMECREA_HXX +#define SC_NAMECREA_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include "scui_def.hxx" + +class ScNameCreateDlg : public ModalDialog +{ +protected: + FixedLine aFixedLine; + CheckBox aTopBox; + CheckBox aLeftBox; + CheckBox aBottomBox; + CheckBox aRightBox; + OKButton aOKButton; + CancelButton aCancelButton; + HelpButton aHelpButton; +public: + ScNameCreateDlg( Window * pParent, sal_uInt16 nFlags ); + + sal_uInt16 GetFlags() const; +}; + + +#endif //SC_NAMECREA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/namedlg.hrc b/sc/source/ui/inc/namedlg.hrc new file mode 100644 index 000000000000..1968d1d5fa74 --- /dev/null +++ b/sc/source/ui/inc/namedlg.hrc @@ -0,0 +1,54 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // -> RID_SCDLG_NAMES + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_ADD 3 +#define BTN_REMOVE 4 +#define BTN_HELP 5 +#define BTN_MORE 6 + +#define FT_SCOPE 7 +#define LB_SCOPE 8 +#define FL_NAME 11 +#define ED_NAME 12 +#define FL_ASSIGN 13 +#define ED_ASSIGN 15 +#define RB_ASSIGN 16 + +#define STR_ADD 21 +#define STR_MODIFY 22 +#define STR_INVALIDSYMBOL 23 +#define STR_GLOBAL_SCOPE 24 + +#define BTN_CRITERIA 31 +#define BTN_PRINTAREA 32 +#define BTN_COLHEADER 33 +#define BTN_ROWHEADER 34 +#define FL_TYPE 35 diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx new file mode 100644 index 000000000000..31a04834935d --- /dev/null +++ b/sc/source/ui/inc/namedlg.hxx @@ -0,0 +1,137 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_NAMEDLG_HXX +#define SC_NAMEDLG_HXX + +#include <vcl/morebtn.hxx> +#include <vcl/combobox.hxx> +#include <vcl/group.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include "rangenam.hxx" +#include "anyrefdg.hxx" + +#include <boost/ptr_container/ptr_map.hpp> + +class ScViewData; +class ScDocument; +struct ScNameDlgImpl; + +//================================================================== + +class ScNameDlg : public ScAnyRefDlg +{ +private: + typedef ::boost::ptr_map<SCTAB, ScRangeName> TabNameMapType; + FixedText maFtScope; + ListBox maLbScope; + FixedLine aFlName; + ComboBox aEdName; + + FixedLine aFlAssign; + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; + + FixedLine aFlType; + CheckBox aBtnPrintArea; + CheckBox aBtnColHeader; + CheckBox aBtnCriteria; + CheckBox aBtnRowHeader; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + PushButton aBtnAdd; + PushButton aBtnRemove; + MoreButton aBtnMore; + sal_Bool bSaved; + + const String aStrAdd; // "Hinzufuegen" + const String aStrModify; // "Aendern" + const String errMsgInvalidSym; + const ::rtl::OUString maGlobalNameStr; + + ScViewData* pViewData; + ScDocument* pDoc; + ScRangeName maGlobalRangeName; + ScRangeName::TabNameMap maTabRangeNames; + ScRangeName* mpCurRangeName; //! range name set currently selected + const ScAddress theCursorPos; + Selection theCurSel; + + ScNameDlgImpl* mpImpl; + +private: + void Init(); + void UpdateChecks(); + void UpdateNames(); + void CalcCurTableAssign( String& aAssign, ScRangeData* pRangeData ); + + void SaveControlStates(); + void RestoreControlStates(); + + bool AddPushed(); + void RemovePushed(); + void OKPushed(); + void NameSelected(); + void ScopeChanged(); + void NameModified(Edit* pEd); + + // Handler: + DECL_LINK( OkBtnHdl, void * ); + DECL_LINK( CancelBtnHdl, void * ); + DECL_LINK( AddBtnHdl, void * ); + DECL_LINK( RemoveBtnHdl, void * ); + DECL_LINK( EdModifyHdl, Edit * ); + DECL_LINK( NameSelectHdl, void * ); + DECL_LINK( AssignGetFocusHdl, void * ); + DECL_LINK( ScopeChangedHdl, ListBox* ); + +protected: + virtual void RefInputDone( sal_Bool bForced = sal_False ); + +public: + ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScViewData* ptrViewData, + const ScAddress& aCursorPos ); + ~ScNameDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + virtual sal_Bool IsRefInputMode() const; + + virtual void SetActive(); + virtual sal_Bool Close(); + +}; + + + +#endif // SC_NAMEDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx new file mode 100644 index 000000000000..c90c20904ffe --- /dev/null +++ b/sc/source/ui/inc/namepast.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_NAMEPAST_HXX +#define SC_NAMEPAST_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> + +#include "scui_def.hxx" +class ScRangeName; + +class ScNamePasteDlg : public ModalDialog +{ + DECL_LINK( ButtonHdl, Button * ); + DECL_LINK( ListSelHdl, ListBox * ); + DECL_LINK( ListDblClickHdl, ListBox * ); + +protected: + FixedText aLabelText; + ListBox aNameList; + OKButton aOKButton; + CancelButton aCancelButton; + HelpButton aHelpButton; + PushButton aInsListButton; +public: + ScNamePasteDlg( Window * pParent, const ScRangeName* pList, sal_Bool bInsList=sal_True ); + + String GetSelectedName() const; +}; + + +#endif //SC_NAMEPAST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/navcitem.hxx b/sc/source/ui/inc/navcitem.hxx new file mode 100644 index 000000000000..7f03633061d2 --- /dev/null +++ b/sc/source/ui/inc/navcitem.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_NAVCITEM_HXX +#define SC_NAVCITEM_HXX + + +#include <sfx2/ctrlitem.hxx> + + +//================================================================== + +class ScNavigatorDlg; + +class ScNavigatorControllerItem : public SfxControllerItem +{ +public: + ScNavigatorControllerItem( sal_uInt16 nId, + ScNavigatorDlg& rDlg, + SfxBindings& rBindings ); +protected: + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, + const SfxPoolItem* pItem ); + +private: + ScNavigatorDlg& rNavigatorDlg; +}; + + +#endif // SC_NAVCITEM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx new file mode 100644 index 000000000000..1e5fa665ad1b --- /dev/null +++ b/sc/source/ui/inc/navipi.hxx @@ -0,0 +1,367 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_NAVIPI_HXX +#define SC_NAVIPI_HXX + +#include <vector> +#include <vcl/toolbox.hxx> +#include <vcl/field.hxx> +#include <vcl/lstbox.hxx> +#include <svtools/stdctrl.hxx> +#include <svl/poolitem.hxx> +#include <svl/lstner.hxx> +#include <sfx2/childwin.hxx> +#include "content.hxx" +#include <svtools/svmedit.hxx> + + +class ScTabViewShell; +class ScViewData; +class ScArea; +class ScScenarioWindow; +class ScNavigatorControllerItem; +class ScNavigatorDialogWrapper; +class ScNavigatorDlg; +class ScNavigatorSettings; +class ScRange; + +//======================================================================== + +#define SC_DROPMODE_URL 0 +#define SC_DROPMODE_LINK 1 +#define SC_DROPMODE_COPY 2 + +enum NavListMode { NAV_LMODE_NONE = 0x4000, + NAV_LMODE_AREAS = 0x2000, + NAV_LMODE_DBAREAS = 0x1000, + NAV_LMODE_DOCS = 0x800, + NAV_LMODE_SCENARIOS = 0x400 }; + +//======================================================================== +// class ScScenarioListBox ----------------------------------------------- +//======================================================================== + +class ScScenarioListBox : public ListBox +{ +public: + explicit ScScenarioListBox( ScScenarioWindow& rParent ); + virtual ~ScScenarioListBox(); + + void UpdateEntries( List* pNewEntryList ); + +protected: + virtual void Select(); + virtual void DoubleClick(); + virtual long Notify( NotifyEvent& rNEvt ); + +private: + struct ScenarioEntry + { + String maName; + String maComment; + bool mbProtected; + + inline explicit ScenarioEntry() : mbProtected( false ) {} + }; + typedef ::std::vector< ScenarioEntry > ScenarioList; + +private: + const ScenarioEntry* GetSelectedEntry() const; + + void ExecuteScenarioSlot( sal_uInt16 nSlotId ); + void SelectScenario(); + void EditScenario(); + void DeleteScenario( bool bQueryBox ); + +private: + ScScenarioWindow& mrParent; + ScenarioList maEntries; +}; + +//======================================================================== +// class ScScenarioWindow ------------------------------------------------ +//======================================================================== +class ScScenarioWindow : public Window +{ +public: + ScScenarioWindow( Window* pParent,const String& aQH_List,const String& aQH_Comment); + ~ScScenarioWindow(); + + void NotifyState( const SfxPoolItem* pState ); + void SetComment( const String& rComment ) + { aEdComment.SetText( rComment ); } + + void SetSizePixel( const Size& rNewSize ); + +protected: + + virtual void Paint( const Rectangle& rRec ); + +private: + ScScenarioListBox aLbScenario; + MultiLineEdit aEdComment; +}; + +//================================================================== +// class ColumnEdit +//================================================================== +class ColumnEdit : public SpinField +{ +public: + ColumnEdit( ScNavigatorDlg* pParent, const ResId& rResId ); + ~ColumnEdit(); + + SCCOL GetCol() { return nCol; } + void SetCol( SCCOL nColNo ); + +protected: + virtual long Notify( NotifyEvent& rNEvt ); + virtual void LoseFocus(); + virtual void Up(); + virtual void Down(); + virtual void First(); + virtual void Last(); + +private: + ScNavigatorDlg& rDlg; + SCCOL nCol; + sal_uInt16 nKeyGroup; + + void EvalText (); + void ExecuteCol (); + SCCOL AlphaToNum ( String& rStr ); + SCCOL NumStrToAlpha ( String& rStr ); + SCCOL NumToAlpha ( SCCOL nColNo, String& rStr ); +}; + + +//================================================================== +// class RowEdit +//================================================================== +class RowEdit : public NumericField +{ +public: + RowEdit( ScNavigatorDlg* pParent, const ResId& rResId ); + ~RowEdit(); + + SCROW GetRow() { return (SCROW)GetValue(); } + void SetRow( SCROW nRow ){ SetValue( nRow ); } + +protected: + virtual long Notify( NotifyEvent& rNEvt ); + virtual void LoseFocus(); + +private: + ScNavigatorDlg& rDlg; + + void ExecuteRow(); +}; + + +//================================================================== +// class ScDocListBox +//================================================================== +class ScDocListBox : public ListBox +{ +public: + ScDocListBox( ScNavigatorDlg* pParent, const ResId& rResId ); + ~ScDocListBox(); + +protected: + virtual void Select(); + +private: + ScNavigatorDlg& rDlg; +}; + + +//================================================================== +// class CommandToolBox +//================================================================== +class CommandToolBox : public ToolBox +{ +public: + CommandToolBox( ScNavigatorDlg* pParent, const ResId& rResId ); + ~CommandToolBox(); + + void Select( sal_uInt16 nId ); + void UpdateButtons(); + void InitImageList(); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + + DECL_LINK( ToolBoxDropdownClickHdl, ToolBox* ); + +protected: + virtual void Select(); + virtual void Click(); + +private: + ScNavigatorDlg& rDlg; +}; + +//================================================================== +// class ScNavigatorDlg +//================================================================== + +class ScNavigatorDlg : public Window, public SfxListener +{ +friend class ScNavigatorControllerItem; +friend class ScNavigatorDialogWrapper; +friend class ColumnEdit; +friend class RowEdit; +friend class ScDocListBox; +friend class CommandToolBox; +friend class ScContentTree; + +private: + SfxBindings& rBindings; // must be first member + + ImageList aCmdImageList; // must be before aTbxCmd + FixedInfo aFtCol; + ColumnEdit aEdCol; + FixedInfo aFtRow; + RowEdit aEdRow; + CommandToolBox aTbxCmd; + ScContentTree aLbEntries; + ScScenarioWindow aWndScenarios; + ScDocListBox aLbDocuments; + + Timer aContentTimer; + + String aTitleBase; + String aStrDragMode; + String aStrDisplay; + String aStrActive; + String aStrNotActive; + String aStrHidden; + String aStrActiveWin; + + SfxChildWindowContext* pContextWin; + Size aInitSize; + ScArea* pMarkArea; + ScViewData* pViewData; + + long nBorderOffset; + long nListModeHeight; + long nInitListHeight; + NavListMode eListMode; + sal_uInt16 nDropMode; + SCCOL nCurCol; + SCROW nCurRow; + SCTAB nCurTab; + sal_Bool bFirstBig; + + ScNavigatorControllerItem** ppBoundItems; + + DECL_LINK( TimeHdl, Timer* ); + + void DoResize(); + + SfxBindings& GetBindings() + { return rBindings; } + + void SetCurrentCell( SCCOL nCol, SCROW Row ); + void SetCurrentCellStr( const String rName ); + void SetCurrentTable( SCTAB nTab ); + void SetCurrentTableStr( const String rName ); + void SetCurrentObject( const String rName ); + void SetCurrentDoc( const String& rDocName ); + + ScTabViewShell* GetTabViewShell() const; + ScNavigatorSettings* GetNavigatorSettings(); + sal_Bool GetViewData(); + + void UpdateColumn ( const SCCOL* pCol = NULL ); + void UpdateRow ( const SCROW* pRow = NULL ); + void UpdateTable ( const SCTAB* pTab = NULL ); + void UpdateAll (); + + void GetDocNames(const String* pSelEntry = NULL); + + void SetListMode ( NavListMode eMode, sal_Bool bSetSize = sal_True ); + void ShowList ( sal_Bool bShow, sal_Bool bSetSize ); + void ShowScenarios ( sal_Bool bShow, sal_Bool bSetSize ); + + void SetDropMode(sal_uInt16 nNew); + sal_uInt16 GetDropMode() const { return nDropMode; } + + const String& GetStrDragMode() const { return aStrDragMode; } + const String& GetStrDisplay() const { return aStrDisplay; } + + void CheckDataArea (); + void MarkDataArea (); + void UnmarkDataArea (); + void StartOfDataArea (); + void EndOfDataArea (); + + static void ReleaseFocus(); + +protected: + virtual void Resize(); + virtual void Paint( const Rectangle& rRec ); + virtual void Resizing( Size& rSize ); + +public: + ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Window* pParent ); + ~ScNavigatorDlg(); + + using Window::Notify; + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + void CursorPosChanged(); + + virtual SfxChildAlignment + CheckAlignment(SfxChildAlignment,SfxChildAlignment); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); +}; + +//================================================================== + +class ScNavigatorDialogWrapper: public SfxChildWindowContext +{ +public: + ScNavigatorDialogWrapper( Window* pParent, + sal_uInt16 nId, + SfxBindings* pBindings, + SfxChildWinInfo* pInfo ); + + SFX_DECL_CHILDWINDOWCONTEXT(ScNavigatorDialogWrapper) + + virtual void Resizing( Size& rSize ); + +private: + ScNavigatorDlg* pNavigator; +}; + + + +#endif // SC_NAVIPI_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/navsett.hxx b/sc/source/ui/inc/navsett.hxx new file mode 100644 index 000000000000..6e4e85a10c39 --- /dev/null +++ b/sc/source/ui/inc/navsett.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_NAVSETT_HXX +#define SC_NAVSETT_HXX + +#include <tools/solar.h> + +#include <vector> + +/** Contains settings of the navigator listbox. This includes the expand state + of each listbox entry and the index of the selected entry and sub entry. */ +class ScNavigatorSettings +{ +private: + ::std::vector< sal_Bool > maExpandedVec; /// Array of Booleans for expand state. + sal_uInt16 mnRootSelected; /// Index of selected root entry. + sal_uLong mnChildSelected; /// Index of selected child entry. + +public: + ScNavigatorSettings(); + + inline void SetExpanded( sal_uInt16 nIndex, sal_Bool bExpand ) { maExpandedVec[ nIndex ] = bExpand; } + inline sal_Bool IsExpanded( sal_uInt16 nIndex ) const { return maExpandedVec[ nIndex ]; } + + inline void SetRootSelected( sal_uInt16 nIndex ) { mnRootSelected = nIndex; } + inline sal_uInt16 GetRootSelected() const { return mnRootSelected; } + + inline void SetChildSelected( sal_uLong nIndex ) { mnChildSelected = nIndex; } + inline sal_uLong GetChildSelected() const { return mnChildSelected; } +}; + + +#endif // SC_NAVSETT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/notemark.hxx b/sc/source/ui/inc/notemark.hxx new file mode 100644 index 000000000000..01eeec8dbcd5 --- /dev/null +++ b/sc/source/ui/inc/notemark.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_NOTEMARK_HXX +#define SC_NOTEMARK_HXX + +#include <vcl/mapmod.hxx> +#include <vcl/timer.hxx> +#include "global.hxx" +#include "address.hxx" + +class SdrModel; +class SdrObject; + +class ScNoteMarker +{ +private: + Window* pWindow; + Window* pRightWin; + Window* pBottomWin; + Window* pDiagWin; + ScDocument* pDoc; + ScAddress aDocPos; + String aUserText; + Rectangle aVisRect; + Timer aTimer; + MapMode aMapMode; + sal_Bool bLeft; + sal_Bool bByKeyboard; + + Rectangle aRect; + SdrModel* pModel; + SdrObject* pObject; + sal_Bool bVisible; + + DECL_LINK( TimeHdl, Timer* ); + +public: + ScNoteMarker( Window* pWin, Window* pRight, Window* pBottom, Window* pDiagonal, + ScDocument* pD, ScAddress aPos, const String& rUser, + const MapMode& rMap, sal_Bool bLeftEdge, sal_Bool bForce, sal_Bool bKeyboard ); + ~ScNoteMarker(); + + void Draw(); + void InvalidateWin(); + + ScAddress GetDocPos() const { return aDocPos; } + sal_Bool IsByKeyboard() const { return bByKeyboard; } +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/oleobjsh.hxx b/sc/source/ui/inc/oleobjsh.hxx new file mode 100644 index 000000000000..0d3e5c8d86a8 --- /dev/null +++ b/sc/source/ui/inc/oleobjsh.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef OLEOBJSH_HXX +#define OLEOBJSH_HXX + +#include <sfx2/shell.hxx> +#include "shellids.hxx" +#include <sfx2/module.hxx> +#include <svx/svdmark.hxx> + +class ScViewData; + +#include "drawsh.hxx" + +class ScOleObjectShell: public ScDrawShell +{ +public: + + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_OLEOBJECT_SHELL) + + ScOleObjectShell(ScViewData* pData); + virtual ~ScOleObjectShell(); + +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/olinefun.hxx b/sc/source/ui/inc/olinefun.hxx new file mode 100644 index 000000000000..2f0b00c3e580 --- /dev/null +++ b/sc/source/ui/inc/olinefun.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_OLINEFUN_HXX +#define SC_OLINEFUN_HXX + +#include "global.hxx" + +class ScDocShell; +class ScRange; + + +// --------------------------------------------------------------------------- + +class ScOutlineDocFunc +{ +private: + ScDocShell& rDocShell; + +public: + ScOutlineDocFunc( ScDocShell& rDocSh ): rDocShell(rDocSh) {} + ~ScOutlineDocFunc() {} + + sal_Bool MakeOutline( const ScRange& rRange, sal_Bool bColumns, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool RemoveOutline( const ScRange& rRange, sal_Bool bColumns, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool RemoveAllOutlines( SCTAB nTab, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool AutoOutline( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool SelectLevel( SCTAB nTab, sal_Bool bColumns, sal_uInt16 nLevel, + sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi ); + + sal_Bool ShowMarkedOutlines( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi ); + sal_Bool HideMarkedOutlines( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi ); + + sal_Bool ShowOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry, + sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi ); + sal_Bool HideOutline( SCTAB nTab, sal_Bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry, + sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/olinewin.hxx b/sc/source/ui/inc/olinewin.hxx new file mode 100644 index 000000000000..e1dee0826d34 --- /dev/null +++ b/sc/source/ui/inc/olinewin.hxx @@ -0,0 +1,246 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_OLINEWIN_HXX +#define SC_OLINEWIN_HXX + +#include "viewdata.hxx" + +class ScOutlineEntry; +class ScOutlineArray; +class ScOutlineTable; + + +// ============================================================================ + +enum ScOutlineMode { SC_OUTLINE_HOR, SC_OUTLINE_VER }; + + +// ---------------------------------------------------------------------------- + +/** The window left of or above the spreadsheet containing the outline groups + and controls to expand/collapse them. */ +class ScOutlineWindow : public Window +{ +private: + ScViewData& mrViewData; /// View data containing the document. + ScSplitPos meWhich; /// Which area in split window. + bool mbHoriz; /// true = Horizontal orientation. + bool mbMirrorEntries; /// true = mirror the order of entries (including header) + bool mbMirrorLevels; /// true = mirror the order of levels, including the border + + ImageList* mpSymbols; /// Symbols for buttons. + Color maLineColor; /// Line color for expanded groups. + long mnHeaderSize; /// Size of the header area in entry direction. + long mnHeaderPos; /// Position of the header area in entry direction. + long mnMainFirstPos; /// First position of main area in entry direction. + long mnMainLastPos; /// Last position of main area in entry direction. + + size_t mnMTLevel; /// Mouse tracking: Level of active button. + size_t mnMTEntry; /// Mouse tracking: Entry index of active button. + bool mbMTActive; /// Mouse tracking active? + bool mbMTPressed; /// Mouse tracking: Button currently drawed pressed? + + Rectangle maFocusRect; /// Focus rectangle on screen. + size_t mnFocusLevel; /// Level of focused button. + size_t mnFocusEntry; /// Entry index of focused button. + bool mbDontDrawFocus; /// Do not redraw focus in next Paint(). + +public: + ScOutlineWindow( + Window* pParent, + ScOutlineMode eMode, + ScViewData* pViewData, + ScSplitPos eWhich ); + virtual ~ScOutlineWindow(); + + /** Sets the size of the header area (width/height dep. on window type). */ + void SetHeaderSize( long nNewSize ); + /** Returns the width/height the window needs to show all levels. */ + long GetDepthSize() const; + + /** Scrolls the window content by the specified amount of pixels. */ + void ScrollPixel( long nDiff ); + + using Window::ShowFocus; + +private: + /** Initializes color and image settings. */ + void InitSettings(); + + /** Returns the calc document. */ + inline ScDocument& GetDoc() const { return *mrViewData.GetDocument(); } + /** Returns the current sheet index. */ + inline SCTAB GetTab() const { return mrViewData.GetTabNo(); } + /** Returns the outline array of the corresponding document. */ + const ScOutlineArray* GetOutlineArray() const; + /** Returns the specified outline entry. */ + const ScOutlineEntry* GetOutlineEntry( size_t nLevel, size_t nEntry ) const; + + /** Returns true, if the column/row is hidden. */ + bool IsHidden( SCCOLROW nColRowIndex ) const; + /** Returns true, if the column/row is filtered. */ + bool IsFiltered( SCCOLROW nColRowIndex ) const; + /** Returns true, if all columns/rows before nColRowIndex are hidden. */ + bool IsFirstVisible( SCCOLROW nColRowIndex ) const; + /** Returns the currently visible column/row range. */ + void GetVisibleRange( SCCOLROW& rnColRowStart, SCCOLROW& rnColRowEnd ) const; + + /** Returns the point in the window of the specified position. */ + Point GetPoint( long nLevelPos, long nEntryPos ) const; + /** Returns the rectangle in the window of the specified position. */ + Rectangle GetRectangle( + long nLevelStart, long nEntryStart, + long nLevelEnd, long nEntryEnd ) const; + + /** Returns the window size for the level coordinate. */ + long GetOutputSizeLevel() const; + /** Returns the window size for the entry coordinate. */ + long GetOutputSizeEntry() const; + + /** Returns the count of levels of the outline array. 0 means no outlines. */ + size_t GetLevelCount() const; + /** Returns the pixel position of the specified level. */ + long GetLevelPos( size_t nLevel ) const; + /** Returns the level of the passed pixel position. */ + size_t GetLevelFromPos( long nLevelPos ) const; + + /** Returns the start coordinate of the specified column/row in the window. */ + long GetColRowPos( SCCOLROW nColRowIndex ) const; + /** Returns the entry position of header images. */ + long GetHeaderEntryPos() const; + /** Calculates the coordinates the outline entry takes in the window. + @return false = no part of the group is visible (outside window or collapsed by parent group). */ + bool GetEntryPos( + size_t nLevel, size_t nEntry, + long& rnStartPos, long& rnEndPos, long& rnImagePos ) const; + /** Calculates the absolute position of the image of the specified outline entry. + @param nLevel The level of the entry. + @param nEntry The entry index or SC_OL_HEADERENTRY for the header image. + @return false = image is not visible. */ + bool GetImagePos( size_t nLevel, size_t nEntry, Point& rPos ) const; + /** Returns true, if the button of the specified entry is visible in the window. */ + bool IsButtonVisible( size_t nLevel, size_t nEntry ) const; + + /** Returns true, if rPos is inside of a button or over the line of an expanded + group. The outline entry data is stored in the passed variables. */ + bool ItemHit( const Point& rPos, size_t& rnLevel, size_t& rnEntry, bool& rbButton ) const; + /** Returns true, if rPos is inside of a button. + The button data is stored in the passed variables. */ + bool ButtonHit( const Point& rPos, size_t& rnLevel, size_t& rnEntry ) const; + /** Returns true, if rPos is over the line of an expanded group. + The outline entry data is stored in the passed variables. */ + bool LineHit( const Point& rPos, size_t& rnLevel, size_t& rnEntry ) const; + + /** Performs an action with the specified item. + @param nLevel The level of the entry. + @param nEntry The entry index or SC_OL_HEADERENTRY for the header entry. */ + void DoFunction( size_t nLevel, size_t nEntry ) const; + /** Expands the specified entry (does nothing with header entries). */ + void DoExpand( size_t nLevel, size_t nEntry ) const; + /** Collapses the specified entry (does nothing with header entries). */ + void DoCollapse( size_t nLevel, size_t nEntry ) const; + + /** Returns true, if the focused button is visible in the window. */ + bool IsFocusButtonVisible() const; + + /** Calculates index of next/previous focus button in the current level (no paint). + @param bFindVisible true = repeats until a visible button has been found. + @return true = focus wrapped from end to start or vice versa. */ + bool ImplMoveFocusByEntry( bool bForward, bool bFindVisible ); + /** Calculates position of focus button in next/previous level (no paint). + @return true = focus wrapped from end to start or vice versa. */ + bool ImplMoveFocusByLevel( bool bForward ); + /** Calculates position of focus button in tab order. + @param bFindVisible true = repeats until a visible button has been found. + @return true = focus wrapped from end to start or vice versa. */ + bool ImplMoveFocusByTabOrder( bool bForward, bool bFindVisible ); + + /** If the focused entry is invisible, tries to move to visible position. */ + void ImplMoveFocusToVisible( bool bForward ); + + /** Focuses next/previous button in the current level. */ + void MoveFocusByEntry( bool bForward ); + /** Focuses button in next/previous level. */ + void MoveFocusByLevel( bool bForward ); + /** Focuses next/previous button in tab order. */ + void MoveFocusByTabOrder( bool bForward ); + + /** Starts mouse tracking after click on a button. */ + void StartMouseTracking( size_t nLevel, size_t nEntry ); + /** Returns whether mouse tracking mode is active. */ + inline bool IsMouseTracking() const { return mbMTActive; } + /** Ends mouse tracking. */ + void EndMouseTracking(); + + /** Sets a clip region for the window area without header. */ + void SetEntryAreaClipRegion(); + /** Converts coordinates to real window points and draws the line. */ + void DrawLineRel( + long nLevelStart, long nEntryStart, + long nLevelEnd, long nEntryEnd ); + /** Converts coordinates to real window points and draws the rectangle. */ + void DrawRectRel( + long nLevelStart, long nEntryStart, + long nLevelEnd, long nEntryEnd ); + /** Draws the specified image unpressed. */ + void DrawImageRel( long nLevelPos, long nEntryPos, sal_uInt16 nId ); + /** Draws a pressed or unpressed border. */ + void DrawBorderRel( size_t nLevel, size_t nEntry, bool bPressed ); + + /** Draws the focus rectangle into the focused button. */ + void ShowFocus(); + /** Erases the focus rectangle from the focused button. */ + void HideFocus(); + + /** Scrolls the specified range of the window in entry-relative direction. */ + void ScrollRel( long nEntryDiff, long nEntryStart, long nEntryEnd ); + +protected: + virtual void Paint( const Rectangle& rRect ); + + virtual void Resize(); + virtual void GetFocus(); + virtual void LoseFocus(); + + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + + virtual void KeyInput( const KeyEvent& rKEvt ); + +public: + virtual void DataChanged( const DataChangedEvent& rDCEvt ); +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/opredlin.hrc b/sc/source/ui/inc/opredlin.hrc new file mode 100644 index 000000000000..2b52d8b46118 --- /dev/null +++ b/sc/source/ui/inc/opredlin.hrc @@ -0,0 +1,38 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "sc.hrc" // -> RID_SCPAGE_OPREDLINE + +#define FT_CONTENT 1 +#define FT_REMOVE 2 +#define FT_INSERT 3 +#define FT_MOVE 4 +#define GB_COLORCHGS 1 +#define CLB_CONTENT 1 +#define CLB_REMOVE 2 +#define CLB_INSERT 3 +#define CLB_MOVE 4 +#define STR_AUTHOR 1 diff --git a/sc/source/ui/inc/opredlin.hxx b/sc/source/ui/inc/opredlin.hxx new file mode 100644 index 000000000000..116097c30532 --- /dev/null +++ b/sc/source/ui/inc/opredlin.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _SC_OPREDLIN_HXX +#define _SC_OPREDLIN_HXX + +#include <sfx2/tabdlg.hxx> + +#include <vcl/group.hxx> + +#include <vcl/button.hxx> + +#include <vcl/lstbox.hxx> + +#include <vcl/field.hxx> + +#include <vcl/fixed.hxx> +#include <svtools/ctrlbox.hxx> +#include <svx/fntctrl.hxx> +#include <svx/strarray.hxx> + +/*----------------------------------------------------------------------- + Beschreibung: Redlining-Optionen + -----------------------------------------------------------------------*/ + +class ScRedlineOptionsTabPage : public SfxTabPage +{ + FixedText aContentFT; + ColorListBox aContentColorLB; + FixedText aRemoveFT; + ColorListBox aRemoveColorLB; + FixedText aInsertFT; + ColorListBox aInsertColorLB; + FixedText aMoveFT; + ColorListBox aMoveColorLB; + FixedLine aChangedGB; + String aAuthorStr; + DECL_LINK( ColorHdl, ColorListBox *pColorLB ); + + +public: + + ScRedlineOptionsTabPage( Window* pParent, const SfxItemSet& rSet ); + ~ScRedlineOptionsTabPage(); + + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet ); + + virtual sal_Bool FillItemSet( SfxItemSet& rSet ); + virtual void Reset( const SfxItemSet& rSet ); +}; +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/optdlg.hrc b/sc/source/ui/inc/optdlg.hrc new file mode 100644 index 000000000000..9ac8213cf621 --- /dev/null +++ b/sc/source/ui/inc/optdlg.hrc @@ -0,0 +1,196 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" + + +#define TP_GENERAL 1 +#define TP_SAVE 2 +#define TP_PATH 3 +#define TP_SPELL 4 +#define TP_VIEW 5 +#define TP_CALC 6 +#define TP_USERLISTS 7 +#define TP_PRINT 8 +#define TP_COLORS 9 +#define TP_GRID 10 +#define TP_CONTENT 11 +#define TP_LAYOUT 12 +#define TP_INPUT 13 +#define TP_CHANGES 14 +#define TP_FORMULA 15 + +// TP_CALC: +#define BTN_ITERATE 1 +#define FT_STEPS 2 +#define FT_EPS 3 +#define ED_STEPS 4 +#define ED_EPS 5 +#define GB_ZREFS 6 +#define ED_PREC 7 +#define FT_PREC 8 +#define BTN_DATESTD 9 +#define BTN_DATESC10 10 +#define BTN_DATE1904 11 +#define FT_VALUE 13 +#define GB_DATE 14 +#define BTN_CASE 15 +#define FT_CASE 16 +#define BTN_CALC 17 +#define BTN_MATCH 18 +#define BTN_LOOKUP 19 +#define BTN_REGEX 20 +#define BTN_GENERAL_PREC 21 + +// TP_VIEW: +#define BTN_VSCROLL 1 +#define BTN_HSCROLL 2 +#define BTN_REGISTER 3 +#define BTN_OUTLINER 4 +#define BTN_HEADERFOOTER 5 +#define BTN_GRID 6 +#define BTN_SYNTAX 7 +#define LB_GRIDCOLOR 9 +#define GB_ELEMENTS 10 +#define BTN_HELPLINES 11 + +#define BTN_FORMULAS 20 +#define BTN_NULLVALS 21 +#define BTN_NOTES 22 +#define GB_CONTENTS 23 + + +// TP_USERLISTS: +#define FT_LISTS 1 +#define LB_LISTS 1 +#define FT_ENTRIES 2 +#define ED_ENTRIES 2 +#define FT_COPYFROM 3 +#define ED_COPYFROM 3 +#define BTN_NEW 1 +#define BTN_ADD 2 +#define BTN_REMOVE 3 +#define BTN_COPY 4 +#define STR_QUERYREMOVE 5 +#define STR_DISMISS 6 +#define STR_COPYLIST 7 +#define STR_COPYFROM 8 +#define STR_COPYERR 9 + +// TP_PRINT: +#define FL_PAGES 1 +#define BTN_SKIPEMPTYPAGES 2 +#define FL_SHEETS 2 +#define BTN_SELECTEDSHEETS 4 + +// TP_LCONTENT + +#define GB_DISPLAY 20 +#define CB_FORMULA 21 +#define CB_NIL 22 +#define CB_ANNOT 23 +#define CB_VALUE 24 +#define CB_ANCHOR 25 +#define GB_OBJECT 26 +#define FT_OBJGRF 27 +#define LB_OBJGRF 28 +#define FT_DIAGRAM 29 +#define LB_DIAGRAM 30 +#define FT_DRAW 31 +#define LB_DRAW 32 +#define CB_CLIP 33 +#define GB_ZOOM 34 +#define CB_SYNCZOOM 35 + +// TP_LAYOUT +#define GB_LINK 1 +#define RB_ALWAYS 2 +#define RB_REQUEST 3 +#define RB_NEVER 4 +#define CB_DOCONLY 5 +#define CB_MERGE_PARA_DIST 6 +#define GB_COMPAT 7 +#define CB_AUTO_UPDATE_FIELDS 8 +#define CB_AUTO_UPDATE_CHARTS 9 +#define FT_UPDATE_LINKS 10 + +#define GB_WINDOW 50 +#define CB_ROWCOLHEADER 51 +#define CB_HSCROLL 52 +#define CB_VSCROLL 53 +#define CB_TBLREG 54 +#define CB_OUTLINE 55 +#define GB_LINES 56 +#define CB_GRID 57 +#define FT_COLOR 58 +#define LB_COLOR 59 +#define CB_GUIDELINE 60 +#define GB_UNIT 61 +#define LB_UNIT 62 +#define ST_UNIT 63 +#define GB_TAB 64 +#define MF_TAB 65 +#define CB_PAGEBREAKS 66 +#define CB_HANDLES 67 +#define CB_BIGHANDLES 68 +#define FT_TAB 69 +#define FT_UNIT 70 +#define FL_SEPARATOR1 71 +#define FL_SEPARATOR2 72 +#define FL_SEPARATOR 73 + +// TP_INPUT +#define GB_OPTIONS 70 +#define CB_ALIGN 71 +#define LB_ALIGN 72 +#define CB_EDITMODE 73 +#define CB_FORMAT 74 +#define CB_RFIND 75 +#define CB_EXPREF 76 +#define CB_MARKHDR 77 +#define CB_TEXTFMT 78 +#define CB_REPLWARN 79 + + +// TP_FORMULA +#define FL_FORMULA_OPTIONS 80 +#define FT_FORMULA_SYNTAX 81 +#define LB_FORMULA_SYNTAX 82 +#define CB_ENGLISH_FUNC_NAME 83 +#define FL_FORMULA_SEPS 84 +#define FT_FORMULA_SEP_ARG 85 +#define ED_FORMULA_SEP_ARG 86 +#define FT_FORMULA_SEP_ARRAY_R 87 +#define ED_FORMULA_SEP_ARRAY_R 88 +#define FT_FORMULA_SEP_ARRAY_C 89 +#define ED_FORMULA_SEP_ARRAY_C 90 +#define BTN_FORMULA_SEP_RESET 91 + +// TP_COMPATIBILITY +#define FL_KEY_BINDINGS 1 +#define FT_KEY_BINDINGS 2 +#define LB_KEY_BINDINGS 3 diff --git a/sc/source/ui/inc/optload.hrc b/sc/source/ui/inc/optload.hrc new file mode 100644 index 000000000000..c090c64dc136 --- /dev/null +++ b/sc/source/ui/inc/optload.hrc @@ -0,0 +1,38 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "sc.hrc" // -> RID_SCPAGE_OPREDLINE + +#define GB_LINK 1 +#define RB_ALWAYS 2 +#define RB_REQUEST 3 +#define RB_NEVER 4 +#define CB_DOCONLY 5 +#define CB_MERGE_PARA_DIST 6 +#define GB_COMPAT 7 +#define CB_AUTO_UPDATE_FIELDS 8 +#define CB_AUTO_UPDATE_CHARTS 9 +#define FT_UPDATE_LINKS 10 diff --git a/sc/source/ui/inc/optload.hxx b/sc/source/ui/inc/optload.hxx new file mode 100644 index 000000000000..14e1c4661903 --- /dev/null +++ b/sc/source/ui/inc/optload.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _OPTLOAD_HXX +#define _OPTLOAD_HXX + +#include <sfx2/tabdlg.hxx> + +#include <vcl/group.hxx> +#include <vcl/fixed.hxx> + +class ScDocument; + +class ScLoadOptPage : public SfxTabPage +{ +private: + FixedText aLinkFT; + RadioButton aAlwaysRB; + RadioButton aRequestRB; + RadioButton aNeverRB; + CheckBox aDocOnlyCB; + GroupBox aLinkGB; + ScDocument *pDoc; + + DECL_LINK( UpdateHdl, CheckBox* ); + +public: + ScLoadOptPage( Window* pParent, + const SfxItemSet& rSet ); + ~ScLoadOptPage(); + + static SfxTabPage* Create( Window* pParent, + const SfxItemSet& rAttrSet); + + void SetDocument(ScDocument*); + + virtual sal_Bool FillItemSet( SfxItemSet& rSet ); + virtual void Reset( const SfxItemSet& rSet ); +}; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/optsolver.hrc b/sc/source/ui/inc/optsolver.hrc new file mode 100644 index 000000000000..5ed7b8560060 --- /dev/null +++ b/sc/source/ui/inc/optsolver.hrc @@ -0,0 +1,95 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" + +#define ED_OBJECTIVECELL 1 +#define ED_TARGET 2 +#define ED_VARIABLECELLS 3 +#define ED_LEFT1 4 +#define ED_LEFT2 5 +#define ED_LEFT3 6 +#define ED_LEFT4 7 +#define ED_RIGHT1 8 +#define ED_RIGHT2 9 +#define ED_RIGHT3 10 +#define ED_RIGHT4 11 + +#define FT_OBJECTIVECELL 1 +#define FT_DIRECTION 2 +#define FT_VARIABLECELLS 3 +#define FT_CELLREF 4 +#define FT_OPERATOR 5 +#define FT_CONSTRAINT 6 + +#define FT_PROGRESS 7 +#define FT_TIMELIMIT 8 +#define FT_NOSOLUTION 9 +#define FT_ERRORTEXT 10 +#define FT_SUCCESS 11 +#define FT_RESULT 12 +#define FT_QUESTION 13 + +#define FL_CONDITIONS 1 +#define FL_BUTTONS 2 + +#define IB_OBJECTIVECELL 1 +#define IB_TARGET 2 +#define IB_VARIABLECELLS 3 +#define IB_LEFT1 4 +#define IB_LEFT2 5 +#define IB_LEFT3 6 +#define IB_LEFT4 7 +#define IB_RIGHT1 8 +#define IB_RIGHT2 9 +#define IB_RIGHT3 10 +#define IB_RIGHT4 11 +#define IB_DELETE1 12 +#define IB_DELETE2 13 +#define IB_DELETE3 14 +#define IB_DELETE4 15 + +#define LB_OP1 1 +#define LB_OP2 2 +#define LB_OP3 3 +#define LB_OP4 4 + +#define RB_MAX 1 +#define RB_MIN 2 +#define RB_VALUE 3 + +#define SB_SCROLL 1 + +#define BTN_OPTIONS 1 +#define BTN_HELP 2 +#define BTN_CLOSE 3 +#define BTN_SOLVE 4 +#define BTN_OK 5 +#define BTN_CANCEL 6 + +#define STR_INVALIDINPUT 1 +#define STR_INVALIDCONDITION 2 diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx new file mode 100644 index 000000000000..c7a06213c067 --- /dev/null +++ b/sc/source/ui/inc/optsolver.hxx @@ -0,0 +1,266 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_OPTSOLVER_HXX +#define SC_OPTSOLVER_HXX + +#include "global.hxx" +#include "address.hxx" +#include "anyrefdg.hxx" +#include <vcl/fixed.hxx> +#include <vcl/group.hxx> +#include <vcl/lstbox.hxx> +#include <com/sun/star/uno/Sequence.hxx> + +#include <vector> + +namespace com { namespace sun { namespace star { + namespace beans { struct PropertyValue; } +} } } + +//============================================================================ + +class ScCursorRefEdit : public formula::RefEdit +{ + Link maCursorUpLink; + Link maCursorDownLink; + +public: + ScCursorRefEdit( ScAnyRefDlg* pParent, const ResId& rResId ); + void SetCursorLinks( const Link& rUp, const Link& rDown ); + +protected: + virtual void KeyInput( const KeyEvent& rKEvt ); +}; + + +/// The dialog's content for a row, not yet parsed +struct ScOptConditionRow +{ + String aLeftStr; + sal_uInt16 nOperator; + String aRightStr; + + ScOptConditionRow() : nOperator(0) {} + bool IsDefault() const { return aLeftStr.Len() == 0 && aRightStr.Len() == 0 && nOperator == 0; } +}; + +/// All settings from the dialog, saved with the DocShell for the next call +class ScOptSolverSave +{ + String maObjective; + sal_Bool mbMax; + sal_Bool mbMin; + sal_Bool mbValue; + String maTarget; + String maVariable; + std::vector<ScOptConditionRow> maConditions; + String maEngine; + com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> maProperties; + +public: + ScOptSolverSave( const String& rObjective, sal_Bool bMax, sal_Bool bMin, sal_Bool bValue, + const String& rTarget, const String& rVariable, + const std::vector<ScOptConditionRow>& rConditions, + const String& rEngine, + const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProperties ); + + const String& GetObjective() const { return maObjective; } + sal_Bool GetMax() const { return mbMax; } + sal_Bool GetMin() const { return mbMin; } + sal_Bool GetValue() const { return mbValue; } + const String& GetTarget() const { return maTarget; } + const String& GetVariable() const { return maVariable; } + const std::vector<ScOptConditionRow>& GetConditions() const { return maConditions; } + const String& GetEngine() const { return maEngine; } + const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& GetProperties() const + { return maProperties; } +}; + +class ScOptSolverDlg : public ScAnyRefDlg +{ +public: + ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScDocShell* pDocSh, ScAddress aCursorPos ); + ~ScOptSolverDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + virtual sal_Bool Close(); + +private: + FixedText maFtObjectiveCell; + formula::RefEdit maEdObjectiveCell; + formula::RefButton maRBObjectiveCell; + + FixedText maFtDirection; + RadioButton maRbMax; + RadioButton maRbMin; + RadioButton maRbValue; + formula::RefEdit maEdTargetValue; + formula::RefButton maRBTargetValue; + + FixedText maFtVariableCells; + formula::RefEdit maEdVariableCells; + formula::RefButton maRBVariableCells; + + FixedLine maFlConditions; + + FixedText maFtCellRef; // labels are together with controls for the first row + ScCursorRefEdit maEdLeft1; + formula::RefButton maRBLeft1; + FixedText maFtOperator; + ListBox maLbOp1; + FixedText maFtConstraint; + ScCursorRefEdit maEdRight1; + formula::RefButton maRBRight1; + ImageButton maBtnDel1; + + ScCursorRefEdit maEdLeft2; + formula::RefButton maRBLeft2; + ListBox maLbOp2; + ScCursorRefEdit maEdRight2; + formula::RefButton maRBRight2; + ImageButton maBtnDel2; + + ScCursorRefEdit maEdLeft3; + formula::RefButton maRBLeft3; + ListBox maLbOp3; + ScCursorRefEdit maEdRight3; + formula::RefButton maRBRight3; + ImageButton maBtnDel3; + + ScCursorRefEdit maEdLeft4; + formula::RefButton maRBLeft4; + ListBox maLbOp4; + ScCursorRefEdit maEdRight4; + formula::RefButton maRBRight4; + ImageButton maBtnDel4; + + ScrollBar maScrollBar; + + FixedLine maFlButtons; + + PushButton maBtnOpt; + HelpButton maBtnHelp; + CancelButton maBtnCancel; + PushButton maBtnSolve; + + String maInputError; + String maConditionError; + + ScDocShell* mpDocShell; + ScDocument* mpDoc; + const SCTAB mnCurTab; + formula::RefEdit* mpEdActive; + bool mbDlgLostFocus; + + static const sal_uInt16 EDIT_ROW_COUNT = 4; + ScCursorRefEdit* mpLeftEdit[EDIT_ROW_COUNT]; + formula::RefButton* mpLeftButton[EDIT_ROW_COUNT]; + ScCursorRefEdit* mpRightEdit[EDIT_ROW_COUNT]; + formula::RefButton* mpRightButton[EDIT_ROW_COUNT]; + ListBox* mpOperator[EDIT_ROW_COUNT]; + ImageButton* mpDelButton[EDIT_ROW_COUNT]; + + std::vector<ScOptConditionRow> maConditions; + long nScrollPos; + + com::sun::star::uno::Sequence<rtl::OUString> maImplNames; + com::sun::star::uno::Sequence<rtl::OUString> maDescriptions; + String maEngine; + com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> maProperties; + + void Init(const ScAddress& rCursorPos); + bool CallSolver(); + void ReadConditions(); + void ShowConditions(); + void EnableButtons(); + bool ParseRef( ScRange& rRange, const String& rInput, bool bAllowRange ); + bool FindTimeout( sal_Int32& rTimeout ); + void ShowError( bool bCondition, formula::RefEdit* pFocus ); + + DECL_LINK( BtnHdl, PushButton* ); + DECL_LINK( DelBtnHdl, PushButton* ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); + DECL_LINK( ScrollHdl, ScrollBar* ); + DECL_LINK( CursorUpHdl, ScCursorRefEdit* ); + DECL_LINK( CursorDownHdl, ScCursorRefEdit* ); + DECL_LINK( CondModifyHdl, Edit* ); + DECL_LINK( TargetModifyHdl, Edit* ); + DECL_LINK( SelectHdl, ListBox* ); +}; + + +class ScSolverProgressDialog : public ModelessDialog +{ + FixedText maFtProgress; + FixedText maFtTime; + FixedLine maFlButtons; + OKButton maBtnOk; + +public: + ScSolverProgressDialog( Window* pParent ); + ~ScSolverProgressDialog(); + + void HideTimeLimit(); + void SetTimeLimit( sal_Int32 nSeconds ); +}; + +class ScSolverNoSolutionDialog : public ModalDialog +{ + FixedText maFtNoSolution; + FixedText maFtErrorText; + FixedLine maFlButtons; + OKButton maBtnOk; + +public: + ScSolverNoSolutionDialog( Window* pParent, const String& rErrorText ); + ~ScSolverNoSolutionDialog(); +}; + +class ScSolverSuccessDialog : public ModalDialog +{ + FixedText maFtSuccess; + FixedText maFtResult; + FixedText maFtQuestion; + FixedLine maFlButtons; + OKButton maBtnOk; + CancelButton maBtnCancel; + +public: + ScSolverSuccessDialog( Window* pParent, const String& rSolution ); + ~ScSolverSuccessDialog(); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx new file mode 100644 index 000000000000..d8c9f24731e7 --- /dev/null +++ b/sc/source/ui/inc/output.hxx @@ -0,0 +1,345 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_OUTPUT_HXX +#define SC_OUTPUT_HXX + +#include "address.hxx" +#include <tools/color.hxx> +#include <tools/fract.hxx> +#include <com/sun/star/embed/XEmbeddedObject.hpp> +#include <drawinglayer/processor2d/baseprocessor2d.hxx> + +class Rectangle; +class Font; +class OutputDevice; +class Window; +class EditEngine; +class ScDocument; +class ScBaseCell; +class ScPatternAttr; +class SvxMarginItem; +class SdrObject; +class SdrOle2Obj; +struct RowInfo; +struct ScTableInfo; +class ScTabViewShell; +class ScPageBreakData; +class FmFormView; + +// #i74769# SdrPaintWindow predefine +class SdrPaintWindow; + +// --------------------------------------------------------------------------- + +#define SC_SCENARIO_HSPACE 60 +#define SC_SCENARIO_VSPACE 50 + +// --------------------------------------------------------------------------- + +#define SC_OBJECTS_NONE 0 +#define SC_OBJECTS_DRAWING 1 +#define SC_OBJECTS_OLE 2 +#define SC_OBJECTS_CHARTS 4 +#define SC_OBJECTS_ALL ( SC_OBJECTS_DRAWING | SC_OBJECTS_OLE | SC_OBJECTS_CHARTS ) + +enum ScOutputType { OUTTYPE_WINDOW, OUTTYPE_PRINTER }; + +class ScFieldEditEngine; + +class ScOutputData +{ +friend class ScDrawStringsVars; +private: + struct OutputAreaParam + { + Rectangle maAlignRect; + Rectangle maClipRect; + long mnColWidth; + bool mbLeftClip; + bool mbRightClip; + }; + + class DrawEditParam + { + public: + SvxCellHorJustify meHorJust; + SvxCellVerJustify meVerJust; + SvxCellJustifyMethod meHorJustMethod; + SvxCellJustifyMethod meVerJustMethod; + SvxCellOrientation meOrient; + SCSIZE mnArrY; + SCCOL mnX; + SCROW mnY; + SCCOL mnCellX; + SCROW mnCellY; + long mnPosX; + long mnPosY; + long mnInitPosX; + bool mbBreak; + bool mbCellIsValue; + bool mbAsianVertical; + bool mbPixelToLogic; + bool mbHyphenatorSet; + ScFieldEditEngine* mpEngine; + ScBaseCell* mpCell; + const ScPatternAttr* mpPattern; + const SfxItemSet* mpCondSet; + const ScPatternAttr* mpOldPattern; + const SfxItemSet* mpOldCondSet; + const RowInfo* mpThisRowInfo; + + explicit DrawEditParam(const ScPatternAttr* pPattern, const SfxItemSet* pCondSet, bool bCellIsValue); + + bool readCellContent(ScDocument* pDoc, bool bShowNullValues, bool bShowFormulas, bool bSyntaxMode, bool bUseStyleColor, bool bForceAutoColor, bool& rWrapFields); + void setPatternToEngine(bool bUseStyleColor); + void calcMargins(long& rTop, long& rLeft, long& rBottom, long& rRight, double nPPTX, double nPPTY) const; + void calcPaperSize(Size& rPaperSize, const Rectangle& rAlignRect, double nPPTX, double nPPTY) const; + void getEngineSize(ScFieldEditEngine* pEngine, long& rWidth, long& rHeight) const; + long getEngineWidth(ScFieldEditEngine* pEngine) const; + bool hasLineBreak() const; + bool isHyperlinkCell() const; + + /** + * When the text is vertically oriented, the text is either rotated 90 + * degrees to the right or 90 degrees to the left. Note that this is + * different from being vertically stacked. + */ + bool isVerticallyOriented() const; + + /** + * Calculate offset position for vertically oriented (either + * top-bottom or bottom-top orientation) text. + * + * @param rLogicStart initial position in pixels. When the call is + * finished, this parameter will store the new + * position. + */ + void calcStartPosForVertical(Point& rLogicStart, long nCellWidth, long nEngineWidth, long nTopM, OutputDevice* pRefDevice); + + void setAlignmentToEngine(); + bool adjustHorAlignment(ScFieldEditEngine* pEngine); + void adjustForRTL(); + void adjustForHyperlinkInPDF(Point aURLStart, OutputDevice* pDev); + }; + + OutputDevice* pDev; // Device + OutputDevice* pRefDevice; // printer if used for preview + OutputDevice* pFmtDevice; // reference for text formatting + ScTableInfo& mrTabInfo; + RowInfo* pRowInfo; // Info-Block + SCSIZE nArrCount; // belegte Zeilen im Info-Block + ScDocument* pDoc; // Dokument + SCTAB nTab; // Tabelle + long nScrX; // Ausgabe Startpos. (Pixel) + long nScrY; + long nScrW; // Ausgabe Groesse (Pixel) + long nScrH; + long nMirrorW; // Visible output width for mirroring (default: nScrW) + SCCOL nX1; // Start-/Endkoordinaten + SCROW nY1; // ( incl. versteckte ) + SCCOL nX2; + SCROW nY2; + SCCOL nVisX1; // Start-/Endkoordinaten + SCROW nVisY1; // ( sichtbarer Bereich ) + SCCOL nVisX2; + SCROW nVisY2; + ScOutputType eType; // Bildschirm/Drucker ... + double nPPTX; // Pixel per Twips + double nPPTY; +// sal_uInt16 nZoom; // Zoom-Faktor (Prozent) - fuer GetFont + Fraction aZoomX; + Fraction aZoomY; + + SdrObject* pEditObj; // beim Painten auslassen + + ScTabViewShell* pViewShell; // zum Connecten von sichtbaren Plug-Ins + + // #114135# + FmFormView* pDrawView; // SdrView to paint to + + sal_Bool bEditMode; // InPlace editierte Zelle - nicht ausgeben + SCCOL nEditCol; + SCROW nEditRow; + + bool bMetaFile; // Ausgabe auf Metafile (nicht in Pixeln!) + bool bSingleGrid; // beim Gitter bChanged auswerten + + bool bPagebreakMode; // Seitenumbruch-Vorschau + bool bSolidBackground; // weiss statt transparent + + bool bUseStyleColor; + bool bForceAutoColor; + + sal_Bool bSyntaxMode; // Syntax-Highlighting + Color* pValueColor; + Color* pTextColor; + Color* pFormulaColor; + + Color aGridColor; + + bool bShowNullValues; + bool bShowFormulas; + bool bShowSpellErrors; // Spell-Errors in EditObjekten anzeigen + bool bMarkClipped; + + bool bSnapPixel; + + bool bAnyRotated; // intern + bool bAnyClipped; // intern + bool bTabProtected; + sal_uInt8 nTabTextDirection; // EEHorizontalTextDirection values + bool bLayoutRTL; + + // #i74769# use SdrPaintWindow direct, remember it during BeginDrawLayers/EndDrawLayers + SdrPaintWindow* mpTargetPaintWindow; + + // private methods + + sal_Bool GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY, + SCCOL& rOverX, SCROW& rOverY, sal_Bool bVisRowChanged ); + sal_Bool IsEmptyCellText( RowInfo* pThisRowInfo, SCCOL nX, SCROW nY ); + void GetVisibleCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell*& rpCell ); + + sal_Bool IsAvailable( SCCOL nX, SCROW nY ); + + void GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY, + SCCOL nCellX, SCROW nCellY, long nNeeded, + const ScPatternAttr& rPattern, + sal_uInt16 nHorJustify, bool bCellIsValue, + bool bBreak, bool bOverwrite, + OutputAreaParam& rParam ); + + void ShrinkEditEngine( EditEngine& rEngine, const Rectangle& rAlignRect, + long nLeftM, long nTopM, long nRightM, long nBottomM, + sal_Bool bWidth, sal_uInt16 nOrient, long nAttrRotate, sal_Bool bPixelToLogic, + long& rEngineWidth, long& rEngineHeight, long& rNeededPixel, + bool& rLeftClip, bool& rRightClip ); + + void SetSyntaxColor( Font* pFont, ScBaseCell* pCell ); + void SetEditSyntaxColor( EditEngine& rEngine, ScBaseCell* pCell ); + + double GetStretch(); + + void DrawRotatedFrame( const Color* pForceColor ); // pixel + + drawinglayer::processor2d::BaseProcessor2D* CreateProcessor2D( ); + + void DrawEditStandard(DrawEditParam& rParam); + void DrawEditBottomTop(DrawEditParam& rParam); + void DrawEditTopBottom(DrawEditParam& rParam); + void DrawEditStacked(DrawEditParam& rParam); + void DrawEditAsianVertical(DrawEditParam& rParam); + +public: + ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, + ScTableInfo& rTabInfo, ScDocument* pNewDoc, + SCTAB nNewTab, long nNewScrX, long nNewScrY, + SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2, + double nPixelPerTwipsX, double nPixelPerTwipsY, + const Fraction* pZoomX = NULL, + const Fraction* pZoomY = NULL ); + + ~ScOutputData(); + + void SetContentDevice( OutputDevice* pContentDev ); + + void SetRefDevice( OutputDevice* pRDev ) { pRefDevice = pFmtDevice = pRDev; } + void SetFmtDevice( OutputDevice* pRDev ) { pFmtDevice = pRDev; } + void SetEditObject( SdrObject* pObj ) { pEditObj = pObj; } + void SetViewShell( ScTabViewShell* pSh ) { pViewShell = pSh; } + + // #114135# + void SetDrawView( FmFormView* pNew ) { pDrawView = pNew; } + + void SetSolidBackground( sal_Bool bSet ) { bSolidBackground = bSet; } + void SetUseStyleColor( sal_Bool bSet ) { bUseStyleColor = bSet; } + + void SetEditCell( SCCOL nCol, SCROW nRow ); + void SetSyntaxMode( sal_Bool bNewMode ); + void SetMetaFileMode( sal_Bool bNewMode ); + void SetSingleGrid( sal_Bool bNewMode ); + void SetGridColor( const Color& rColor ); + void SetMarkClipped( sal_Bool bSet ); + void SetShowNullValues ( sal_Bool bSet = sal_True ); + void SetShowFormulas ( sal_Bool bSet = sal_True ); + void SetShowSpellErrors( sal_Bool bSet = sal_True ); + void SetMirrorWidth( long nNew ); + long GetScrW() const { return nScrW; } + long GetScrH() const { return nScrH; } + + void SetSnapPixel( sal_Bool bSet = sal_True ); + + void DrawGrid( sal_Bool bGrid, sal_Bool bPage ); + void DrawStrings( sal_Bool bPixelToLogic = false ); + void DrawDocumentBackground(); + void DrawBackground(); + void DrawShadow(); + void DrawExtraShadow(sal_Bool bLeft, sal_Bool bTop, sal_Bool bRight, sal_Bool bBottom); + void DrawFrame(); + + // with logic MapMode set! + void DrawEdit(sal_Bool bPixelToLogic); + + void FindRotated(); + void DrawRotated(sal_Bool bPixelToLogic); // logisch + + void DrawClear(); + + // #i72502# printer only command set + Point PrePrintDrawingLayer(long nLogStX, long nLogStY ); + void PostPrintDrawingLayer(const Point& rMMOffset); // #i74768# need offset for FormLayer + void PrintDrawingLayer(const sal_uInt16 nLayer, const Point& rMMOffset); + + // nur Bildschirm: + void DrawingSingle(const sal_uInt16 nLayer); + void DrawSelectiveObjects(const sal_uInt16 nLayer); + + sal_Bool SetChangedClip(); // sal_False = nix + PolyPolygon GetChangedArea(); + + void FindChanged(); + void SetPagebreakMode( ScPageBreakData* pPageData ); + void DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, + SCCOL nRefEndX, SCROW nRefEndY, + const Color& rColor, sal_Bool bHandle ); + void DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY, + SCCOL nRefEndX, SCROW nRefEndY, + const Color& rColor, sal_uInt16 nType ); + void DrawChangeTrack(); + void DrawClipMarks(); + + void DrawNoteMarks(); + void AddPDFNotes(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/overlayobject.hxx b/sc/source/ui/inc/overlayobject.hxx new file mode 100644 index 000000000000..91219edaa0c4 --- /dev/null +++ b/sc/source/ui/inc/overlayobject.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __SC_OVERLAYOBJECT_HXX__ +#define __SC_OVERLAYOBJECT_HXX__ + +#include "svx/sdr/overlay/overlayobject.hxx" + +class OutputDevice; +class Window; + +class ScOverlayDashedBorder : public ::sdr::overlay::OverlayObject +{ +public: + ScOverlayDashedBorder(const ::basegfx::B2DRange& rRange, const Color& rColor, Window* pWin); + virtual ~ScOverlayDashedBorder(); + + virtual void Trigger(sal_uInt32 nTime); + + virtual void stripeDefinitionHasChanged(); + +protected: + virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence(); + +private: + ::basegfx::B2DRange maRange; + Window* mpParent; + bool mbToggle; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/pagedata.hxx b/sc/source/ui/inc/pagedata.hxx new file mode 100644 index 000000000000..f0114ddb2101 --- /dev/null +++ b/sc/source/ui/inc/pagedata.hxx @@ -0,0 +1,97 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PAGEDATA_HXX +#define SC_PAGEDATA_HXX + +#include "global.hxx" +#include "address.hxx" + +class ScDocShell; + +//============================================================================ + +class ScPrintRangeData +{ +private: + ScRange aPrintRange; + size_t nPagesX; + SCCOL* pPageEndX; + size_t nPagesY; + SCROW* pPageEndY; + long nFirstPage; + sal_Bool bTopDown; + sal_Bool bAutomatic; + +public: + ScPrintRangeData(); + ~ScPrintRangeData(); + + void SetPrintRange( const ScRange& rNew ) { aPrintRange = rNew; } + const ScRange& GetPrintRange() const { return aPrintRange; } + + void SetPagesX( size_t nCount, const SCCOL* pEnd ); + void SetPagesY( size_t nCount, const SCROW* pEnd ); + + size_t GetPagesX() const { return nPagesX; } + const SCCOL* GetPageEndX() const { return pPageEndX; } + size_t GetPagesY() const { return nPagesY; } + const SCROW* GetPageEndY() const { return pPageEndY; } + + void SetFirstPage( long nNew ) { nFirstPage = nNew; } + long GetFirstPage() const { return nFirstPage; } + void SetTopDown( sal_Bool bSet ) { bTopDown = bSet; } + sal_Bool IsTopDown() const { return bTopDown; } + void SetAutomatic( sal_Bool bSet ) { bAutomatic = bSet; } + sal_Bool IsAutomatic() const { return bAutomatic; } +}; + +class ScPageBreakData +{ +private: + size_t nAlloc; + size_t nUsed; + ScPrintRangeData* pData; // Array + +public: + ScPageBreakData(size_t nMax); + ~ScPageBreakData(); + + size_t GetCount() const { return nUsed; } + ScPrintRangeData& GetData(size_t i); + + sal_Bool IsEqual( const ScPageBreakData& rOther ) const; + + void AddPages(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/parawin.hxx b/sc/source/ui/inc/parawin.hxx new file mode 100644 index 000000000000..bacbc2c35078 --- /dev/null +++ b/sc/source/ui/inc/parawin.hxx @@ -0,0 +1,171 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PARAWIN_HXX +#define SC_PARAWIN_HXX + +#include "funcutl.hxx" +#include "global.hxx" // ScAddress +#include <svtools/stdctrl.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/group.hxx> +#include <svtools/svmedit.hxx> +#include <vcl/tabpage.hxx> + +#ifndef _SVSTDARR_STRINGS + +#define _SVSTDARR_STRINGS +#include <svl/svstdarr.hxx> + +#endif +#include <vcl/tabctrl.hxx> + +#include <vector> + +class ScFuncDesc; + +//============================================================================ +#define NOT_FOUND 0xffff +//============================================================================ + +class ScParaWin : public TabPage +{ +private: + + Link aScrollLink; + Link aFxLink; + Link aArgModifiedLink; + + ::std::vector<sal_uInt16> aVisibleArgMapping; + const ScFuncDesc* pFuncDesc; + ScAnyRefDlg* pMyParent; + sal_uInt16 nArgs; // unsuppressed arguments + Font aFntBold; + Font aFntLight; + + FixedInfo aFtEditDesc; + FixedText aFtArgName; + FixedInfo aFtArgDesc; + + ImageButton aBtnFx1; + FixedText aFtArg1; + ArgEdit aEdArg1; + formula::RefButton aRefBtn1; + ImageButton aBtnFx2; + FixedText aFtArg2; + ArgEdit aEdArg2; + formula::RefButton aRefBtn2; + ImageButton aBtnFx3; + FixedText aFtArg3; + ArgEdit aEdArg3; + formula::RefButton aRefBtn3; + ImageButton aBtnFx4; + FixedText aFtArg4; + ArgEdit aEdArg4; + formula::RefButton aRefBtn4; + ScrollBar aSlider; + sal_Bool bRefMode; + + sal_uInt16 nEdFocus; + sal_uInt16 nActiveLine; + + ArgInput aArgInput[4]; + String aDefaultString; + SvStrings aParaArray; + DECL_LINK( ScrollHdl, ScrollBar* ); + DECL_LINK( ModifyHdl, ArgInput* ); + DECL_LINK( GetEdFocusHdl, ArgInput* ); + DECL_LINK( GetFxFocusHdl, ArgInput* ); + DECL_LINK( GetFxHdl, ArgInput* ); + +protected: + + virtual void SliderMoved(); + virtual void ArgumentModified(); + virtual void FxClick(); + + void InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx, + ArgEdit& rEdArg, formula::RefButton& rRefBtn); + + void DelParaArray(); + void SetArgumentDesc(const String& aText); + void SetArgumentText(const String& aText); + + + void SetArgName (sal_uInt16 no,const String &aArg); + void SetArgNameFont (sal_uInt16 no,const Font&); + void SetArgVal (sal_uInt16 no,const String &aArg); + + void HideParaLine(sal_uInt16 no); + void ShowParaLine(sal_uInt16 no); + void UpdateArgDesc( sal_uInt16 nArg ); + void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ); + +public: + ScParaWin(ScAnyRefDlg* pParent,Point aPos); + ~ScParaWin(); + + void SetFunctionDesc(const ScFuncDesc* pFDesc); + void SetArgumentOffset(sal_uInt16 nOffset); + void SetEditDesc(const String& aText); + void UpdateParas(); + void ClearAll(); + + sal_Bool IsRefMode() {return bRefMode;} + void SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;} + + sal_uInt16 GetActiveLine(); + void SetActiveLine(sal_uInt16 no); + formula::RefEdit* GetActiveEdit(); + String GetActiveArgName(); + + String GetArgument(sal_uInt16 no); + void SetArgument(sal_uInt16 no, const String& aString); + void SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont); + + void SetEdFocus(sal_uInt16 nEditLine); //Sichtbare Editzeilen + sal_uInt16 GetSliderPos(); + void SetSliderPos(sal_uInt16 nSliderPos); + + void SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; } + const Link& GetScrollHdl() const { return aScrollLink; } + + void SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; } + const Link& GetArgModifiedHdl() const { return aArgModifiedLink; } + + void SetFxHdl( const Link& rLink ) { aFxLink = rLink; } + const Link& GetFxHdl() const { return aFxLink; } +}; + + + + + +#endif // SC_PARAWIN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/pfiltdlg.hxx b/sc/source/ui/inc/pfiltdlg.hxx new file mode 100644 index 000000000000..0c35cc916a13 --- /dev/null +++ b/sc/source/ui/inc/pfiltdlg.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PFILTDLG_HXX +#define SC_PFILTDLG_HXX + +#include <vcl/morebtn.hxx> +#include <svtools/stdctrl.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/dialog.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/combobox.hxx> +#include "address.hxx" +#include "queryparam.hxx" + +//------------------------------------------------------------------ + +class ScViewData; +class ScDocument; +class ScQueryItem; +class TypedScStrCollection; + +//================================================================== + +class ScPivotFilterDlg : public ModalDialog +{ +public: + ScPivotFilterDlg( Window* pParent, + const SfxItemSet& rArgSet, SCTAB nSourceTab ); + ~ScPivotFilterDlg(); + + const ScQueryItem& GetOutputItem(); + +private: + FixedLine aFlCriteria; + //---------------------------- + ListBox aLbField1; + ListBox aLbCond1; + ComboBox aEdVal1; + //---------------------------- + ListBox aLbConnect1; + ListBox aLbField2; + ListBox aLbCond2; + ComboBox aEdVal2; + //---------------------------- + ListBox aLbConnect2; + ListBox aLbField3; + ListBox aLbCond3; + ComboBox aEdVal3; + //---------------------------- + FixedText aFtConnect; + FixedText aFtField; + FixedText aFtCond; + FixedText aFtVal; + + FixedLine aFlOptions; + CheckBox aBtnCase; + CheckBox aBtnRegExp; + CheckBox aBtnUnique; + FixedText aFtDbAreaLabel; + FixedInfo aFtDbArea; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + MoreButton aBtnMore; + const String aStrUndefined; + const String aStrNone; + const String aStrEmpty; + const String aStrNotEmpty; + const String aStrRow; + const String aStrColumn; + + const sal_uInt16 nWhichQuery; + const ScQueryParam theQueryData; + ScQueryItem* pOutItem; + ScViewData* pViewData; + ScDocument* pDoc; + SCTAB nSrcTab; + + sal_uInt16 nFieldCount; + ComboBox* aValueEdArr[3]; + ListBox* aFieldLbArr[3]; + ListBox* aCondLbArr[3]; + + TypedScStrCollection* pEntryLists[MAXCOLCOUNT]; + +#ifdef _PFILTDLG_CXX +private: + void Init ( const SfxItemSet& rArgSet ); + void FillFieldLists (); + void UpdateValueList ( sal_uInt16 nList ); + void ClearValueList ( sal_uInt16 nList ); + sal_uInt16 GetFieldSelPos ( SCCOL nField ); + + // Handler: + DECL_LINK( LbSelectHdl, ListBox* ); + DECL_LINK( ValModifyHdl, ComboBox* ); + DECL_LINK( CheckBoxHdl, CheckBox* ); +#endif +}; + + +#endif // SC_PFILTDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/pfuncache.hxx b/sc/source/ui/inc/pfuncache.hxx new file mode 100644 index 000000000000..b64e9753e43d --- /dev/null +++ b/sc/source/ui/inc/pfuncache.hxx @@ -0,0 +1,127 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PFUNCACHE_HXX +#define SC_PFUNCACHE_HXX + +#include <vector> +#include <tools/gen.hxx> +#include "rangelst.hxx" +#include "printopt.hxx" + +class ScDocShell; +class ScMarkData; + + +/** Possible types of selection for print functions */ + +enum ScPrintSelectionMode +{ + SC_PRINTSEL_INVALID, + SC_PRINTSEL_DOCUMENT, + SC_PRINTSEL_CURSOR, + SC_PRINTSEL_RANGE, + SC_PRINTSEL_RANGE_EXCLUSIVELY_OLE_AND_DRAW_OBJECTS +}; + + +/** Stores the selection in the ScPrintFuncCache so it is only used + for the same selection again. */ + +class ScPrintSelectionStatus +{ + ScPrintSelectionMode eMode; + ScRangeList aRanges; + ScPrintOptions aOptions; + +public: + ScPrintSelectionStatus() : eMode(SC_PRINTSEL_INVALID) {} + ~ScPrintSelectionStatus() {} + + void SetMode(ScPrintSelectionMode eNew) { eMode = eNew; } + void SetRanges(const ScRangeList& rNew) { aRanges = rNew; } + void SetOptions(const ScPrintOptions& rNew) { aOptions = rNew; } + + sal_Bool operator==(const ScPrintSelectionStatus& rOther) const + { return eMode == rOther.eMode && aRanges == rOther.aRanges && aOptions == rOther.aOptions; } + + ScPrintSelectionMode GetMode() const { return eMode; } + const ScPrintOptions& GetOptions() const { return aOptions; } +}; + + +/** The range that is printed on a page (excluding repeated columns/rows), + and its position on the page, used to find hyperlink targets. */ + +struct ScPrintPageLocation +{ + long nPage; + ScRange aCellRange; + Rectangle aRectangle; // pixels + + ScPrintPageLocation() : + nPage(-1) {} // default: invalid + + ScPrintPageLocation( long nP, const ScRange& rRange, const Rectangle& rRect ) : + nPage(nP), aCellRange(rRange), aRectangle(rRect) {} +}; + + +/** Stores the data for printing that is needed from several sheets, + so it doesn't have to be calculated for rendering each page. */ + +class ScPrintFuncCache +{ + ScPrintSelectionStatus aSelection; + ScDocShell* pDocSh; + long nTotalPages; + long nPages[MAXTABCOUNT]; + long nFirstAttr[MAXTABCOUNT]; + std::vector<ScPrintPageLocation> aLocations; + bool bLocInitialized; + +public: + ScPrintFuncCache( ScDocShell* pD, const ScMarkData& rMark, + const ScPrintSelectionStatus& rStatus ); + ~ScPrintFuncCache(); + + sal_Bool IsSameSelection( const ScPrintSelectionStatus& rStatus ) const; + + void InitLocations( const ScMarkData& rMark, OutputDevice* pDev ); + bool FindLocation( const ScAddress& rCell, ScPrintPageLocation& rLocation ) const; + + long GetPageCount() const { return nTotalPages; } + long GetFirstAttr( SCTAB nTab ) const { return nFirstAttr[nTab]; } + SCTAB GetTabForPage( long nPage ) const; + long GetTabStart( SCTAB nTab ) const; + long GetDisplayStart( SCTAB nTab ) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/pgbrksh.hxx b/sc/source/ui/inc/pgbrksh.hxx new file mode 100644 index 000000000000..bca834c27eb0 --- /dev/null +++ b/sc/source/ui/inc/pgbrksh.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PGBRKSH_HXX +#define SC_PGBRKSH_HXX + +#include <sfx2/module.hxx> +#include <sfx2/shell.hxx> + +#include "shellids.hxx" + +class ScTabViewShell; + +class ScPageBreakShell : public SfxShell +{ +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_PAGEBREAK_SHELL) + + ScPageBreakShell( ScTabViewShell* pView ); + ~ScPageBreakShell(); + +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/pivotsh.hxx b/sc/source/ui/inc/pivotsh.hxx new file mode 100644 index 000000000000..fff0f99ad388 --- /dev/null +++ b/sc/source/ui/inc/pivotsh.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PIVOTSH_HXX +#define SC_PIVOTSH_HXX + +#include <sfx2/module.hxx> +#include <sfx2/shell.hxx> + +#include "shellids.hxx" + +class ScTabViewShell; +class ScDPObject; + +class ScPivotShell : public SfxShell +{ +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_PIVOT_SHELL) + + ScPivotShell( ScTabViewShell* pView ); + ~ScPivotShell(); + + void Execute ( SfxRequest& rReq ); + void GetState( SfxItemSet& rSet ); + +private: + ScTabViewShell* pViewShell; + + ScDPObject* GetCurrDPObject(); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/pntlock.hxx b/sc/source/ui/inc/pntlock.hxx new file mode 100644 index 000000000000..d88d89d745d7 --- /dev/null +++ b/sc/source/ui/inc/pntlock.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PNTLOCK_HXX +#define SC_PNTLOCK_HXX + +#include "rangelst.hxx" + +class ScPaintLockData +{ +private: + ScRangeListRef xRangeList; + sal_uInt16 nMode; + sal_uInt16 nLevel; + sal_uInt16 nDocLevel; + sal_uInt16 nParts; + sal_Bool bModified; + +public: + ScPaintLockData(sal_uInt16 nNewMode); + ~ScPaintLockData(); + + void AddRange( const ScRange& rRange, sal_uInt16 nP ); + + void SetModified() { bModified = sal_True; } + void IncLevel(sal_Bool bDoc) + { if (bDoc) ++nDocLevel; else ++nLevel; } + void DecLevel(sal_Bool bDoc) + { if (bDoc) --nDocLevel; else --nLevel; } + + const ScRangeListRef& GetRangeList() const { return xRangeList; } + sal_uInt16 GetParts() const { return nParts; } + sal_uInt16 GetLevel(sal_Bool bDoc) const + { return bDoc ? nDocLevel : nLevel; } + sal_Bool GetModified() const { return bModified; } + + // fuer Wiederherstellen nach Reset + void SetLevel(sal_uInt16 nNew, sal_Bool bDoc) + { if (bDoc) nDocLevel = nNew; else nLevel = nNew; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/popmenu.hxx b/sc/source/ui/inc/popmenu.hxx new file mode 100644 index 000000000000..a7ee2d7bfd3e --- /dev/null +++ b/sc/source/ui/inc/popmenu.hxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_POPMENU_HXX +#define SC_POPMENU_HXX + +#include <vcl/menu.hxx> +#include "scdllapi.h" + +class SC_DLLPUBLIC ScPopupMenu : public PopupMenu +{ +private: + sal_uInt16 nSel; + sal_Bool bHit; +protected: + virtual void Select(); +public: + ScPopupMenu() : nSel(0),bHit(false) {} + ScPopupMenu(const ResId& rRes) : PopupMenu(rRes),nSel(0),bHit(false) {} + sal_uInt16 GetSelected() const { return nSel; } + sal_Bool WasHit() const { return bHit; } +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/preview.hxx b/sc/source/ui/inc/preview.hxx new file mode 100644 index 000000000000..6988259526d0 --- /dev/null +++ b/sc/source/ui/inc/preview.hxx @@ -0,0 +1,173 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_PREVIEW_HXX +#define SC_PREVIEW_HXX + + +#include <vcl/window.hxx> +#include "printfun.hxx" // ScPrintState + +class ScDocShell; +class ScPreviewShell; +class FmFormView; + +class ScPreview : public Window +{ +private: + // eingestellt: + long nPageNo; // Seite im Dokument + sal_uInt16 nZoom; // eingestellter Zoom + Point aOffset; // positiv + + // berechnet: + sal_Bool bValid; // folgende Werte gueltig + SCTAB nTabCount; + SCTAB nTabsTested; // fuer wieviele Tabellen ist nPages gueltig? + long nPages[MAXTABCOUNT]; + long nFirstAttr[MAXTABCOUNT]; + SCTAB nTab; // Tabelle + long nTabPage; // Seite von Tabelle + long nTabStart; // erste Seite der Tabelle (wirklich) + long nDisplayStart; // dito, relativ zum Anfang der Zaehlung + Date aDate; + Time aTime; + long nTotalPages; + Size aPageSize; // fuer GetOptimalZoom + sal_Bool bStateValid; + sal_Bool bLocationValid; + ScPrintState aState; + ScPreviewLocationData* pLocationData; // stores table layout for accessibility API + FmFormView* pDrawView; + + SCTAB nCurTab; + + // intern: + sal_Bool bInPaint; + sal_Bool bInGetState; + ScDocShell* pDocShell; + ScPreviewShell* pViewShell; + + sal_Bool bLeftRulerMove; + sal_Bool bRightRulerMove; + sal_Bool bTopRulerMove; + sal_Bool bBottomRulerMove; + sal_Bool bHeaderRulerMove; + sal_Bool bFooterRulerMove; + + sal_Bool bLeftRulerChange; + sal_Bool bRightRulerChange; + sal_Bool bTopRulerChange; + sal_Bool bBottomRulerChange; + sal_Bool bHeaderRulerChange; + sal_Bool bFooterRulerChange; + sal_Bool bPageMargin; + sal_Bool bColRulerMove; + ScRange aPageArea; + long nRight[ MAXCOL+1 ]; + long nLeftPosition; + long mnScale; + SCCOL nColNumberButttonDown; + Point aButtonDownChangePoint; + Point aButtonDownPt; + Point aButtonUpPt; + long nHeaderHeight; + long nFooterHeight; + + void TestLastPage(); + void CalcPages( SCTAB nToWhichTab ); + void RecalcPages(); + void UpdateDrawView(); + void DoPrint( ScPreviewLocationData* pFillLocation ); + + void InvalidateLocationData( sal_uLong nId ); + + using Window::SetZoom; + +protected: + virtual void Paint( const Rectangle& rRect ); + virtual void Command( const CommandEvent& rCEvt ); + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + + virtual void GetFocus(); + virtual void LoseFocus(); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + +public: + ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pViewSh ); + ~ScPreview(); + + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + + void DataChanged(sal_Bool bNewTime = false); // statt Invalidate rufen + void DoInvalidate(); + + void SetXOffset( long nX ); + void SetYOffset( long nY ); + void SetZoom(sal_uInt16 nNewZoom); + void SetPageNo( long nPage ); + + sal_Bool GetPageMargins()const { return bPageMargin; } + void SetPageMargins( sal_Bool bVal ) { bPageMargin = bVal; } + void DrawInvert( long nDragPos, sal_uInt16 nFlags ); + void DragMove( long nDragMovePos, sal_uInt16 nFlags ); + + + const ScPreviewLocationData& GetLocationData(); + + String GetPosString(); + + long GetPageNo() const { return nPageNo; } + sal_uInt16 GetZoom() const { return nZoom; } + Point GetOffset() const { return aOffset; } + + SCTAB GetTab() { if (!bValid) { CalcPages(0); RecalcPages(); } return nTab; } + long GetTotalPages() { if (!bValid) { CalcPages(0); RecalcPages(); } return nTotalPages; } + + sal_Bool AllTested() const { return bValid && nTabsTested >= nTabCount; } + + sal_uInt16 GetOptimalZoom(sal_Bool bWidthOnly); + long GetFirstPage(SCTAB nTab); + + void CalcAll() { CalcPages(MAXTAB); } + void SetInGetState(sal_Bool bSet) { bInGetState = bSet; } + + DECL_STATIC_LINK( ScPreview, InvalidateHdl, void* ); + static void StaticInvalidate(); + + FmFormView* GetDrawView() { return pDrawView; } +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/prevloc.hxx b/sc/source/ui/inc/prevloc.hxx new file mode 100644 index 000000000000..936803cd88c2 --- /dev/null +++ b/sc/source/ui/inc/prevloc.hxx @@ -0,0 +1,161 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PREVLOC_HXX +#define SC_PREVLOC_HXX + +#include <boost/ptr_container/ptr_list.hpp> + +#include <sal/types.h> +#include <vcl/mapmod.hxx> + +#include "address.hxx" + +#define SC_PREVIEW_MAXRANGES 4 +#define SC_PREVIEW_RANGE_EDGE 0 +#define SC_PREVIEW_RANGE_REPCOL 1 +#define SC_PREVIEW_RANGE_REPROW 2 +#define SC_PREVIEW_RANGE_TAB 3 + +class OutputDevice; +class String; +class Point; +class Rectangle; +class ScAddress; +class ScRange; +class ScDocument; +class ScPreviewLocationEntry; + +struct ScPreviewColRowInfo +{ + sal_Bool bIsHeader; + SCCOLROW nDocIndex; + long nPixelStart; + long nPixelEnd; + + void Set( sal_Bool bHeader, SCCOLROW nIndex, long nStart, long nEnd ) + { + bIsHeader = bHeader; + nDocIndex = nIndex; + nPixelStart = nStart; + nPixelEnd = nEnd; + } +}; + +class ScPreviewTableInfo +{ + SCTAB nTab; + SCCOL nCols; + SCROW nRows; + ScPreviewColRowInfo* pColInfo; + ScPreviewColRowInfo* pRowInfo; + +public: + ScPreviewTableInfo(); + ~ScPreviewTableInfo(); + + SCTAB GetTab() const { return nTab; } + SCCOL GetCols() const { return nCols; } + SCROW GetRows() const { return nRows; } + const ScPreviewColRowInfo* GetColInfo() const { return pColInfo; } + const ScPreviewColRowInfo* GetRowInfo() const { return pRowInfo; } + + void SetTab( SCTAB nNewTab ); + void SetColInfo( SCCOL nCount, ScPreviewColRowInfo* pNewInfo ); + void SetRowInfo( SCROW nCount, ScPreviewColRowInfo* pNewInfo ); + void LimitToArea( const Rectangle& rPixelArea ); +}; + + +class ScPreviewLocationData +{ + OutputDevice* pWindow; + ScDocument* pDoc; + MapMode aCellMapMode; + MapMode aDrawMapMode[SC_PREVIEW_MAXRANGES]; + Rectangle aDrawRectangle[SC_PREVIEW_MAXRANGES]; + sal_uInt8 aDrawRangeId[SC_PREVIEW_MAXRANGES]; + sal_uInt16 nDrawRanges; + SCTAB nPrintTab; + boost::ptr_list<ScPreviewLocationEntry> aEntries; + + Rectangle GetOffsetPixel( const ScAddress& rCellPos, const ScRange& rRange ) const; + +public: + ScPreviewLocationData( ScDocument* pDocument, OutputDevice* pWin ); + ~ScPreviewLocationData(); + + void SetCellMapMode( const MapMode& rMapMode ); + void SetPrintTab( SCTAB nNew ); + void Clear(); + void AddCellRange( const Rectangle& rRect, const ScRange& rRange, sal_Bool bRepCol, sal_Bool bRepRow, + const MapMode& rDrawMap ); + void AddColHeaders( const Rectangle& rRect, SCCOL nStartCol, SCCOL nEndCol, sal_Bool bRepCol ); + void AddRowHeaders( const Rectangle& rRect, SCROW nStartRow, SCROW nEndRow, sal_Bool bRepRow ); + void AddHeaderFooter( const Rectangle& rRect, sal_Bool bHeader, sal_Bool bLeft ); + void AddNoteMark( const Rectangle& rRect, const ScAddress& rPos ); + void AddNoteText( const Rectangle& rRect, const ScAddress& rPos ); + + SCTAB GetPrintTab() const { return nPrintTab; } + + // Get info on visible columns/rows in the visible area + void GetTableInfo( const Rectangle& rVisiblePixel, ScPreviewTableInfo& rInfo ) const; + + sal_uInt16 GetDrawRanges() const { return nDrawRanges; } + void GetDrawRange( sal_uInt16 nPos, Rectangle& rPixelRect, MapMode& rMapMode, sal_uInt8& rRangeId ) const; + + sal_Bool GetHeaderPosition( Rectangle& rHeaderRect ) const; + sal_Bool GetFooterPosition( Rectangle& rFooterRect ) const; + sal_Bool IsHeaderLeft() const; + sal_Bool IsFooterLeft() const; + + long GetNoteCountInRange( const Rectangle& rVisiblePixel, sal_Bool bNoteMarks ) const; + sal_Bool GetNoteInRange( const Rectangle& rVisiblePixel, long nIndex, sal_Bool bNoteMarks, + ScAddress& rCellPos, Rectangle& rNoteRect ) const; + Rectangle GetNoteInRangeOutputRect(const Rectangle& rVisiblePixel, sal_Bool bNoteMarks, + const ScAddress& aCellPos) const; + + // Check if any cells (including column/row headers) are in the visible area + sal_Bool HasCellsInRange( const Rectangle& rVisiblePixel ) const; + + sal_Bool GetCellPosition( const ScAddress& rCellPos, Rectangle& rCellRect ) const; + + // returns the rectangle where the EditEngine draws the text of a Header Cell + // if bColHeader is true it returns the rectangle of the header of the column in rCellPos + // otherwise of the header of the row in rCellPos + Rectangle GetHeaderCellOutputRect(const Rectangle& rVisRect, const ScAddress& rCellPos, sal_Bool bColHeader) const; + Rectangle GetCellOutputRect(const ScAddress& rCellPos) const; + + // Query the range and rectangle of the main (non-repeat) cell range. + // Returns sal_False if not contained. + sal_Bool GetMainCellRange( ScRange& rRange, Rectangle& rPixRect ) const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx new file mode 100644 index 000000000000..271a35260e99 --- /dev/null +++ b/sc/source/ui/inc/prevwsh.hxx @@ -0,0 +1,136 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PREVWSH_HXX +#define SC_PREVWSH_HXX + +class ScrollBar; + +#include "address.hxx" +#include <sfx2/viewfac.hxx> +#include <sfx2/viewsh.hxx> +#include <svx/zoomitem.hxx> + +#include "shellids.hxx" + +class ScDocument; +class ScDocShell; +class ScPreview; +struct ScHeaderFieldData; +class ScPreviewLocationData; +class CommandEvent; + +//================================================================== + + +class ScPreviewShell: public SfxViewShell +{ + ScDocShell* pDocShell; + + ScPreview* pPreview; // Ausgabe-Fenster + ScrollBar* pHorScroll; + ScrollBar* pVerScroll; + Window* pCorner; + + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData; // ViewData + sal_uInt8 nSourceDesignMode; // form design mode from TabView + SvxZoomType eZoom; + long nMaxVertPos; + + SfxBroadcaster* pAccessibilityBroadcaster; + +private: + void Construct( Window* pParent ); + DECL_LINK(ScrollHandler, ScrollBar* ); + void DoScroll( sal_uInt16 nMode ); + +protected: + virtual void Activate(sal_Bool bMDI); + virtual void Deactivate(sal_Bool bMDI); + + virtual void AdjustPosSizePixel( const Point &rPos, const Size &rSize ); + + virtual void InnerResizePixel( const Point &rOfs, const Size &rSize ); + virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ); + + virtual Size GetOptimalSizePixel() const; + + virtual String GetDescription() const; + + virtual void WriteUserData(String &, sal_Bool bBrowse = false); + virtual void ReadUserData(const String &, sal_Bool bBrowse = false); + + virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false ); + virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false ); + +public: + TYPEINFO(); + + SFX_DECL_INTERFACE(SCID_PREVIEW_SHELL) + SFX_DECL_VIEWFACTORY(ScPreviewShell); + + ScPreviewShell( SfxViewFrame* pViewFrame, + SfxViewShell* pOldSh ); + + virtual ~ScPreviewShell(); + + void InitStartTable(SCTAB nTab); + + void UpdateScrollBars(); + sal_Bool ScrollCommand( const CommandEvent& rCEvt ); + + void Execute( SfxRequest& rReq ); + void GetState( SfxItemSet& rSet ); + + void FillFieldData( ScHeaderFieldData& rData ); + + ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > + GetSourceData() const { return aSourceData; } + sal_uInt8 GetSourceDesignMode() const { return nSourceDesignMode; } + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + virtual SfxPrinter* GetPrinter( sal_Bool bCreate = false ); + virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); + virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); + + void AddAccessibilityObject( SfxListener& rObject ); + void RemoveAccessibilityObject( SfxListener& rObject ); + void BroadcastAccessibility( const SfxHint &rHint ); + sal_Bool HasAccessibilityObjects(); + + const ScPreviewLocationData& GetLocationData(); + ScDocument* GetDocument(); + ScPreview* GetPreview() { return pPreview; } +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx new file mode 100644 index 000000000000..84f486999315 --- /dev/null +++ b/sc/source/ui/inc/printfun.hxx @@ -0,0 +1,368 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PRINTFUN_HXX +#define SC_PRINTFUN_HXX + + +#include "pagepar.hxx" +#include "editutil.hxx" + +#include <vcl/print.hxx> + +class SfxPrinter; +class SfxProgress; +class ScDocShell; +class ScDocument; +class ScViewData; +class SfxItemSet; +class ScPageHFItem; +class EditTextObject; +class MultiSelection; +class ScHeaderEditEngine; +class ScPageBreakData; +class ScPreviewLocationData; +class ScPrintOptions; +class SvxBoxItem; +class SvxBrushItem; +class SvxShadowItem; +class FmFormView; + +#define RANGENO_NORANGE USHRT_MAX + +#define PRINT_HEADER_WIDTH (1.0 * TWIPS_PER_CM) +#define PRINT_HEADER_HEIGHT (12.8 * TWIPS_PER_POINT) +#define PRINT_HEADER_FONTHEIGHT 200 + + + // Einstellungen fuer Kopf-/Fusszeilen +struct ScPrintHFParam +{ + sal_Bool bEnable; + sal_Bool bDynamic; + sal_Bool bShared; + long nHeight; // insgesamt (Hoehe+Abstand+Rahmen) + long nManHeight; // eingestellte Groesse (Min. bei dynamisch) + sal_uInt16 nDistance; + sal_uInt16 nLeft; // Raender + sal_uInt16 nRight; + const ScPageHFItem* pLeft; + const ScPageHFItem* pRight; + const SvxBoxItem* pBorder; + const SvxBrushItem* pBack; + const SvxShadowItem* pShadow; +}; + + +// "Ersatz" fuer SV-JobSetup: + +class ScJobSetup +{ +public: + ScJobSetup( SfxPrinter* pPrinter ); + + Size aUserSize; + MapMode aUserMapMode; + Paper ePaper; + Orientation eOrientation; + sal_uInt16 nPaperBin; +}; + +struct ScPrintState // Variablen aus ScPrintFunc retten +{ + SCTAB nPrintTab; + SCCOL nStartCol; + SCROW nStartRow; + SCCOL nEndCol; + SCROW nEndRow; + sal_uInt16 nZoom; + size_t nPagesX; + size_t nPagesY; + long nTabPages; + long nTotalPages; + long nPageStart; + long nDocPages; +}; + +class ScPageRowEntry +{ +private: + SCROW nStartRow; + SCROW nEndRow; + size_t nPagesX; + sal_Bool* pHidden; + //! Anzahl wirklich sichtbarer cachen??? + +public: + ScPageRowEntry() { nStartRow = nEndRow = 0; nPagesX = 0; pHidden = NULL; } + ~ScPageRowEntry() { delete[] pHidden; } + + ScPageRowEntry(const ScPageRowEntry& r); + const ScPageRowEntry& operator=(const ScPageRowEntry& r); + + SCROW GetStartRow() const { return nStartRow; } + SCROW GetEndRow() const { return nEndRow; } + size_t GetPagesX() const { return nPagesX; } + void SetStartRow(SCROW n) { nStartRow = n; } + void SetEndRow(SCROW n) { nEndRow = n; } + + void SetPagesX(size_t nNew); + void SetHidden(size_t nX); + sal_Bool IsHidden(size_t nX) const; + + size_t CountVisible() const; +}; + +class ScPrintFunc +{ +private: + ScDocShell* pDocShell; + ScDocument* pDoc; + SfxPrinter* pPrinter; + OutputDevice* pDev; + FmFormView* pDrawView; + + MapMode aOldPrinterMode; // MapMode vor dem Aufruf + + Point aSrcOffset; // Papier-1/100 mm + Point aOffset; // mit Faktor aus Seitenformat skaliert + sal_uInt16 nManualZoom; // Zoom in Preview (Prozent) + sal_Bool bClearWin; // Ausgabe vorher loeschen + sal_Bool bUseStyleColor; + sal_Bool bIsRender; + + SCTAB nPrintTab; + long nPageStart; // Offset fuer erste Seite + long nDocPages; // Seiten im Dokument + + const ScRange* pUserArea; // Selektion, wenn im Dialog eingestellt + + const SfxItemSet* pParamSet; // eingestellte Vorlage + sal_Bool bState; // aus State-struct erzeugt + + // Parameter aus Vorlage: + sal_uInt16 nLeftMargin; + sal_uInt16 nTopMargin; + sal_uInt16 nRightMargin; + sal_uInt16 nBottomMargin; + sal_Bool bCenterHor; + sal_Bool bCenterVer; + sal_Bool bLandscape; + sal_Bool bSourceRangeValid; + + sal_uInt16 nPageUsage; + Size aPageSize; // Drucker-Twips + const SvxBoxItem* pBorderItem; + const SvxBrushItem* pBackgroundItem; + const SvxShadowItem* pShadowItem; + + ScRange aLastSourceRange; + ScPrintHFParam aHdr; + ScPrintHFParam aFtr; + ScPageTableParam aTableParam; + ScPageAreaParam aAreaParam; + + // berechnete Werte: + sal_uInt16 nZoom; + sal_Bool bPrintCurrentTable; + sal_Bool bMultiArea; + long nTabPages; + long nTotalPages; + + Rectangle aPageRect; // Dokument-Twips + + MapMode aLogicMode; // in DoPrint gesetzt + MapMode aOffsetMode; + MapMode aTwipMode; + double nScaleX; + double nScaleY; + + SCCOL nRepeatStartCol; + SCCOL nRepeatEndCol; + SCROW nRepeatStartRow; + SCROW nRepeatEndRow; + + SCCOL nStartCol; + SCROW nStartRow; + SCCOL nEndCol; + SCROW nEndRow; + + SCCOL* pPageEndX; // Seitenaufteilung + SCROW* pPageEndY; + ScPageRowEntry* pPageRows; + size_t nPagesX; + size_t nPagesY; + size_t nTotalY; + + ScHeaderEditEngine* pEditEngine; + SfxItemSet* pEditDefaults; + + ScHeaderFieldData aFieldData; + + List aNotePosList; // Reihenfolge der Notizen + + ScPageBreakData* pPageData; // zum Eintragen der Umbrueche etc. + +public: + ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTab, + long nPage = 0, long nDocP = 0, + const ScRange* pArea = NULL, + const ScPrintOptions* pOptions = NULL, + ScPageBreakData* pData = NULL ); + + // ctors for device other than printer - for preview and pdf: + + ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab, + long nPage = 0, long nDocP = 0, + const ScRange* pArea = NULL, + const ScPrintOptions* pOptions = NULL ); + + ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, + const ScPrintState& rState, + const ScPrintOptions* pOptions ); + + ScPrintFunc( ScDocShell* pShell, Window* pWindow, SCTAB nTab, + long nPage = 0, long nDocP = 0, + const ScRange* pArea = NULL, + const ScPrintOptions* pOptions = NULL ); + + ScPrintFunc( ScDocShell* pShell, Window* pWindow, + const ScPrintState& rState, + const ScPrintOptions* pOptions ); + ~ScPrintFunc(); + + static void DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double nPrintFactor, + const Rectangle& rBound, ScViewData* pViewData, sal_Bool bMetaFile ); + + void SetDrawView( FmFormView* pNew ); + + void SetOffset( const Point& rOfs ); + void SetManualZoom( sal_uInt16 nNewZoom ); + void SetDateTime( const Date& rDate, const Time& rTime ); + + void SetClearFlag( sal_Bool bFlag ); + void SetUseStyleColor( sal_Bool bFlag ); + void SetRenderFlag( sal_Bool bFlag ); + + void SetExclusivelyDrawOleAndDrawObjects();//for printing selected objects without surrounding cell contents + + sal_Bool UpdatePages(); + + void ApplyPrintSettings(); // aus DoPrint() schon gerufen + long DoPrint( const MultiSelection& rPageRanges, + /*long nStartPage, long nDisplayStart, sal_Bool bDoPrint, + SfxProgress* pProgress, ScPreviewLocationData* pLocationData );*/ + long nStartPage, long nDisplayStart, sal_Bool bDoPrint = sal_True, + SfxProgress* pProgress = NULL, ScPreviewLocationData* pLocationData = NULL); + + // Werte abfragen - sofort + + Size GetPageSize() const { return aPageSize; } + Size GetDataSize() const; + void GetScaleData( Size& rPhysSize, long& rDocHdr, long& rDocFtr ); + long GetFirstPageNo() const { return aTableParam.nFirstPageNo; } + + // letzte Werte abfragen - nach DoPrint !!! + + double GetScaleX() const { return nScaleX; } + double GetScaleY() const { return nScaleY; } + long GetTotalPages() const { return nTotalPages; } + sal_uInt16 GetZoom() const { return nZoom; } + + void ResetBreaks( SCTAB nTab ); + + void GetPrintState( ScPrintState& rState ); + sal_Bool GetLastSourceRange( ScRange& rRange ) const; + sal_uInt16 GetLeftMargin() const{return nLeftMargin;} + sal_uInt16 GetRightMargin() const{return nRightMargin;} + sal_uInt16 GetTopMargin() const{return nTopMargin;} + sal_uInt16 GetBottomMargin() const{return nBottomMargin;} + void SetLeftMargin(sal_uInt16 nRulerLeftDistance){ nLeftMargin = nRulerLeftDistance; } + void SetRightMargin(sal_uInt16 nRulerRightDistance){ nRightMargin = nRulerRightDistance; } + void SetTopMargin(sal_uInt16 nRulerTopDistance){ nTopMargin = nRulerTopDistance; } + void SetBottomMargin(sal_uInt16 nRulerBottomDistance){ nBottomMargin = nRulerBottomDistance; } + ScPrintHFParam GetHeader(){return aHdr;} + ScPrintHFParam GetFooter(){return aFtr;} + +private: + void Construct( const ScPrintOptions* pOptions ); + void InitParam( const ScPrintOptions* pOptions ); + void CalcZoom( sal_uInt16 nRangeNo ); + void CalcPages(); + long CountPages(); + long CountNotePages(); + + sal_Bool AdjustPrintArea( sal_Bool bNew ); + + Size GetDocPageSize(); + + long TextHeight( const EditTextObject* pObject ); + void MakeEditEngine(); + void UpdateHFHeight( ScPrintHFParam& rParam ); + + void InitModes(); + + sal_Bool IsLeft( long nPageNo ); + sal_Bool IsMirror( long nPageNo ); + void ReplaceFields( long nPageNo ); // aendert Text in pEditEngine + void MakeTableString(); // setzt aTableStr + + void PrintPage( long nPageNo, + SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + sal_Bool bDoPrint, ScPreviewLocationData* pLocationData ); + void PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + long nScrX, long nScrY, + sal_Bool bShLeft, sal_Bool bShTop, sal_Bool bShRight, sal_Bool bShBottom ); + void LocateArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, + long nScrX, long nScrY, sal_Bool bRepCol, sal_Bool bRepRow, + ScPreviewLocationData& rLocationData ); + void PrintColHdr( SCCOL nX1, SCCOL nX2, long nScrX, long nScrY ); + void PrintRowHdr( SCROW nY1, SCROW nY2, long nScrX, long nScrY ); + void LocateColHdr( SCCOL nX1, SCCOL nX2, long nScrX, long nScrY, + sal_Bool bRepCol, ScPreviewLocationData& rLocationData ); + void LocateRowHdr( SCROW nY1, SCROW nY2, long nScrX, long nScrY, + sal_Bool bRepRow, ScPreviewLocationData& rLocationData ); + void PrintHF( long nPageNo, sal_Bool bHeader, long nStartY, + sal_Bool bDoPrint, ScPreviewLocationData* pLocationData ); + + long PrintNotes( long nPageNo, long nNoteStart, sal_Bool bDoPrint, ScPreviewLocationData* pLocationData ); + long DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocationData* pLocationData ); + + void DrawBorder( long nScrX, long nScrY, long nScrW, long nScrH, + const SvxBoxItem* pBorderData, + const SvxBrushItem* pBackground, + const SvxShadowItem* pShadow ); + + void FillPageData(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/privsplt.hxx b/sc/source/ui/inc/privsplt.hxx new file mode 100644 index 000000000000..ff3af449551e --- /dev/null +++ b/sc/source/ui/inc/privsplt.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PRIVSPLT_HXX +#define SC_PRIVSPLT_HXX + +#include <vcl/ctrl.hxx> + +enum SC_SPLIT_DIRECTION {SC_SPLIT_HORZ,SC_SPLIT_VERT }; + +class ScPrivatSplit : public Control +{ + private: + + Link aCtrModifiedLink; + sal_Bool aMovingFlag; + Pointer aWinPointer; + SC_SPLIT_DIRECTION eScSplit; + short nOldX; + short nOldY; + short nNewX; + short nNewY; + short nMinPos; + short nMaxPos; + Range aXMovingRange; + Range aYMovingRange; + short nDeltaX; + short nDeltaY; + + using Control::ImplInitSettings; + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); + + + + protected: + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt); + + public: + + ScPrivatSplit( Window* pWindow, const ResId& rResId, + SC_SPLIT_DIRECTION eScSplit); + + virtual short GetDeltaX(); + virtual short GetDeltaY(); + + virtual void CtrModified(); + + void SetYRange(Range cRgeY); + + void MoveSplitTo(Point aPos); + + virtual void StateChanged( StateChangedType nType ); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); + + void SetCtrModifiedHdl( const Link& rLink ) { aCtrModifiedLink = rLink; } + const Link& GetCtrModifiedHdl() const { return aCtrModifiedLink; } +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/protectiondlg.hrc b/sc/source/ui/inc/protectiondlg.hrc new file mode 100644 index 000000000000..2f7cc5ee21a8 --- /dev/null +++ b/sc/source/ui/inc/protectiondlg.hrc @@ -0,0 +1,44 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <sc.hrc> + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 3 + +#define BTN_PROTECT 4 +#define FT_PASSWORD1 5 +#define ED_PASSWORD1 6 +#define FT_PASSWORD2 7 +#define ED_PASSWORD2 8 +#define FL_OPTIONS 9 +#define FT_OPTIONS 10 +#define CLB_OPTIONS 11 + +#define ST_SELECT_PROTECTED_CELLS 50 +#define ST_SELECT_UNPROTECTED_CELLS 51 diff --git a/sc/source/ui/inc/protectiondlg.hxx b/sc/source/ui/inc/protectiondlg.hxx new file mode 100644 index 000000000000..9fbedaffad07 --- /dev/null +++ b/sc/source/ui/inc/protectiondlg.hxx @@ -0,0 +1,85 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UI_PROTECTION_DLG_HXX +#define SC_UI_PROTECTION_DLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> +#include <svx/checklbx.hxx> + +class Window; +class ScTableProtection; + +class ScTableProtectionDlg : public ModalDialog +{ +public: + explicit ScTableProtectionDlg(Window* pParent); + virtual ~ScTableProtectionDlg(); + + virtual short Execute(); + + void SetDialogData(const ScTableProtection& rData); + + void WriteData(ScTableProtection& rData) const; + +private: + ScTableProtectionDlg(); // disabled + + void Init(); + + void EnableOptionalWidgets(bool bEnable = true); + + CheckBox maBtnProtect; + + FixedText maPassword1Text; + Edit maPassword1Edit; + FixedText maPassword2Text; + Edit maPassword2Edit; + + FixedLine maOptionsLine; + FixedText maOptionsText; + SvxCheckListBox maOptionsListBox; + + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + String maSelectLockedCells; + String maSelectUnlockedCells; + + DECL_LINK( OKHdl, OKButton* ); + DECL_LINK( CheckBoxHdl, CheckBox* ); + DECL_LINK( PasswordModifyHdl, Edit* ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx new file mode 100644 index 000000000000..c017bd88586a --- /dev/null +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -0,0 +1,254 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PVFUNDLG_HXX +#define SC_PVFUNDLG_HXX + +#include <com/sun/star/sheet/DataPilotFieldReference.hpp> +#include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp> + +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/morebtn.hxx> +#include <vcl/field.hxx> +#include <svtools/stdctrl.hxx> +#include <svx/checklbx.hxx> +#include <sfx2/itemconnect.hxx> +#include "pivot.hxx" + +#include <boost/unordered_map.hpp> + +// ============================================================================ + +typedef sfx::ListBoxWrapper< sal_Int32 > ScDPListBoxWrapper; + +class ScDPObject; + +// ============================================================================ + +class ScDPFunctionListBox : public MultiListBox +{ +public: + explicit ScDPFunctionListBox( Window* pParent, const ResId& rResId ); + + void SetSelection( sal_uInt16 nFuncMask ); + sal_uInt16 GetSelection() const; + +private: + void FillFunctionNames(); +}; + +// ============================================================================ + +class ScDPFunctionDlg : public ModalDialog +{ + typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > NameMapType; +public: + explicit ScDPFunctionDlg( Window* pParent, const ScDPLabelDataVector& rLabelVec, + const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ); + + sal_uInt16 GetFuncMask() const; + ::com::sun::star::sheet::DataPilotFieldReference GetFieldRef() const; + +private: + void Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ); + + const ::rtl::OUString& GetBaseFieldName(const ::rtl::OUString& rLayoutName) const; + const ::rtl::OUString& GetBaseItemName(const ::rtl::OUString& rLayoutName) const; + + /** Searches for a listbox entry, starts search at specified position. */ + sal_uInt16 FindBaseItemPos( const String& rEntry, sal_uInt16 nStartPos ) const; + + DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK( DblClickHdl, MultiListBox* ); + +private: + FixedLine maFlFunc; + ScDPFunctionListBox maLbFunc; + FixedText maFtNameLabel; + FixedInfo maFtName; + FixedLine maFlDisplay; + FixedText maFtType; + ListBox maLbType; + FixedText maFtBaseField; + ListBox maLbBaseField; + FixedText maFtBaseItem; + ListBox maLbBaseItem; + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + MoreButton maBtnMore; + + NameMapType maBaseFieldNameMap; // cache for base field display -> original name. + NameMapType maBaseItemNameMap; // cache for base item display -> original name. + + ScDPListBoxWrapper maLbTypeWrp; /// Wrapper for direct usage of API constants. + + const ScDPLabelDataVector& mrLabelVec; /// Data of all labels. + bool mbEmptyItem; /// true = Empty base item in listbox. +}; + +// ============================================================================ + +class ScDPSubtotalDlg : public ModalDialog +{ +public: + explicit ScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj, + const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData, + const ScDPNameVec& rDataFields, bool bEnableLayout ); + + sal_uInt16 GetFuncMask() const; + + void FillLabelData( ScDPLabelData& rLabelData ) const; + +private: + void Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ); + + DECL_LINK( DblClickHdl, MultiListBox* ); + DECL_LINK( RadioClickHdl, RadioButton* ); + DECL_LINK( ClickHdl, PushButton* ); + +private: + FixedLine maFlSubt; + RadioButton maRbNone; + RadioButton maRbAuto; + RadioButton maRbUser; + ScDPFunctionListBox maLbFunc; + FixedText maFtNameLabel; + FixedInfo maFtName; + CheckBox maCbShowAll; + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + PushButton maBtnOptions; + + ScDPObject& mrDPObj; /// The DataPilot object (for member names). + const ScDPNameVec& mrDataFields; /// The list of all data field names. + + ScDPLabelData maLabelData; /// Cache for sub dialog. + bool mbEnableLayout; /// true = Enable Layout mode controls. +}; + +// ============================================================================ + +class ScDPSubtotalOptDlg : public ModalDialog +{ +public: + explicit ScDPSubtotalOptDlg( Window* pParent, ScDPObject& rDPObj, + const ScDPLabelData& rLabelData, const ScDPNameVec& rDataFields, + bool bEnableLayout ); + + void FillLabelData( ScDPLabelData& rLabelData ) const; + +private: + void Init( const ScDPNameVec& rDataFields, bool bEnableLayout ); + void InitHideListBox(); + + const ::rtl::OUString& GetFieldName(const ::rtl::OUString& rLayoutName) const; + + /** Searches for a listbox entry, starts search at specified position. */ + sal_uInt16 FindListBoxEntry( const ListBox& rLBox, const String& rEntry, sal_uInt16 nStartPos ) const; + + DECL_LINK( RadioClickHdl, RadioButton* ); + DECL_LINK( CheckHdl, CheckBox* ); + DECL_LINK( SelectHdl, ListBox* ); + +private: + FixedLine maFlSortBy; + ListBox maLbSortBy; + RadioButton maRbSortAsc; + RadioButton maRbSortDesc; + RadioButton maRbSortMan; + FixedLine maFlLayout; + FixedText maFtLayout; + ListBox maLbLayout; + CheckBox maCbLayoutEmpty; + FixedLine maFlAutoShow; + CheckBox maCbShow; + NumericField maNfShow; + FixedText maFtShow; + FixedText maFtShowFrom; + ListBox maLbShowFrom; + FixedText maFtShowUsing; + ListBox maLbShowUsing; + FixedLine maFlHide; + SvxCheckListBox maLbHide; + FixedText maFtHierarchy; + ListBox maLbHierarchy; + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + ScDPListBoxWrapper maLbLayoutWrp; /// Wrapper for direct usage of API constants. + ScDPListBoxWrapper maLbShowFromWrp; /// Wrapper for direct usage of API constants. + + ScDPObject& mrDPObj; /// The DataPilot object (for member names). + ScDPLabelData maLabelData; /// Cache for members data. + + typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > NameMapType; + NameMapType maDataFieldNameMap; /// Cache for displayed name to field name mapping. +}; + +// ============================================================================ + +class ScDPShowDetailDlg : public ModalDialog +{ +public: + explicit ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, sal_uInt16 nOrient ); + + virtual short Execute(); + + /** + * @return String internal name of the selected field. Note that this may + * be different from the name displayed in the dialog if the field + * has a layout name. + */ + String GetDimensionName() const; + +private: + DECL_LINK( DblClickHdl, ListBox* ); + +private: + FixedText maFtDims; + ListBox maLbDims; + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + typedef ::boost::unordered_map<String, long, ScStringHashCode> DimNameIndexMap; + DimNameIndexMap maNameIndexMap; + ScDPObject& mrDPObj; +}; + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx new file mode 100644 index 000000000000..875f25dbcde1 --- /dev/null +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -0,0 +1,255 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_PVLAYDLG_HXX +#define SC_PVLAYDLG_HXX + +#include <vector> +#include <memory> +#include <boost/shared_ptr.hpp> + +#include <vcl/lstbox.hxx> +#include <vcl/scrbar.hxx> +#include <svtools/stdctrl.hxx> +#include <vcl/morebtn.hxx> +#include "pivot.hxx" +#include "anyrefdg.hxx" +#include "fieldwnd.hxx" +#include "formula/funcutl.hxx" + +/*==========================================================================*\ + + Eine Instanz der Klasse ScPivotLayoutDlg ist ein (semi-)modaler + Dialog, in dem mit der Maus Felder mit Spaltenueberschriften den + drei Pivot-Kategorien "Spalte", "Zeile" und "Daten" zugeordnet + werden koennen. + + Der Dialog erhaelt in der Struktur LabelData Informationen ueber + diese Ueberschriften (Name, Art (Zahl/String) und Funktionsmaske). + Weiterhin werden drei PivotFeld-Arrays uebergeben, mit denen die + drei Kategorie-Fenster initialisiert werden. Ein Kategorie-Fenster + wird durch eine Instanz der Klasse FieldWindow dargestellt. Ein + solches Fenster ist fuer die Darstellung der Datenstrukturen am + Schirm zustaendig. Es meldet Mausaktionen an den Dialog weiter und + bietet entsprechende Methoden zur Veraenderung der Darstellung. + Der Dialog sorgt fuer den Abgleich der interenen Datenstrukturen mit + der Bildschirmdarstellung. Ein weiteres FieldWindow (Select) bietet + alle Tabellenueberschriften zur Auswahl an, ist also "read-only". + +\*==========================================================================*/ + +//============================================================================ + +class ScViewData; +class ScDocument; +class ScRangeData; +struct ScDPFuncData; +class ScDPObject; + +//============================================================================ + +class ScDPLayoutDlg : public ScAnyRefDlg +{ + /** data source type */ + enum DataSrcType { + SRC_REF, /// range reference + SRC_NAME, /// range name + SRC_INVALID /// invalid range + }; +public: + ScDPLayoutDlg( + SfxBindings* pB, + SfxChildWindow* pCW, + Window* pParent, + const ScDPObject& rDPObject, + bool bNewOutput ); + virtual ~ScDPLayoutDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + virtual sal_Bool IsRefInputMode() const { return bRefInputMode; } + virtual void SetActive(); + virtual sal_Bool Close(); + virtual void StateChanged( StateChangedType nStateChange ); + + void NotifyDoubleClick ( ScDPFieldType eType, size_t nFieldIndex ); + PointerStyle NotifyMouseButtonDown( ScDPFieldType eType, size_t nFieldIndex ); + void NotifyMouseButtonUp ( const Point& rAt ); + PointerStyle NotifyMouseMove ( const Point& rAt ); + void NotifyFieldFocus ( ScDPFieldType eType, sal_Bool bGotFocus ); + void NotifyMoveFieldToEnd ( ScDPFieldType eToType ); + void NotifyRemoveField ( ScDPFieldType eType, size_t nFieldIndex ); + + Size GetStdFieldBtnSize() const; + +protected: + virtual void Deactivate(); + +private: + typedef boost::shared_ptr< ScDPFuncData > ScDPFuncDataRef; + typedef std::vector< ScDPFuncDataRef > ScDPFuncDataVec; + typedef std::auto_ptr< ScDPObject > ScDPObjectPtr; + + FixedLine aFlLayout; + FixedText aFtPage; + ScDPPageFieldControl aWndPage; + FixedText aFtCol; + ScDPColFieldControl aWndCol; + FixedText aFtRow; + ScDPRowFieldControl aWndRow; + FixedText aFtData; + ScDPDataFieldControl aWndData; + ScDPSelectFieldControl aWndSelect; + FixedInfo aFtInfo; + + FixedLine aFlAreas; + + // DP source selection + FixedText aFtInArea; + ::formula::RefEdit aEdInPos; + ::formula::RefButton aRbInPos; + + // DP output location + ListBox aLbOutPos; + FixedText aFtOutArea; + formula::RefEdit aEdOutPos; + formula::RefButton aRbOutPos; + + CheckBox aBtnIgnEmptyRows; + CheckBox aBtnDetectCat; + CheckBox aBtnTotalCol; + CheckBox aBtnTotalRow; + CheckBox aBtnFilter; + CheckBox aBtnDrillDown; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + PushButton aBtnRemove; + PushButton aBtnOptions; + MoreButton aBtnMore; + + const String aStrUndefined; + const String aStrNewTable; + std::vector< String > aFuncNameArr; + + ScDPFieldType eDnDFromType; + size_t nDnDFromIndex; + sal_Bool bIsDrag; + + ::formula::RefEdit* pEditActive; + + Rectangle aRectPage; + Rectangle aRectRow; + Rectangle aRectCol; + Rectangle aRectData; + Rectangle aRectSelect; + + ScDPLabelDataVec aLabelDataArr; // (nCol, Feldname, Zahl/Text) + + ScDPFieldType eLastActiveType; /// Type of last active area. + size_t nOffset; /// Offset of first field in TYPE_SELECT area. + + ScDPFuncDataVec aSelectArr; + ScDPFuncDataVec aPageArr; + ScDPFuncDataVec aColArr; + ScDPFuncDataVec aRowArr; + ScDPFuncDataVec aDataArr; + + long mnFieldObjSpace; + + ScDPObjectPtr xDlgDPObject; + ScRange aOldRange; + ScPivotParam thePivotData; + ScViewData* pViewData; + ScDocument* pDoc; + bool bRefInputMode; + +private: + void Init (bool bNewOutput); + void InitWndSelect ( const ::std::vector<ScDPLabelDataRef>& rLabels ); + void InitFieldWindow ( const ::std::vector<PivotField>& rFields, ScDPFieldType eType ); + void InitFocus (); + void InitFields (); + void CalcWndSizes (); + Point DlgPos2WndPos ( const Point& rPt, Window& rWnd ); + ScDPLabelData* GetLabelData ( SCsCOL nCol, size_t* pPos = NULL ); + String GetLabelString ( SCsCOL nCol ); + bool IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType ); + String GetFuncString ( sal_uInt16& rFuncMask, sal_Bool bIsValue = true ); + sal_Bool Contains ( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt ); + void Remove ( ScDPFuncDataVec* pArr, size_t nAt ); + void Insert ( ScDPFuncDataVec* pArr, const ScDPFuncData& rFData, size_t nAt ); + + void AddField ( size_t nFromIndex, + ScDPFieldType eToType, const Point& rAtPos ); + void AppendField(size_t nFromIndex, ScDPFieldType eToType); + void MoveField ( ScDPFieldType eFromType, size_t nFromIndex, + ScDPFieldType eToType, const Point& rAtPos ); + void MoveFieldToEnd(ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType); + void RemoveField ( ScDPFieldType eRemType, size_t nRemIndex ); + + bool GetPivotArrays( ::std::vector<PivotField>& rPageFields, + ::std::vector<PivotField>& rColFields, + ::std::vector<PivotField>& rRowFields, + ::std::vector<PivotField>& rDataFields ); + + void UpdateSrcRange(); + void RepaintFieldWindows(); + + ScDPFieldControlBase* GetFieldWindow(ScDPFieldType eType); + + /** + * Get pointers to field windows that are <b>not</b> the window of + * specified type. The select window type is not included. + */ + void GetOtherFieldWindows( + ScDPFieldType eType, ScDPFieldControlBase*& rpWnd1, ScDPFieldControlBase*& rpWnd2); + + ScDPFuncDataVec* GetFieldDataArray(ScDPFieldType eType); + + /** + * Like GetOtherFieldWindows(), get pointers to data arrays of the fields + * that are <b>not</b> the specified field type. + */ + void GetOtherDataArrays( + ScDPFieldType eType, ScDPFuncDataVec*& rpArr1, ScDPFuncDataVec*& rpArr2); + + // Handler + DECL_LINK( ClickHdl, PushButton * ); + DECL_LINK( SelAreaHdl, ListBox * ); + DECL_LINK( MoreClickHdl, MoreButton * ); + DECL_LINK( EdModifyHdl, Edit * ); + DECL_LINK( EdInModifyHdl, Edit * ); + DECL_LINK( OkHdl, OKButton * ); + DECL_LINK( CancelHdl, CancelButton * ); + DECL_LINK( GetFocusHdl, Control* ); +}; + +#endif // SC_PVLAYDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/redcom.hxx b/sc/source/ui/inc/redcom.hxx new file mode 100644 index 000000000000..c02a06b9ffec --- /dev/null +++ b/sc/source/ui/inc/redcom.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_REDCOM_HXX +#define SC_REDCOM_HXX + +#include "chgtrack.hxx" + +class ScDocShell; +class AbstractSvxPostItDialog; + +class ScRedComDialog +{ +private: + + ScChangeAction *pChangeAction; + ScDocShell *pDocShell; + String aComment; + AbstractSvxPostItDialog* pDlg; + + DECL_LINK( PrevHdl, AbstractSvxPostItDialog* ); + DECL_LINK( NextHdl, AbstractSvxPostItDialog* ); + +protected: + + void ReInit(ScChangeAction *); + void SelectCell(); + + ScChangeAction *FindPrev(ScChangeAction *pAction); + ScChangeAction *FindNext(ScChangeAction *pAction); + +public: + + ScRedComDialog( Window* pParent, const SfxItemSet& rCoreSet, + ScDocShell *,ScChangeAction *,sal_Bool bPrevNext = false); + ~ScRedComDialog(); + + short Execute(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx new file mode 100644 index 000000000000..fc30485dbe92 --- /dev/null +++ b/sc/source/ui/inc/reffact.hxx @@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_REFFACT_HXX +#define SC_REFFACT_HXX + +#include <sfx2/childwin.hxx> + +#include "dbfunc.hxx" + +#define DECL_WRAPPER(Class) \ + class Class : public SfxChildWindow \ + { \ + public: \ + Class( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* ); \ + SFX_DECL_CHILDWINDOW(Class); \ + }; + + +//================================================================== + +DECL_WRAPPER(ScNameDlgWrapper) +DECL_WRAPPER(ScSolverDlgWrapper) +DECL_WRAPPER(ScOptSolverDlgWrapper) +DECL_WRAPPER(ScPivotLayoutWrapper) +DECL_WRAPPER(ScTabOpDlgWrapper) +DECL_WRAPPER(ScFilterDlgWrapper) +DECL_WRAPPER(ScSpecialFilterDlgWrapper) +DECL_WRAPPER(ScDbNameDlgWrapper) +DECL_WRAPPER(ScConsolidateDlgWrapper) +DECL_WRAPPER(ScPrintAreasDlgWrapper) +DECL_WRAPPER(ScCondFormatDlgWrapper) +DECL_WRAPPER(ScColRowNameRangesDlgWrapper) +DECL_WRAPPER(ScFormulaDlgWrapper) +DECL_WRAPPER(ScHighlightChgDlgWrapper) + +/*!!! dafuer muss der Funktionsautopilot noch umgebaut werden +DECL_WRAPPER(ScFunctionDlgWrapper) +DECL_WRAPPER(ScEditFunctionDlgWrapper) +DECL_WRAPPER(ScArgumentDlgWrapper) +*/ + +class ScAcceptChgDlgWrapper: public SfxChildWindow +{ + public: + ScAcceptChgDlgWrapper( Window*, + sal_uInt16, + SfxBindings*, + SfxChildWinInfo* ); + + SFX_DECL_CHILDWINDOW(Class); + + virtual void ReInitDlg(); +}; + +class ScSimpleRefDlgWrapper: public SfxChildWindow +{ + public: + ScSimpleRefDlgWrapper( Window*, + sal_uInt16, + SfxBindings*, + SfxChildWinInfo* ); + + SFX_DECL_CHILDWINDOW(Class); + + static void SetDefaultPosSize(Point aPos, Size aSize, sal_Bool bSet=sal_True); + virtual String GetRefString(); + virtual void SetRefString(const String& rStr); + void SetCloseHdl( const Link& rLink ); + void SetUnoLinks( const Link& rDone, const Link& rAbort, + const Link& rChange ); + void SetFlags( sal_Bool bCloseOnButtonUp, sal_Bool bSingleCell, sal_Bool bMultiSelection ); + static void SetAutoReOpen(sal_Bool bFlag); + + void StartRefInput(); +}; + +class SC_DLLPUBLIC ScValidityRefChildWin : public SfxChildWindow +{ + bool m_bVisibleLock:1; + bool m_bFreeWindowLock:1; + Window * m_pSavedWndParent; +public: + ScValidityRefChildWin( Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* ); + SFX_DECL_CHILDWINDOW(ScValidityRefChildWin); + ~ScValidityRefChildWin(); + bool LockVisible( bool bLock ){ bool bVis = m_bVisibleLock; m_bVisibleLock = bLock; return bVis; } + bool LockFreeWindow( bool bLock ){ bool bFreeWindow = m_bFreeWindowLock; m_bFreeWindowLock = bLock; return bFreeWindow; } + void Hide(){ if( !m_bVisibleLock) SfxChildWindow::Hide(); } + void Show( sal_uInt16 nFlags ){ if( !m_bVisibleLock ) SfxChildWindow::Show( nFlags ); } +}; + +//================================================================== + + +#endif // SC_REFFACT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/refundo.hxx b/sc/source/ui/inc/refundo.hxx new file mode 100644 index 000000000000..25de386d023e --- /dev/null +++ b/sc/source/ui/inc/refundo.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_REFUNDO_HXX +#define SC_REFUNDO_HXX + +#include <tools/solar.h> + +class ScDocument; +class ScDBCollection; +class ScRangeName; +class ScPrintRangeSaver; +class ScDPCollection; +class ScChartCollection; +class ScConditionalFormatList; +class ScDetOpList; +class ScChartListenerCollection; +class ScAreaLinkSaveCollection; +class ScUnoRefList; + +class ScRefUndoData +{ +private: + ScDBCollection* pDBCollection; + ScRangeName* pRangeName; + ScPrintRangeSaver* pPrintRanges; + ScDPCollection* pDPCollection; + ScConditionalFormatList* pCondFormList; + ScDetOpList* pDetOpList; + ScChartListenerCollection* pChartListenerCollection; + ScAreaLinkSaveCollection* pAreaLinks; + ScUnoRefList* pUnoRefs; + +public: + ScRefUndoData( const ScDocument* pDoc ); + ~ScRefUndoData(); + + void DeleteUnchanged( const ScDocument* pDoc ); + void DoUndo( ScDocument* pDoc, sal_Bool bUndoRefFirst ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/retypepassdlg.hrc b/sc/source/ui/inc/retypepassdlg.hrc new file mode 100644 index 000000000000..f027b6bc7ded --- /dev/null +++ b/sc/source/ui/inc/retypepassdlg.hrc @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <sc.hrc> + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 3 + +#define FT_DESC 10 +#define FL_DOCUMENT 11 +#define FT_DOCSTATUS 12 +#define BTN_RETYPE_DOC 13 + +#define FL_SHEET 112 + +#define FT_SHEETNAME1 113 +#define FT_SHEETSTATUS1 114 +#define BTN_RETYPE_SHEET1 115 + +#define FT_SHEETNAME2 116 +#define FT_SHEETSTATUS2 117 +#define BTN_RETYPE_SHEET2 118 + +#define FT_SHEETNAME3 119 +#define FT_SHEETSTATUS3 120 +#define BTN_RETYPE_SHEET3 121 + +#define FT_SHEETNAME4 122 +#define FT_SHEETSTATUS4 123 +#define BTN_RETYPE_SHEET4 124 + +#define SB_SCROLL 190 + +#define STR_NOT_PROTECTED 200 +#define STR_NOT_PASS_PROTECTED 201 +#define STR_HASH_BAD 202 +#define STR_HASH_GOOD 203 +#define STR_HASH_REGENERATED 204 + +#define FT_PASSWORD1 301 +#define ED_PASSWORD1 302 +#define FT_PASSWORD2 303 +#define ED_PASSWORD2 304 +#define BTN_MATCH_OLD_PASSWORD 305 +#define BTN_RETYPE_PASSWORD 306 +#define BTN_REMOVE_PASSWORD 307 diff --git a/sc/source/ui/inc/retypepassdlg.hxx b/sc/source/ui/inc/retypepassdlg.hxx new file mode 100644 index 000000000000..92a41599821f --- /dev/null +++ b/sc/source/ui/inc/retypepassdlg.hxx @@ -0,0 +1,177 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UI_RETYPEPASS_DLG_HXX +#define SC_UI_RETYPEPASS_DLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> +#include <vcl/scrbar.hxx> +#include <svx/checklbx.hxx> +#include <svtools/stdctrl.hxx> + +#include "tabprotection.hxx" + +#include <boost/shared_ptr.hpp> + +class Window; +class ScDocProtection; +class ScTableProtection; +class ScDocument; + +class ScRetypePassDlg : public ModalDialog +{ +public: + typedef ::boost::shared_ptr<ScDocProtection> DocProtectionPtr; + typedef ::boost::shared_ptr<ScTableProtection> TabProtectionPtr; + + explicit ScRetypePassDlg(Window* pParent); + virtual ~ScRetypePassDlg(); + + virtual short Execute(); + + void SetDataFromDocument(const ScDocument& rDoc); + void SetDesiredHash(ScPasswordHash eHash); + + /** Write the new set of password data to the document instance to + overwrite the current ones. */ + void WriteNewDataToDocument(ScDocument& rDoc) const; + +private: + ScRetypePassDlg(); // disabled + + void Init(); + void PopulateDialog(); + void SetDocData(); + void SetTableData(size_t nRowPos, SCTAB nTab); + void ResetTableRows(); + + /** Check the status of all hash values to see if it's okay to enable + the OK button. */ + void CheckHashStatus(); + +private: + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + FixedInfo maTextDescription; + + FixedLine maLineDocument; + FixedText maTextDocStatus; + PushButton maBtnRetypeDoc; + + FixedLine maLineSheet; + FixedText maTextSheetName1; + FixedText maTextSheetStatus1; + PushButton maBtnRetypeSheet1; + + FixedText maTextSheetName2; + FixedText maTextSheetStatus2; + PushButton maBtnRetypeSheet2; + + FixedText maTextSheetName3; + FixedText maTextSheetStatus3; + PushButton maBtnRetypeSheet3; + + FixedText maTextSheetName4; + FixedText maTextSheetStatus4; + PushButton maBtnRetypeSheet4; + + ScrollBar maScrollBar; + + String maTextNotProtected; + String maTextNotPassProtected; + String maTextHashBad; + String maTextHashGood; + String maTextHashRegen; + + DECL_LINK( OKHdl, OKButton* ); + DECL_LINK( RetypeBtnHdl, PushButton* ); + DECL_LINK( ScrollHdl, ScrollBar* ); + + struct TableItem + { + String maName; + TabProtectionPtr mpProtect; + }; + ::std::vector<TableItem> maTableItems; + + DocProtectionPtr mpDocItem; + size_t mnCurScrollPos; + ScPasswordHash meDesiredHash; +}; + +// ============================================================================ + +class ScRetypePassInputDlg : public ModalDialog +{ +public: + explicit ScRetypePassInputDlg(Window* pParent, ScPassHashProtectable* pProtected); + virtual ~ScRetypePassInputDlg(); + + virtual short Execute(); + + bool IsRemovePassword() const; + String GetNewPassword() const; + +private: + ScRetypePassInputDlg(); // disabled + + void Init(); + void CheckPasswordInput(); + +private: + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + RadioButton maBtnRetypePassword; + + FixedText maPassword1Text; + Edit maPassword1Edit; + FixedText maPassword2Text; + Edit maPassword2Edit; + + CheckBox maBtnMatchOldPass; + + RadioButton maBtnRemovePassword; + + DECL_LINK( OKHdl, OKButton* ); + DECL_LINK( RadioBtnHdl, RadioButton* ); + DECL_LINK( CheckBoxHdl, CheckBox* ); + DECL_LINK( PasswordModifyHdl, Edit* ); + + ScPassHashProtectable* mpProtected; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/rfindlst.hxx b/sc/source/ui/inc/rfindlst.hxx new file mode 100644 index 000000000000..fed5f21e2b0e --- /dev/null +++ b/sc/source/ui/inc/rfindlst.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_RFINDLST_HXX +#define SC_RFINDLST_HXX + +#include <tools/color.hxx> +#include "global.hxx" +#include "address.hxx" + +//================================================================== + +struct ScRangeFindData +{ + ScRange aRef; + sal_uInt16 nFlags; + xub_StrLen nSelStart; + xub_StrLen nSelEnd; + + ScRangeFindData( const ScRange& rR, sal_uInt16 nF, xub_StrLen nS, xub_StrLen nE ) : + aRef(rR), nFlags(nF), nSelStart(nS), nSelEnd(nE) {} +}; + +class ScRangeFindList +{ + List aEntries; + String aDocName; + bool bHidden; + +public: + ScRangeFindList(const String& rName); + ~ScRangeFindList(); + + sal_uLong Count() const { return aEntries.Count(); } + void Insert( ScRangeFindData* pNew ) { aEntries.Insert(pNew, LIST_APPEND); } + ScRangeFindData* GetObject( sal_uLong nIndex ) const + { return (ScRangeFindData*)aEntries.GetObject(nIndex); } + + void SetHidden( sal_Bool bSet ) { bHidden = bSet; } + + const String& GetDocName() const { return aDocName; } + bool IsHidden() const { return bHidden; } + + static ColorData GetColorName( size_t nIndex ); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/scendlg.hxx b/sc/source/ui/inc/scendlg.hxx new file mode 100644 index 000000000000..e9acea5c11aa --- /dev/null +++ b/sc/source/ui/inc/scendlg.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SCENDLG_HXX +#define SC_SCENDLG_HXX + + +#include <vcl/dialog.hxx> +#include <vcl/edit.hxx> +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include <svtools/svmedit.hxx> +#include <svtools/ctrlbox.hxx> + +//=================================================================== + +class ScNewScenarioDlg : public ModalDialog +{ +public: + ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bool bEdit = false, sal_Bool bSheetProtected = false ); + ~ScNewScenarioDlg(); + + void SetScenarioData( const String& rName, const String& rComment, + const Color& rColor, sal_uInt16 nFlags ); + + void GetScenarioData( String& rName, String& rComment, + Color& rColor, sal_uInt16& rFlags ) const; + +private: + FixedLine aFlName; + Edit aEdName; + FixedLine aFlComment; + MultiLineEdit aEdComment; + FixedLine aFlOptions; + CheckBox aCbShowFrame; + ColorListBox aLbColor; + //CheckBox aCbPrintFrame; + CheckBox aCbTwoWay; + //CheckBox aCbAttrib; + //CheckBox aCbValue; + CheckBox aCbCopyAll; + CheckBox aCbProtect; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + const String aDefScenarioName; + sal_Bool bIsEdit; + + DECL_LINK( OkHdl, OKButton * ); + DECL_LINK( EnableHdl, CheckBox * ); +}; + + +#endif // SC_SCENDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/scui_def.hxx b/sc/source/ui/inc/scui_def.hxx new file mode 100644 index 000000000000..564b9f6eb362 --- /dev/null +++ b/sc/source/ui/inc/scui_def.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SCUI_DEF_HXX +#define SCUI_DEF_HXX + +#define SCRET_COLS 0x42 +#define SCRET_ROWS 0x43 + +#define FDS_OPT_NONE 0 // from filldlg.hxx +#define FDS_OPT_HORZ 1 // from filldlg.hxx +#define FDS_OPT_VERT 2 // from filldlg.hxx + +#define INS_CONT_NOEMPTY 0x0100 //from inscodlg.hxx +#define INS_CONT_TRANS 0x0200 //from inscodlg.hxx +#define INS_CONT_LINK 0x0400 //from inscodlg.hxx + +#define SC_CELL_SHIFT_DISABLE_DOWN 0x01 //from inscodlg.hxx +#define SC_CELL_SHIFT_DISABLE_RIGHT 0x02 //from inscodlg.hxx + +#define NAME_TOP 1 //from namecrea.hxx +#define NAME_LEFT 2 //from namecrea.hxx +#define NAME_BOTTOM 4 //from namecrea.hxx +#define NAME_RIGHT 8 //from namecrea.hxx + +#define BTN_PASTE_NAME 100 // from namepast.hxx +#define BTN_PASTE_LIST 101 // from namepast.hxx + +#define BTN_EXTEND_RANGE 150 +#define BTN_CURRENT_SELECTION 151 +#define SCRET_REMOVE 0x42 //from subtdlg.hxx +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/scuiasciiopt.hxx b/sc/source/ui/inc/scuiasciiopt.hxx new file mode 100644 index 000000000000..133d310c664e --- /dev/null +++ b/sc/source/ui/inc/scuiasciiopt.hxx @@ -0,0 +1,149 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ============================================================================ + +#ifndef SCUI_ASCIIOPT_HXX +#define SCUI_ASCIIOPT_HXX + + +#include "asciiopt.hxx" +#include "svx/langbox.hxx" + +// ============================================================================ + +class ScImportAsciiDlg : public ModalDialog +{ + SvStream* mpDatStream; + sal_uLong mnStreamPos; + sal_uLong* mpRowPosArray; + sal_uLong mnRowPosCount; + + String maPreviewLine[ CSV_PREVIEW_LINES ]; + + FixedLine aFlFieldOpt; + FixedText aFtCharSet; + SvxTextEncodingBox aLbCharSet; + FixedText aFtCustomLang; + SvxLanguageBox aLbCustomLang; + + FixedText aFtRow; + NumericField aNfRow; + + FixedLine aFlSepOpt; + RadioButton aRbFixed; + RadioButton aRbSeparated; + + CheckBox aCkbTab; + CheckBox aCkbSemicolon; + CheckBox aCkbComma; + CheckBox aCkbSpace; + CheckBox aCkbOther; + Edit aEdOther; + CheckBox aCkbAsOnce; + + FixedLine aFlOtherOpt; + + FixedText aFtTextSep; + ComboBox aCbTextSep; + + CheckBox aCkbQuotedAsText; + CheckBox aCkbDetectNumber; + + FixedLine aFlWidth; + FixedText aFtType; + ListBox aLbType; + + ScCsvTableBox maTableBox; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + String aCharSetUser; + String aColumnUser; + String aFldSepList; + String aTextSepList; + String maFieldSeparators; // selected field separators + sal_Unicode mcTextSep; + String maStrTextToColumns; + + CharSet meCharSet; /// Selected char set. + bool mbCharSetSystem; /// Is System char set selected? + bool mbFileImport; /// Is this dialog involked for csv file import ? + +public: + ScImportAsciiDlg( + Window* pParent, String aDatName, + SvStream* pInStream, sal_Unicode cSep = '\t' ); + ~ScImportAsciiDlg(); + + void GetOptions( ScAsciiOptions& rOpt ); + void SetTextToColumnsMode(); + void SaveParameters(); + +private: + /** Sets the selected char set data to meCharSet and mbCharSetSystem. */ + void SetSelectedCharSet(); + /** Returns all separator characters in a string. */ + String GetSeparators() const; + + /** Enables or disables all separator checkboxes and edit fields. */ + void SetupSeparatorCtrls(); + + + bool GetLine( sal_uLong nLine, String &rText ); + void UpdateVertical(); + inline bool Seek( sal_uLong nPos ); // synced to and from mnStreamPos + + DECL_LINK( CharSetHdl, SvxTextEncodingBox* ); + DECL_LINK( FirstRowHdl, NumericField* ); + DECL_LINK( RbSepFixHdl, RadioButton* ); + DECL_LINK( SeparatorHdl, Control* ); + DECL_LINK( LbColTypeHdl, ListBox* ); + DECL_LINK( UpdateTextHdl, ScCsvTableBox* ); + DECL_LINK( ColTypeHdl, ScCsvTableBox* ); +}; + + +inline bool ScImportAsciiDlg::Seek(sal_uLong nPos) +{ + bool bSuccess = true; + if (nPos != mnStreamPos && mpDatStream) + { + if (mpDatStream->Seek( nPos ) != nPos) + bSuccess = false; + else + mnStreamPos = nPos; + } + return bSuccess; +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/scuiautofmt.hxx b/sc/source/ui/inc/scuiautofmt.hxx new file mode 100644 index 000000000000..00113dca3806 --- /dev/null +++ b/sc/source/ui/inc/scuiautofmt.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SCUI_AUTOFMT_HXX +#define SCUI_AUTOFMT_HXX +#include "autofmt.hxx" + +class ScAutoFormatDlg : public ModalDialog +{ +public: + ScAutoFormatDlg( Window* pParent, + ScAutoFormat* pAutoFormat, + const ScAutoFormatData* pSelFormatData, + ScDocument* pDoc ); + ~ScAutoFormatDlg(); + + sal_uInt16 GetIndex() const { return nIndex; } + String GetCurrFormatName(); + +private: + FixedLine aFlFormat; + ListBox aLbFormat; + ScAutoFmtPreview* pWndPreview; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + PushButton aBtnAdd; + PushButton aBtnRemove; + MoreButton aBtnMore; + FixedLine aFlFormatting; + CheckBox aBtnNumFormat; + CheckBox aBtnBorder; + CheckBox aBtnFont; + CheckBox aBtnPattern; + CheckBox aBtnAlignment; + CheckBox aBtnAdjust; + PushButton aBtnRename; + String aStrTitle; + String aStrLabel; + String aStrClose; + String aStrDelTitle; + String aStrDelMsg; + String aStrRename; + + //------------------------ + ScAutoFormat* pFormat; + const ScAutoFormatData* pSelFmtData; + sal_uInt16 nIndex; + sal_Bool bCoreDataChanged; + sal_Bool bFmtInserted; + + void Init (); + void UpdateChecks (); + //------------------------ + DECL_LINK( CheckHdl, Button * ); + DECL_LINK( AddHdl, void * ); + DECL_LINK( RemoveHdl, void * ); + DECL_LINK( SelFmtHdl, void * ); + DECL_LINK( CloseHdl, PushButton * ); + DECL_LINK( DblClkHdl, void * ); + DECL_LINK( RenameHdl, void *); + +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/scuiimoptdlg.hxx b/sc/source/ui/inc/scuiimoptdlg.hxx new file mode 100644 index 000000000000..9a0de3c23f4c --- /dev/null +++ b/sc/source/ui/inc/scuiimoptdlg.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SCUI_IMOPTDLG_HXX +#define SCUI_IMOPTDLG_HXX + +#include "imoptdlg.hxx" + +//=================================================================== + + +class ScDelimiterTable; + +class ScImportOptionsDlg : public ModalDialog +{ +public: + ScImportOptionsDlg( Window* pParent, + sal_Bool bAscii = sal_True, + const ScImportOptions* pOptions = NULL, + const String* pStrTitle = NULL, + sal_Bool bMultiByte = false, + sal_Bool bOnlyDbtoolsEncodings = false, + sal_Bool bImport = sal_True ); + + ~ScImportOptionsDlg(); + + void GetImportOptions( ScImportOptions& rOptions ) const; + +private: + FixedLine aFlFieldOpt; + FixedText aFtFont; + SvxTextEncodingBox aLbFont; + FixedText aFtFieldSep; + ComboBox aEdFieldSep; + FixedText aFtTextSep; + ComboBox aEdTextSep; + CheckBox aCbQuoteAll; + CheckBox aCbShown; + CheckBox aCbFixed; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + ScDelimiterTable* pFieldSepTab; + ScDelimiterTable* pTextSepTab; + +private: + sal_uInt16 GetCodeFromCombo( const ComboBox& rEd ) const; + + DECL_LINK( FixedWidthHdl, CheckBox* ); + DECL_LINK( DoubleClickHdl, ListBox* ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx new file mode 100644 index 000000000000..b8c3e20b8136 --- /dev/null +++ b/sc/source/ui/inc/scuitphfedit.hxx @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SCUI_TPHFEDIT_HXX +#define SCUI_TPHFEDIT_HXX + +#include "tphfedit.hxx" + +//=================================================================== +enum ScHFEntryId +{ + eNoneEntry , + ePageEntry , + ePagesEntry , + eSheetEntry , + eConfidentialEntry , + eFileNamePageEntry , + eExtFileNameEntry , + ePageSheetEntry , + ePageFileNameEntry , + ePageExtFileNameEntry , + eUserNameEntry , + eCreatedByEntry , + eEntryCount +}; + +class ScHeaderEditEngine; +class ScPatternAttr; +class EditView; +class EditTextObject; +class SvxFieldItem; +class ScAccessibleEditObject; + + +class ScHFEditPage : public SfxTabPage +{ +public: + virtual sal_Bool FillItemSet ( SfxItemSet& rCoreSet ); + virtual void Reset ( const SfxItemSet& rCoreSet ); + + void SetNumType(SvxNumType eNumType); + void ClearTextAreas(); + +protected: + ScHFEditPage( Window* pParent, + sal_uInt16 nResId, + const SfxItemSet& rCoreSet, + sal_uInt16 nWhich, bool bHeader ); + virtual ~ScHFEditPage(); + +private: + FixedText aFtLeft; + ScEditWindow aWndLeft; + FixedText aFtCenter; + ScEditWindow aWndCenter; + FixedText aFtRight; + ScEditWindow aWndRight; + FixedText maFtDefinedHF; + ListBox maLbDefined; + FixedText maFtCustomHF; + ImageButton aBtnText; + ScExtIButton aBtnFile; + ImageButton aBtnTable; + ImageButton aBtnPage; + ImageButton aBtnLastPage; + ImageButton aBtnDate; + ImageButton aBtnTime; + FixedLine aFlInfo; + FixedInfo aFtInfo; + ScPopupMenu aPopUpFile; + + sal_uInt16 nWhich; + String aCmdArr[6]; + +private: +#ifdef _TPHFEDIT_CXX + void FillCmdArr(); + void InitPreDefinedList(); + void ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling = false); + void InsertToDefinedList(); + void RemoveFromDefinedList(); + void SetSelectDefinedList(); + bool IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj); + bool IsDateEntry(EditTextObject* pTextObj); + bool IsExtFileNameEntry(EditTextObject* pTextObj); + DECL_LINK( ListHdl_Impl, ListBox* ); + DECL_LINK( ClickHdl, ImageButton* ); + DECL_LINK( MenuHdl, ScExtIButton* ); +#endif +}; + +//=================================================================== + +class ScRightHeaderEditPage : public ScHFEditPage +{ +public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet ); + static sal_uInt16* GetRanges(); + +private: + ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet ); +}; + +//=================================================================== + +class ScLeftHeaderEditPage : public ScHFEditPage +{ +public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet ); + static sal_uInt16* GetRanges(); + +private: + ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet ); +}; + +//=================================================================== + +class ScRightFooterEditPage : public ScHFEditPage +{ +public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet ); + static sal_uInt16* GetRanges(); + +private: + ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet ); +}; + +//=================================================================== + +class ScLeftFooterEditPage : public ScHFEditPage +{ +public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet ); + static sal_uInt16* GetRanges(); + +private: + ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/select.hxx b/sc/source/ui/inc/select.hxx new file mode 100644 index 000000000000..0c8ea64c4e0c --- /dev/null +++ b/sc/source/ui/inc/select.hxx @@ -0,0 +1,131 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SELECT_HXX +#define SC_SELECT_HXX + +#include <vcl/seleng.hxx> + +#include "viewdata.hxx" // ScSplitPos + +// --------------------------------------------------------------------------- + +class ScTabView; +class ScViewData; + + +class ScViewSelectionEngine : public SelectionEngine +{ +private: + ScSplitPos eWhich; +public: + ScViewSelectionEngine( Window* pWindow, ScTabView* pView, + ScSplitPos eSplitPos ); + + ScSplitPos GetWhich() const { return eWhich; } + void SetWhich(ScSplitPos eNew) { eWhich = eNew; } +}; + + +class ScViewFunctionSet : public FunctionSet // View (Gridwin / Tastatur) +{ +private: + ScViewData* pViewData; + ScViewSelectionEngine* pEngine; + + sal_Bool bAnchor; + sal_Bool bStarted; + ScAddress aAnchorPos; + + ScSplitPos GetWhich(); + + sal_uLong CalcUpdateInterval( const Size& rWinSize, const Point& rEffPos, + bool bLeftScroll, bool bTopScroll, bool bRightScroll, bool bBottomScroll ); + +public: + ScViewFunctionSet( ScViewData* pNewViewData ); + + void SetSelectionEngine( ScViewSelectionEngine* pSelEngine ); + + void SetAnchor( SCCOL nPosX, SCROW nPosY ); + void SetAnchorFlag( sal_Bool bSet ); + + virtual void BeginDrag(); + virtual void CreateAnchor(); + virtual void DestroyAnchor(); + virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = false ); + virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); + virtual void DeselectAtPoint( const Point& rPointPixel ); + virtual void DeselectAll(); + + sal_Bool SetCursorAtCell( SCsCOL nPosX, SCsROW nPosY, sal_Bool bScroll ); +}; + + +// --------------------------------------------------------------------------- + + +class ScHeaderFunctionSet : public FunctionSet // Spalten- / Zeilenkoepfe +{ +private: + ScViewData* pViewData; + sal_Bool bColumn; // Col- / Rowbar + ScSplitPos eWhich; + + sal_Bool bAnchor; + SCCOLROW nCursorPos; + +public: + ScHeaderFunctionSet( ScViewData* pNewViewData ); + + void SetColumn( sal_Bool bSet ); + void SetWhich( ScSplitPos eNew ); + + virtual void BeginDrag(); + virtual void CreateAnchor(); + virtual void DestroyAnchor(); + virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = false ); + virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); + virtual void DeselectAtPoint( const Point& rPointPixel ); + virtual void DeselectAll(); + + void SetAnchorFlag(sal_Bool bSet) { bAnchor = bSet; } +}; + + +class ScHeaderSelectionEngine : public SelectionEngine +{ +public: + ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunctionSet* pFuncSet ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/selectionstate.hxx b/sc/source/ui/inc/selectionstate.hxx new file mode 100644 index 000000000000..f60b334bfed5 --- /dev/null +++ b/sc/source/ui/inc/selectionstate.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SELECTIONSTATE_HXX +#define SC_SELECTIONSTATE_HXX + +#include <editeng/editdata.hxx> +#include "rangelst.hxx" + +// ============================================================================ + +/** Enumerates all possible types of selections in a Calc document. */ +enum ScSelectionType +{ + SC_SELECTTYPE_NONE, /// No selection, simple cell cursor. + SC_SELECTTYPE_SHEET, /// Single cell, cell range, or multi range selection. + SC_SELECTTYPE_EDITCELL, /// Cell in edit mode (with or without selection). + SC_SELECTTYPE_DRAWING, /// One or more drawing objects. + SC_SELECTTYPE_EDITDRAW /// Edit mode in drawing object (with or without selection). +}; + +// ---------------------------------------------------------------------------- + +class ScViewData; + +/** Contains all available data about any possible selection in a Calc document. */ +class ScSelectionState +{ +public: + explicit ScSelectionState( ScViewData& rViewData ); + + /** Returns the type of the selection this object contains. */ + inline ScSelectionType GetSelectionType() const { return meType; } + + /** Returns the position of the cell cursor. */ + inline const ScAddress& GetCellCursor() const { return maCursor; } + /** Returns a range list containing all selected cell ranges. */ + inline const ScRangeList& GetSheetSelection() const { return maSheetSel; } + /** Returns the edit engine selection. */ + inline const ESelection& GetEditSelection() const { return maEditSel; } + +private: + ScSelectionType meType; /// Type of the selection. + ScAddress maCursor; /// Cell cursor position. + ScRangeList maSheetSel; /// Sheet selection. + ESelection maEditSel; /// Selection in edit mode. +}; + +bool operator==( const ScSelectionState& rL, const ScSelectionState& rR ); +inline bool operator!=( const ScSelectionState& rL, const ScSelectionState& rR ) { return !(rL == rR); } + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/seltrans.hxx b/sc/source/ui/inc/seltrans.hxx new file mode 100644 index 000000000000..9b0f39a39873 --- /dev/null +++ b/sc/source/ui/inc/seltrans.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SELTRANS_HXX +#define SC_SELTRANS_HXX + +#include <svtools/transfer.hxx> + +class ScTabView; +class ScTransferObj; +class ScDrawTransferObj; + +enum ScSelectionTransferMode +{ + SC_SELTRANS_INVALID, + SC_SELTRANS_CELL, + SC_SELTRANS_CELLS, + SC_SELTRANS_DRAW_BITMAP, + SC_SELTRANS_DRAW_GRAPHIC, + SC_SELTRANS_DRAW_BOOKMARK, + SC_SELTRANS_DRAW_OLE, + SC_SELTRANS_DRAW_OTHER +}; + +class ScSelectionTransferObj : public TransferableHelper +{ +private: + ScTabView* pView; + ScSelectionTransferMode eMode; + ScTransferObj* pCellData; + ScDrawTransferObj* pDrawData; + + ScSelectionTransferObj( ScTabView* pSource, ScSelectionTransferMode eNewMode ); + void CreateCellData(); + void CreateDrawData(); + +public: + // creates an object if the view has a valid selection, + // returns NULL otherwise + static ScSelectionTransferObj* CreateFromView( ScTabView* pSource ); + + virtual ~ScSelectionTransferObj(); + + void ForgetView(); + sal_Bool StillValid(); + ScTabView* GetView() const { return pView; } + + ScTransferObj* GetCellData(); + ScDrawTransferObj* GetDrawData(); + + virtual void AddSupportedFormats(); + virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + virtual void ObjectReleased(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/servobj.hxx b/sc/source/ui/inc/servobj.hxx new file mode 100644 index 000000000000..b0bb345de3e9 --- /dev/null +++ b/sc/source/ui/inc/servobj.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SERVOBJ_HXX +#define SC_SERVOBJ_HXX + +#include <svl/lstner.hxx> +#include <svl/listener.hxx> +#include <sfx2/linksrc.hxx> +#include "global.hxx" +#include "address.hxx" + +class ScDocShell; +class ScServerObject; + +class ScServerObjectSvtListenerForwarder : public SvtListener +{ + ScServerObject* pObj; + SfxBroadcaster aBroadcaster; +public: + ScServerObjectSvtListenerForwarder( ScServerObject* pObjP); + virtual ~ScServerObjectSvtListenerForwarder(); + virtual void Notify( SvtBroadcaster& rBC, const SfxHint& rHint); +}; + +class ScServerObject : public ::sfx2::SvLinkSource, public SfxListener +{ +private: + ScServerObjectSvtListenerForwarder aForwarder; + ScDocShell* pDocSh; + ScRange aRange; + String aItemStr; + sal_Bool bRefreshListener; + + void Clear(); + +public: + ScServerObject( ScDocShell* pShell, const String& rItem ); + virtual ~ScServerObject(); + + virtual sal_Bool GetData( ::com::sun::star::uno::Any & rData /*out param*/, + const String & rMimeType, + sal_Bool bSynchron = false ); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + void EndListeningAll(); +}; + +//SO2_DECL_REF( ScServerObject ) + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/sharedocdlg.hrc b/sc/source/ui/inc/sharedocdlg.hrc new file mode 100644 index 000000000000..cc38e81bbddb --- /dev/null +++ b/sc/source/ui/inc/sharedocdlg.hrc @@ -0,0 +1,44 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <sc.hrc> + +#define CB_SHARE 1 +#define FT_WARNING 2 +#define FL_USERS 3 +#define FT_USERS 4 +#define LB_USERS 5 +#define FL_END 6 +#define BTN_HELP 7 +#define BTN_OK 8 +#define BTN_CANCEL 9 + +#define STR_TITLE_NAME 1 +#define STR_TITLE_ACCESSED 2 +#define STR_NO_USER_DATA 3 +#define STR_UNKNOWN_USER 4 +#define STR_EXCLUSIVE_ACCESS 5 diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx new file mode 100644 index 000000000000..e15fde82102b --- /dev/null +++ b/sc/source/ui/inc/sharedocdlg.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SHAREDOCDLG_HXX +#define SC_SHAREDOCDLG_HXX + +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <svx/simptabl.hxx> + +class ScViewData; +class ScDocShell; + + +//============================================================================= +// class ScShareDocumentDlg +//============================================================================= + +class ScShareDocumentDlg : public ModalDialog +{ +private: + CheckBox maCbShare; + FixedText maFtWarning; + FixedLine maFlUsers; + FixedText maFtUsers; + SvxSimpleTable maLbUsers; + FixedLine maFlEnd; + HelpButton maBtnHelp; + OKButton maBtnOK; + CancelButton maBtnCancel; + + String maStrTitleName; + String maStrTitleAccessed; + String maStrNoUserData; + String maStrUnkownUser; + String maStrExclusiveAccess; + + ScViewData* mpViewData; + ScDocShell* mpDocShell; + + DECL_LINK( ToggleHandle, void* ); + +public: + ScShareDocumentDlg( Window* pParent, ScViewData* pViewData ); + ~ScShareDocumentDlg(); + + bool IsShareDocumentChecked() const; + void UpdateView(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/shtabdlg.hxx b/sc/source/ui/inc/shtabdlg.hxx new file mode 100644 index 000000000000..90dd3e217031 --- /dev/null +++ b/sc/source/ui/inc/shtabdlg.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SHTABDLG_HXX +#define SC_SHTABDLG_HXX + +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include <svtools/tooltiplbox.hxx> +#include <vcl/dialog.hxx> + +//------------------------------------------------------------------------ + +class ScShowTabDlg : public ModalDialog +{ +private: + FixedText aFtLbTitle; + ::svtools::ToolTipMultiListBox aLb; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + DECL_LINK( DblClkHdl, void * ); + +public: + ScShowTabDlg( Window* pParent ); + ~ScShowTabDlg(); + + /** Sets dialog title, fixed text for listbox and help IDs. */ + void SetDescription( + const String& rTitle, const String& rFixedText, + const ::rtl::OString& nDlgHelpId, const rtl::OString& nLbHelpId ); + + /** Inserts a string into the ListBox. */ + void Insert( const String& rString, sal_Bool bSelected ); + + sal_uInt16 GetSelectEntryCount() const; + String GetSelectEntry(sal_uInt16 nPos) const; + sal_uInt16 GetSelectEntryPos(sal_uInt16 nPos) const; +}; + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/simpref.hrc b/sc/source/ui/inc/simpref.hrc new file mode 100644 index 000000000000..c7dbb3ebdea9 --- /dev/null +++ b/sc/source/ui/inc/simpref.hrc @@ -0,0 +1,36 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // -> RID_SCDLG_SIMPLEREF + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_ADD 3 +#define BTN_HELP 4 +#define FT_ASSIGN 10 +#define ED_ASSIGN 11 +#define RB_ASSIGN 12 diff --git a/sc/source/ui/inc/simpref.hxx b/sc/source/ui/inc/simpref.hxx new file mode 100644 index 000000000000..4dcf023b2780 --- /dev/null +++ b/sc/source/ui/inc/simpref.hxx @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SIMPREF_HXX +#define SC_SIMPREF_HXX + +#include <vcl/group.hxx> + +#include <vcl/combobox.hxx> + +#include <vcl/fixed.hxx> + +#include <vcl/morebtn.hxx> +#include "anyrefdg.hxx" +#include "dbcolect.hxx" +#include "expftext.hxx" + +class ScViewData; +class ScDocument; + + +//============================================================================ + +class ScSimpleRefDlg: public ScAnyRefDlg +{ +private: + Link aCloseHdl; + Link aDoneHdl; + Link aAbortedHdl; + Link aChangeHdl; + + FixedText aFtAssign; + formula::RefEdit aEdAssign; + formula::RefButton aRbAssign; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + ScViewData* pViewData; + ScDocument* pDoc; + sal_Bool bRefInputMode; + + ScRange theCurArea; + sal_Bool bCloseFlag; + sal_Bool bAutoReOpen; + sal_Bool bCloseOnButtonUp; + sal_Bool bSingleCell; + sal_Bool bMultiSelection; + + void Init(); + + DECL_LINK( CancelBtnHdl, void * ); + DECL_LINK( OkBtnHdl, void * ); + + +protected: + + virtual void RefInputDone( sal_Bool bForced = false ); + +public: + ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScViewData* ptrViewData ); + ~ScSimpleRefDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + virtual sal_Bool Close(); + + void StartRefInput(); + + virtual String GetRefString() const; + virtual void SetRefString(const String &rStr); + virtual void FillInfo(SfxChildWinInfo&) const; + + void SetCloseHdl( const Link& rLink ); + void SetUnoLinks( const Link& rDone, const Link& rAbort, + const Link& rChange ); + + void SetFlags( sal_Bool bSetCloseOnButtonUp, sal_Bool bSetSingleCell, sal_Bool bSetMultiSelection ); + + void SetAutoReOpen(sal_Bool bFlag) {bAutoReOpen=bFlag;} +}; + + + +#endif // SC_DBNAMDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/sizedev.hxx b/sc/source/ui/inc/sizedev.hxx new file mode 100644 index 000000000000..d3cd5362b2b7 --- /dev/null +++ b/sc/source/ui/inc/sizedev.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SIZEDEV_HXX +#define SC_SIZEDEV_HXX + +#include <vcl/mapmod.hxx> + +class OutputDevice; +class ScDocShell; + +class ScSizeDeviceProvider +{ + OutputDevice* pDevice; + sal_Bool bOwner; + double nPPTX; + double nPPTY; + MapMode aOldMapMode; + +public: + ScSizeDeviceProvider( ScDocShell* pDocSh ); + ~ScSizeDeviceProvider(); + + OutputDevice* GetDevice() const { return pDevice; } + double GetPPTX() const { return nPPTX; } + double GetPPTY() const { return nPPTY; } + sal_Bool IsPrinter() const { return !bOwner; } +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/solveroptions.hrc b/sc/source/ui/inc/solveroptions.hrc new file mode 100644 index 000000000000..3c543e61a8f5 --- /dev/null +++ b/sc/source/ui/inc/solveroptions.hrc @@ -0,0 +1,46 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" + +#define FT_ENGINE 1 +#define FT_SETTINGS 2 +#define FT_OPTIONNAME 3 + +#define LB_ENGINE 1 +#define LB_SETTINGS 2 + +#define FL_BUTTONS 1 + +#define BTN_EDIT 1 +#define BTN_HELP 2 +#define BTN_OK 3 +#define BTN_CANCEL 4 + +#define NF_VALUE 1 + +#define ED_VALUE 1 diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx new file mode 100644 index 000000000000..0d28b9e6f5ea --- /dev/null +++ b/sc/source/ui/inc/solveroptions.hxx @@ -0,0 +1,123 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SOLVEROPTIONS_HXX +#define SC_SOLVEROPTIONS_HXX + +#include <vcl/dialog.hxx> + +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/field.hxx> +#include <svx/checklbx.hxx> +#include <com/sun/star/uno/Sequence.hxx> + +namespace com { namespace sun { namespace star { + namespace beans { struct PropertyValue; } +} } } + + + +class ScSolverOptionsDialog : public ModalDialog +{ + FixedText maFtEngine; + ListBox maLbEngine; + FixedText maFtSettings; + SvxCheckListBox maLbSettings; + PushButton maBtnEdit; + FixedLine maFlButtons; + HelpButton maBtnHelp; + OKButton maBtnOk; + CancelButton maBtnCancel; + + SvLBoxButtonData* mpCheckButtonData; + com::sun::star::uno::Sequence<rtl::OUString> maImplNames; + com::sun::star::uno::Sequence<rtl::OUString> maDescriptions; + String maEngine; + com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> maProperties; + + DECL_LINK( EngineSelectHdl, ListBox* ); + DECL_LINK( SettingsSelHdl, SvxCheckListBox* ); + DECL_LINK( SettingsDoubleClickHdl, SvTreeListBox* ); + DECL_LINK( ButtonHdl, PushButton* ); + + void ReadFromComponent(); + void FillListBox(); + void EditOption(); + +public: + ScSolverOptionsDialog( Window* pParent, + const com::sun::star::uno::Sequence<rtl::OUString>& rImplNames, + const com::sun::star::uno::Sequence<rtl::OUString>& rDescriptions, + const String& rEngine, + const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rProperties ); + ~ScSolverOptionsDialog(); + + const String& GetEngine() const; + const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& GetProperties(); +}; + + +class ScSolverIntegerDialog : public ModalDialog +{ + FixedText maFtName; + NumericField maNfValue; + FixedLine maFlButtons; + OKButton maBtnOk; + CancelButton maBtnCancel; + +public: + ScSolverIntegerDialog( Window * pParent ); + ~ScSolverIntegerDialog(); + + void SetOptionName( const String& rName ); + void SetValue( sal_Int32 nValue ); + sal_Int32 GetValue() const; +}; + +class ScSolverValueDialog : public ModalDialog +{ + FixedText maFtName; + Edit maEdValue; + FixedLine maFlButtons; + OKButton maBtnOk; + CancelButton maBtnCancel; + +public: + ScSolverValueDialog( Window * pParent ); + ~ScSolverValueDialog(); + + void SetOptionName( const String& rName ); + void SetValue( double fValue ); + double GetValue() const; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/solverutil.hxx b/sc/source/ui/inc/solverutil.hxx new file mode 100644 index 000000000000..a447cec257fd --- /dev/null +++ b/sc/source/ui/inc/solverutil.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SOLVERUTIL_HXX +#define SC_SOLVERUTIL_HXX + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/Sequence.hxx> + +namespace com { namespace sun { namespace star { + namespace beans { struct PropertyValue; } + namespace sheet { class XSolver; } +} } } + + +class ScSolverUtil +{ +public: + static void GetImplementations( com::sun::star::uno::Sequence<rtl::OUString>& rImplNames, + com::sun::star::uno::Sequence<rtl::OUString>& rDescriptions ); + static com::sun::star::uno::Reference<com::sun::star::sheet::XSolver> GetSolver( const rtl::OUString& rImplName ); + static com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> GetDefaults( const rtl::OUString& rImplName ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/solvrdlg.hrc b/sc/source/ui/inc/solvrdlg.hrc new file mode 100644 index 000000000000..ab40fd3f72a2 --- /dev/null +++ b/sc/source/ui/inc/solvrdlg.hrc @@ -0,0 +1,45 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // ->RID_SCDLG_SOLVER + +#define ED_FORMULACELL 1 +#define ED_TARGETVAL 2 +#define ED_VARCELL 3 +#define FT_FORMULACELL 1 +#define FT_TARGETVAL 2 +#define FT_VARCELL 3 +#define RB_FORMULACELL 1 +#define RB_VARCELL 2 +#define FL_VARIABLES 1 +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 1 +#define STR_INVALIDVAL 1 +#define STR_INVALIDVAR 2 +#define STR_INVALIDFORM 3 +#define STR_NOFORMULA 4 diff --git a/sc/source/ui/inc/solvrdlg.hxx b/sc/source/ui/inc/solvrdlg.hxx new file mode 100644 index 000000000000..86eb96f15b70 --- /dev/null +++ b/sc/source/ui/inc/solvrdlg.hxx @@ -0,0 +1,111 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SOLVRDLG_HXX +#define SC_SOLVRDLG_HXX + +#include "global.hxx" +#include "address.hxx" +#include "anyrefdg.hxx" + + +#include <vcl/fixed.hxx> +#include <vcl/group.hxx> + +//---------------------------------------------------------------------------- + +enum ScSolverErr + { + SOLVERR_NOFORMULA, + SOLVERR_INVALID_FORMULA, + SOLVERR_INVALID_VARIABLE, + SOLVERR_INVALID_TARGETVALUE + }; + + +//============================================================================ + +class ScSolverDlg : public ScAnyRefDlg +{ +public: + ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScDocument* pDocument, + ScAddress aCursorPos ); + ~ScSolverDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + virtual sal_Bool Close(); + +private: + FixedLine aFlVariables; + FixedText aFtFormulaCell; + formula::RefEdit aEdFormulaCell; + formula::RefButton aRBFormulaCell; + + FixedText aFtTargetVal; + Edit aEdTargetVal; + + FixedText aFtVariableCell; + formula::RefEdit aEdVariableCell; + formula::RefButton aRBVariableCell; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + ScAddress theFormulaCell; + ScAddress theVariableCell; + String theTargetValStr; + + ScDocument* pDoc; + const SCTAB nCurTab; + formula::RefEdit* pEdActive; + sal_Bool bDlgLostFocus; + const String errMsgInvalidVar; + const String errMsgInvalidForm; + const String errMsgNoFormula; + const String errMsgInvalidVal; + + +#ifdef _SOLVRDLG_CXX + void Init(); + sal_Bool CheckTargetValue( String& rStrVal ); + void RaiseError( ScSolverErr eError ); + + DECL_LINK( BtnHdl, PushButton* ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); +#endif // _SOLVERDLG_CXX +}; + +#endif // SC_SOLVRDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/sortdlg.hrc b/sc/source/ui/inc/sortdlg.hrc new file mode 100644 index 000000000000..f583dd3d2ce9 --- /dev/null +++ b/sc/source/ui/inc/sortdlg.hrc @@ -0,0 +1,78 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#include "sc.hrc" // -> RID_SCDLG_SORT + // -> RID_SCPAGE_SORT_FIELDS + // -> RID_SCPAGE_SORT_OPTIONS + // -> RID_SCDLG_SORT_WARNING + // -> SCSTR_NONAME + // -> SCSTR_UNDEFINED + // -> SCSTR_FIELD + +#define TP_FIELDS 1 +#define TP_OPTIONS 2 + +// TP_SORT_FIELDS: +#define FL_SORT1 1 +#define FL_SORT2 2 +#define FL_SORT3 3 +#define LB_SORT1 4 +#define LB_SORT2 5 +#define LB_SORT3 6 +#define BTN_UP1 7 +#define BTN_UP2 8 +#define BTN_UP3 9 +#define BTN_DOWN1 10 +#define BTN_DOWN2 11 +#define BTN_DOWN3 12 + +// TP_SORT_OPTIONS: +#define FL_DIRECTION 1 +#define LB_SORT_USER 2 +#define LB_OUTAREA 3 +#define ED_OUTAREA 4 +#define BTN_SORT_USER 7 +#define BTN_CASESENSITIVE 8 +#define BTN_LABEL 9 +#define BTN_FORMATS 10 +#define BTN_COPYRESULT 11 +#define BTN_TOP_DOWN 12 +#define BTN_LEFT_RIGHT 13 +#define STR_COL_LABEL 14 +#define STR_ROW_LABEL 15 +#define FT_LANGUAGE 16 +#define LB_LANGUAGE 17 +#define FT_ALGORITHM 18 +#define LB_ALGORITHM 19 +#define BTN_NATURALSORT 20 + +#define FT_TEXT 1 +#define FT_TIP 2 +#define BTN_EXTSORT 3 +#define BTN_CURSORT 4 +#define BTN_CANCEL 5 diff --git a/sc/source/ui/inc/sortdlg.hxx b/sc/source/ui/inc/sortdlg.hxx new file mode 100644 index 000000000000..1d6e01d02b25 --- /dev/null +++ b/sc/source/ui/inc/sortdlg.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SORTDLG_HXX +#define SC_SORTDLG_HXX + +#include <sfx2/tabdlg.hxx> +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include "scui_def.hxx" + +#ifndef LAYOUT_SFX_TABDIALOG_BROKEN +#define LAYOUT_SFX_TABDIALOG_BROKEN 1 +#endif /* !LAYOUT_SFX_TABDIALOG_BROKEN */ + +#if !LAYOUT_SFX_TABDIALOG_BROKEN +#include <sfx2/layout.hxx> +#include <layout/layout-pre.hxx> +#endif + +class ScSortDlg : public SfxTabDialog +{ +public: + ScSortDlg( Window* pParent, + const SfxItemSet* pArgSet ); + ~ScSortDlg(); + + void SetHeaders( sal_Bool bHeaders ); + void SetByRows ( sal_Bool bByRows ); + sal_Bool GetHeaders() const; + sal_Bool GetByRows () const; + + +private: + sal_Bool bIsHeaders; + sal_Bool bIsByRows; +}; + +inline void ScSortDlg::SetHeaders( sal_Bool bHeaders ) { bIsHeaders = bHeaders; } +inline void ScSortDlg::SetByRows ( sal_Bool bByRows ) { bIsByRows = bByRows; } +inline sal_Bool ScSortDlg::GetHeaders() const { return bIsHeaders; } +inline sal_Bool ScSortDlg::GetByRows () const { return bIsByRows; } + +class ScSortWarningDlg : public ModalDialog +{ +public: + ScSortWarningDlg( Window* pParent, const String& rExtendText,const String& rCurrentText ); + ~ScSortWarningDlg(); + DECL_LINK( BtnHdl, PushButton* ); +private: + FixedText aFtText; + FixedText aFtTip; + PushButton aBtnExtSort; + PushButton aBtnCurSort; + CancelButton aBtnCancel; +}; + +#if !LAYOUT_SFX_TABDIALOG_BROKEN +#include <layout/layout-post.hxx> +#endif + +#endif // SC_SORTDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/spelldialog.hxx b/sc/source/ui/inc/spelldialog.hxx new file mode 100644 index 000000000000..3639007655a9 --- /dev/null +++ b/sc/source/ui/inc/spelldialog.hxx @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SPELLDIALOG_HXX +#define SC_SPELLDIALOG_HXX + +#include <memory> +#include <svx/SpellDialogChildWindow.hxx> + +// ============================================================================ + +class ScConversionEngineBase; +class ScSelectionState; +class ScTabViewShell; +class ScViewData; +class ScDocShell; +class ScDocument; + +/** Specialized spell check dialog child window for Calc. + + This derivation of the ::svx::SpellDialogChildWindow base class provides + Calc specific implementations of the virtual functions GetNextWrongSentence() + and ApplyChangedSentence(). + */ +class ScSpellDialogChildWindow : public ::svx::SpellDialogChildWindow +{ +public: + SFX_DECL_CHILDWINDOW( ScSpellDialogChildWindow ); + + explicit ScSpellDialogChildWindow( Window* pParent, sal_uInt16 nId, + SfxBindings* pBindings, SfxChildWinInfo* pInfo ); + virtual ~ScSpellDialogChildWindow(); + + /** This method makes the one from the base class public so that + it can be called from the view shell when one is created. + */ + virtual void InvalidateSpellDialog(); + +protected: + /** Iterate over the sentences in all text shapes and stop at the + next sentence with spelling errors. While doing so the view + mode may be changed and text shapes are set into edit mode. + */ + virtual ::svx::SpellPortions GetNextWrongSentence( bool bRecheck ); + + /** This method is responsible for merging corrections made in the + spelling dialog back into the document. + */ + virtual void ApplyChangedSentence( const ::svx::SpellPortions& rChanged, bool bRecheck ); + virtual void GetFocus(); + virtual void LoseFocus(); + +private: + void Reset(); + void Init(); + + bool IsSelectionChanged(); + +private: + typedef ::std::auto_ptr< ScConversionEngineBase > ScConvEnginePtr; + typedef ::std::auto_ptr< ScDocument > ScDocumentPtr; + typedef ::std::auto_ptr< ScSelectionState > ScSelectionStatePtr; + + ScConvEnginePtr mxEngine; + ScDocumentPtr mxUndoDoc; + ScDocumentPtr mxRedoDoc; + ScSelectionStatePtr mxOldSel; /// Old selection state for comparison. + ScTabViewShell* mpViewShell; + ScViewData* mpViewData; + ScDocShell* mpDocShell; + ScDocument* mpDoc; + bool mbNeedNextObj; + bool mbOldIdleDisabled; +}; + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/spelleng.hxx b/sc/source/ui/inc/spelleng.hxx new file mode 100644 index 000000000000..aae57483b8b6 --- /dev/null +++ b/sc/source/ui/inc/spelleng.hxx @@ -0,0 +1,171 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_SPELLENG_HXX +#define SC_SPELLENG_HXX + +#include "editutil.hxx" +#include "selectionstate.hxx" +#include "spellparam.hxx" + +class ScViewData; +class ScDocShell; +class ScDocument; +class SfxItemPool; + +// ============================================================================ + +/** Base class for special type of edit engines, i.e. for spell checker and text conversion. */ +class ScConversionEngineBase : public ScEditEngineDefaulter +{ +public: + explicit ScConversionEngineBase( + SfxItemPool* pEnginePool, ScViewData& rViewData, + ScDocument* pUndoDoc, ScDocument* pRedoDoc ); + + virtual ~ScConversionEngineBase(); + + /** Derived classes implement to convert all cells in the selection or sheet. */ + virtual void ConvertAll( EditView& rEditView ) = 0; + + /** Returns true, if at least one cell has been modified. */ + inline bool IsAnyModified() const { return mbIsAnyModified; } + /** Returns true, if the entire document/selection has been finished. */ + inline bool IsFinished() const { return mbFinished; } + +protected: + /** Implementation of cell iteration. Finds a cell that needs conversion. + @return true = Current cell needs conversion (i.e. spelling error found). */ + bool FindNextConversionCell(); + /** Restores the initial cursor position. */ + void RestoreCursorPos(); + + /** Derived classes return, if the current text needs conversion (i.e. spelling error found). + @return true = Current edit text needs conversion. */ + virtual bool NeedsConversion() = 0; + + /** Derived classes may show a query box that asks whether to restart at top of the sheet. + @descr Default here is no dialog and restart always. + @return true = Restart at top, false = Stop the conversion. */ + virtual bool ShowTableWrapDialog(); + /** Derived classes may show a message box stating that the conversion is finished. + @descr Default here is no dialog. */ + virtual void ShowFinishDialog(); + +private: + /** Fills the edit engine from a document cell. */ + void FillFromCell( SCCOL nCol, SCROW nRow, SCTAB nTab ); + +protected: // for usage in derived classes + ScViewData& mrViewData; + ScDocShell& mrDocShell; + ScDocument& mrDoc; + +private: + ScSelectionState maSelState; /// Selection data of the document. + ScDocument* mpUndoDoc; /// Document stores all old cells for UNDO action. + ScDocument* mpRedoDoc; /// Document stores all new cells for REDO action. + LanguageType meCurrLang; /// Current cell language. + SCCOL mnStartCol; /// Initial column index. + SCROW mnStartRow; /// Initial row index. + SCTAB mnStartTab; /// Initial sheet index. + SCCOL mnCurrCol; /// Current column index. + SCROW mnCurrRow; /// Current row index. + bool mbIsAnyModified; /// true = At least one cell has been changed. + bool mbInitialState; /// true = Not searched for a cell yet. + bool mbWrappedInTable; /// true = Already restarted at top of the sheet. + bool mbFinished; /// true = Entire document/selection finished. +}; + +// ============================================================================ + +/** Edit engine for spell checking. */ +class ScSpellingEngine : public ScConversionEngineBase +{ +public: + typedef ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > XSpellCheckerRef; + + explicit ScSpellingEngine( + SfxItemPool* pEnginePool, + ScViewData& rViewData, + ScDocument* pUndoDoc, + ScDocument* pRedoDoc, + XSpellCheckerRef xSpeller ); + + /** Checks spelling of all cells in the selection or sheet. */ + virtual void ConvertAll( EditView& rEditView ); + +protected: + /** Callback from edit engine to check the next cell. */ + virtual sal_Bool SpellNextDocument(); + + /** Returns true, if the current text contains a spelling error. */ + virtual bool NeedsConversion(); + + /** Show a query box that asks whether to restart at top of the sheet. + @return true = Restart at top, false = Stop the conversion. */ + virtual bool ShowTableWrapDialog(); + /** Show a message box stating that spell checking is finished. */ + virtual void ShowFinishDialog(); + +private: + /** Returns the spelling dialog if it is open. */ + Window* GetDialogParent(); +}; + +// ============================================================================ + +/** Edit engine for text conversion. */ +class ScTextConversionEngine : public ScConversionEngineBase +{ +public: + explicit ScTextConversionEngine( + SfxItemPool* pEnginePool, + ScViewData& rViewData, + const ScConversionParam& rConvParam, + ScDocument* pUndoDoc, + ScDocument* pRedoDoc ); + + /** Converts all cells in the selection or sheet according to set language. */ + virtual void ConvertAll( EditView& rEditView ); + +protected: + /** Callback from edit engine to convert the next cell. */ + virtual sal_Bool ConvertNextDocument(); + + /** Returns true, if the current text contains text to convert. */ + virtual bool NeedsConversion(); + +private: + ScConversionParam maConvParam; /// Conversion parameters. +}; + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/spellparam.hxx b/sc/source/ui/inc/spellparam.hxx new file mode 100644 index 000000000000..77ebb2476091 --- /dev/null +++ b/sc/source/ui/inc/spellparam.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_SPELLPARAM_HXX +#define SC_SPELLPARAM_HXX + +#include <vcl/font.hxx> + +// ============================================================================ + +/** Specifiers for sheet conversion (functions iterating over the sheet and modifying cells). */ +enum ScConversionType +{ + SC_CONVERSION_SPELLCHECK, /// Spell checker. + SC_CONVERSION_HANGULHANJA, /// Hangul-Hanja converter. + SC_CONVERSION_CHINESE_TRANSL /// Chinese simplified/traditional converter. +}; + +// --------------------------------------------------------------------------- + +/** Parameters for conversion. */ +class ScConversionParam +{ +public: + /** Constructs an empty parameter struct with the passed conversion type. */ + explicit ScConversionParam( ScConversionType eConvType ); + + /** Constructs parameter struct for text conversion without changing the language. */ + explicit ScConversionParam( + ScConversionType eConvType, + LanguageType eLang, + sal_Int32 nOptions, + bool bIsInteractive ); + + /** Constructs parameter struct for text conversion with language change. */ + explicit ScConversionParam( + ScConversionType eConvType, + LanguageType eSourceLang, + LanguageType eTargetLang, + const Font& rTargetFont, + sal_Int32 nOptions, + bool bIsInteractive ); + + inline ScConversionType GetType() const { return meConvType; } + inline LanguageType GetSourceLang() const { return meSourceLang; } + inline LanguageType GetTargetLang() const { return meTargetLang; } + inline const Font* GetTargetFont() const { return mbUseTargetFont ? &maTargetFont : 0; } + inline sal_Int32 GetOptions() const { return mnOptions; } + inline bool IsInteractive() const { return mbIsInteractive; } + +private: + ScConversionType meConvType; /// Type of the conversion. + LanguageType meSourceLang; /// Source language for conversion. + LanguageType meTargetLang; /// Target language for conversion. + Font maTargetFont; /// Target font to be used if language has to be changed. + sal_Int32 mnOptions; /// Conversion options. + bool mbUseTargetFont; /// True = Use maTargetFont to change font during conversion. + bool mbIsInteractive; /// True = Text conversion has (specific) dialog that may be raised. +}; + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/strindlg.hxx b/sc/source/ui/inc/strindlg.hxx new file mode 100644 index 000000000000..16630a099a41 --- /dev/null +++ b/sc/source/ui/inc/strindlg.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_STRINDLG_HXX +#define SC_STRINDLG_HXX + + +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include <vcl/edit.hxx> + +#include <layout/layout.hxx> +#include <layout/layout-pre.hxx> + +//------------------------------------------------------------------------ + +class ScStringInputDlg : public ModalDialog +{ +public: + ScStringInputDlg( Window* pParent, + const String& rTitle, + const String& rEditTitle, + const String& rDefault, + const rtl::OString& sHelpId, const rtl::OString& sEditHelpId ); + ~ScStringInputDlg(); + + void GetInputString( String& rString ) const; + +private: + FixedText aFtEditTitle; + Edit aEdInput; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; +}; + +#include <layout/layout-post.hxx> + +#endif // SC_STRINDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/styledlg.hrc b/sc/source/ui/inc/styledlg.hrc new file mode 100644 index 000000000000..4a954bb3afc1 --- /dev/null +++ b/sc/source/ui/inc/styledlg.hrc @@ -0,0 +1,39 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#define TP_NUMBER 2 +#define TP_FONT 3 +#define TP_ALIGNMENT 4 +#define TP_BORDER 5 +#define TP_BACKGROUND 6 +#define TP_PROTECTION 7 +#define TP_PAGE_STD 8 +#define TP_PAGE_HEADER 9 +#define TP_PAGE_FOOTER 10 +#define TP_TABLE 11 +#define TP_FONTEFF 12 +#define TP_ASIAN 13 + diff --git a/sc/source/ui/inc/styledlg.hxx b/sc/source/ui/inc/styledlg.hxx new file mode 100644 index 000000000000..73fab86b8088 --- /dev/null +++ b/sc/source/ui/inc/styledlg.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_STYLEDLG_HXX +#define SC_STYLEDLG_HXX + +#include <sfx2/styledlg.hxx> + +//================================================================== + +class SfxStyleSheetBase; + +class ScStyleDlg : public SfxStyleDialog +{ +public: + ScStyleDlg( Window* pParent, + SfxStyleSheetBase& rStyleBase, + sal_uInt16 nRscId ); + ~ScStyleDlg(); + +protected: + virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ); + virtual const SfxItemSet* GetRefreshedSet(); + +private: + sal_uInt16 nDlgRsc; +}; + + +#endif // SC_STYLEDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/submenu.hrc b/sc/source/ui/inc/submenu.hrc new file mode 100644 index 000000000000..4e5ad6d28d9e --- /dev/null +++ b/sc/source/ui/inc/submenu.hrc @@ -0,0 +1,68 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// IDs fuer Untermenues + +// 1 ist nicht erlaubt ???? +#define SUBMENU_EDIT 2 +#define SUBMENU_FILL 3 +#define SUBMENU_DELBREAK 4 +#define SUBMENU_VIEW 5 +#define SUBMENU_INSERT 6 +#define SUBMENU_INSBREAK 7 +#define SUBMENU_NAME 8 +#define SUBMENU_INSOBJ 9 +#define SUBMENU_DATA 10 +#define SUBMENU_FILTER 11 +#define SUBMENU_OUTLINE 12 +#define SUBMENU_PIVOT 13 +#define SUBMENU_EXTRA 14 +#define SUBMENU_AUDIT 15 +#define SUBMENU_PROTECT 16 +#define SUBMENU_ROW 17 +#define SUBMENU_COL 18 +#define SUBMENU_TAB 19 +#define SUBMENU_MERGE 20 +#define SUBMENU_AREA 21 +#define SUBMENU_MIRROR 22 +#define SUBMENU_OBJARRANGE 23 +#define SUBMENU_ANCHOR 24 +#define SUBMENU_POPARRANGE 25 +#define SUBMENU_OLEARRANGE 26 +#define SUBMENU_MAIL 27 +#define SUBMENU_OPTIONS 28 +#define SUBMENU_TOOLBARS 29 +#define SUBMENU_GRAPHIC 30 +#define SUBMENU_SPELLING 31 +#define SUBMENU_CELLCONT 32 +#define SUBMENU_OBJMIRROR 33 +#define SUBMENU_OBJALIGN 34 +#define SUBMENU_OBJANCHOR 35 +#define SUBMENU_SENDTO 36 +#define SUBMENU_CHANGES 37 +#define SUBMENU_EDIT_TABLE 38 +#define MN_TEMPLATES 39 diff --git a/sc/source/ui/inc/subtdlg.hrc b/sc/source/ui/inc/subtdlg.hrc new file mode 100644 index 000000000000..b0680ece924b --- /dev/null +++ b/sc/source/ui/inc/subtdlg.hrc @@ -0,0 +1,56 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" + +// TabDialog +#define BTN_REMOVE 1 +#define PAGE_GROUP1 2 +#define PAGE_GROUP2 3 +#define PAGE_GROUP3 4 +#define PAGE_OPTIONS 5 + +// Gruppen TabPages +#define FT_GROUP 10 +#define LB_GROUP 11 +#define FT_COLUMNS 12 +#define WND_COLUMNS 13 +#define LB_FUNCTIONS 14 +#define FT_FUNCTIONS 15 + +// Optionen TabPage +#define FL_GROUP 20 +#define BTN_PAGEBREAK 21 +#define BTN_CASE 22 +#define BTN_SORT 23 + +#define FL_SORT 30 +#define BTN_ASCENDING 31 +#define BTN_DESCENDING 32 +#define BTN_FORMATS 33 +#define BTN_USERDEF 34 +#define LB_USERDEF 35 diff --git a/sc/source/ui/inc/subtdlg.hxx b/sc/source/ui/inc/subtdlg.hxx new file mode 100644 index 000000000000..d2ca8b9e8d37 --- /dev/null +++ b/sc/source/ui/inc/subtdlg.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SUBTDLG_HXX +#define SC_SUBTDLG_HXX + +#include <sfx2/tabdlg.hxx> + +#include "scui_def.hxx" + +//================================================================== + +class ScSubTotalDlg : public SfxTabDialog +{ +public: + ScSubTotalDlg( Window* pParent, + const SfxItemSet* pArgSet ); +private: + PushButton aBtnRemove; + DECL_LINK( RemoveHdl, PushButton * ); +}; + + +#endif // SC_SUBTDLG_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabbgcolordlg.hxx b/sc/source/ui/inc/tabbgcolordlg.hxx new file mode 100644 index 000000000000..7c1870aa6cad --- /dev/null +++ b/sc/source/ui/inc/tabbgcolordlg.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TABBGCOLORDLG_HXX +#define SC_TABBGCOLORDLG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/fixed.hxx> +#include <vcl/button.hxx> +#include <svtools/valueset.hxx> + +//------------------------------------------------------------------------ + +class ScTabBgColorDlg : public ModalDialog +{ +public: + ScTabBgColorDlg( Window* pParent, + const String& rTitle, + const String& rTabBgColorNoColorText, + const Color& rDefaultColor, + const rtl::OString& nHelpId ); + ~ScTabBgColorDlg(); + + void GetSelectedColor( Color& rColor ) const; + +private: + class ScTabBgColorValueSet : public ValueSet + { + public: + ScTabBgColorValueSet(Control* pParent, const ResId& rResId, ScTabBgColorDlg* pTabBgColorDlg); + + virtual void KeyInput( const KeyEvent& rKEvt ); + private: + ScTabBgColorDlg* aTabBgColorDlg; + }; + + Control aBorderWin; + ScTabBgColorValueSet aTabBgColorSet; + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + Color aTabBgColor; + const String aTabBgColorNoColorText; + rtl::OString msHelpId; + + void FillColorValueSets_Impl(); + + DECL_LINK( TabBgColorDblClickHdl_Impl, ValueSet* ); + DECL_LINK( TabBgColorOKHdl_Impl, OKButton* pBtn ); +}; + +#endif // SC_TABBGCOLORDLG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabcont.hxx b/sc/source/ui/inc/tabcont.hxx new file mode 100644 index 000000000000..6e922fa00a29 --- /dev/null +++ b/sc/source/ui/inc/tabcont.hxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TABCONT_HXX +#define SC_TABCONT_HXX + +#include "address.hxx" +#include <svtools/tabbar.hxx> +#include <svtools/transfer.hxx> + + +class ScViewData; + +// --------------------------------------------------------------------------- + +// initial size +#define SC_TABBAR_DEFWIDTH 270 + + +class ScTabControl : public TabBar, public DropTargetHelper, public DragSourceHelper +{ +private: + ScViewData* pViewData; + sal_uInt16 nMouseClickPageId; /// Last page ID after mouse button down/up + sal_uInt16 nSelPageIdByMouse; /// Selected page ID, if selected with mouse + sal_Bool bErrorShown; + + void DoDrag( const Region& rRegion ); + + sal_uInt16 GetMaxId() const; + SCTAB GetPrivatDropPos(const Point& rPos ); + +protected: + virtual void Select(); + virtual void Command( const CommandEvent& rCEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); + virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); + + virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); + + virtual long StartRenaming(); + virtual long AllowRenaming(); + virtual void EndRenaming(); + virtual void Mirror(); + +public: + ScTabControl( Window* pParent, ScViewData* pData ); + ~ScTabControl(); + + using TabBar::StartDrag; + + void UpdateInputContext(); + void UpdateStatus(); + void ActivateView(sal_Bool bActivate); + + void SetSheetLayoutRTL( sal_Bool bSheetRTL ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabopdlg.hrc b/sc/source/ui/inc/tabopdlg.hrc new file mode 100644 index 000000000000..633c69881776 --- /dev/null +++ b/sc/source/ui/inc/tabopdlg.hrc @@ -0,0 +1,48 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "sc.hrc" // ->RID_SCDLG_TABOP + +#define ED_FORMULARANGE 1 +#define ED_ROWCELL 2 +#define ED_COLCELL 3 +#define FT_FORMULARANGE 1 +#define FT_ROWCELL 2 +#define FT_COLCELL 3 +#define RB_FORMULARANGE 1 +#define RB_ROWCELL 2 +#define RB_COLCELL 3 +#define FL_VARIABLES 1 +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 1 +#define STR_NOFORMULA 1 +#define STR_NOCOLROW 2 +#define STR_WRONGFORMULA 3 +#define STR_WRONGROWCOL 4 +#define STR_NOCOLFORMULA 5 +#define STR_NOROWFORMULA 6 diff --git a/sc/source/ui/inc/tabopdlg.hxx b/sc/source/ui/inc/tabopdlg.hxx new file mode 100644 index 000000000000..4f43614adde8 --- /dev/null +++ b/sc/source/ui/inc/tabopdlg.hxx @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TABOPDLG_HXX +#define SC_TABOPDLG_HXX + +#include <vcl/fixed.hxx> +#include <vcl/group.hxx> +#include "global.hxx" +#include "address.hxx" +#include "anyrefdg.hxx" + + +//------------------------------------------------------------------------ + +enum ScTabOpErr +{ + TABOPERR_NOFORMULA = 1, + TABOPERR_NOCOLROW, + TABOPERR_WRONGFORMULA, + TABOPERR_WRONGROW, + TABOPERR_NOCOLFORMULA, + TABOPERR_WRONGCOL, + TABOPERR_NOROWFORMULA +}; + +//======================================================================== + +class ScTabOpDlg : public ScAnyRefDlg +{ +public: + ScTabOpDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, + ScDocument* pDocument, + const ScRefAddress& rCursorPos ); + ~ScTabOpDlg(); + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); + virtual sal_Bool IsRefInputMode() const { return sal_True; } + virtual void SetActive(); + + virtual sal_Bool Close(); + +private: + FixedLine aFlVariables; + FixedText aFtFormulaRange; + formula::RefEdit aEdFormulaRange; + formula::RefButton aRBFormulaRange; + + FixedText aFtRowCell; + formula::RefEdit aEdRowCell; + formula::RefButton aRBRowCell; + + FixedText aFtColCell; + formula::RefEdit aEdColCell; + formula::RefButton aRBColCell; + + OKButton aBtnOk; + CancelButton aBtnCancel; + HelpButton aBtnHelp; + + ScRefAddress theFormulaCell; + ScRefAddress theFormulaEnd; + ScRefAddress theRowCell; + ScRefAddress theColCell; + + ScDocument* pDoc; + const SCTAB nCurTab; + formula::RefEdit* pEdActive; + sal_Bool bDlgLostFocus; + const String errMsgNoFormula; + const String errMsgNoColRow; + const String errMsgWrongFormula; + const String errMsgWrongRowCol; + const String errMsgNoColFormula; + const String errMsgNoRowFormula; + +#ifdef _TABOPDLG_CXX + void Init(); + void RaiseError( ScTabOpErr eError ); + + DECL_LINK( BtnHdl, PushButton* ); + DECL_LINK( GetFocusHdl, Control* ); + DECL_LINK( LoseFocusHdl, Control* ); +#endif // _TABOPDLG_CXX +}; + +#endif // SC_TABOPDLG_HXX + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx new file mode 100644 index 000000000000..cec2618541ac --- /dev/null +++ b/sc/source/ui/inc/tabpages.hxx @@ -0,0 +1,84 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TABPAGES_HXX +#define SC_TABPAGES_HXX + +#include <vcl/group.hxx> +#include <svtools/stdctrl.hxx> +#include <sfx2/tabdlg.hxx> + +//======================================================================== + +class ScTabPageProtection : public SfxTabPage +{ +public: + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rAttrSet ); + static sal_uInt16* GetRanges (); + virtual sal_Bool FillItemSet ( SfxItemSet& rCoreAttrs ); + virtual void Reset ( const SfxItemSet& ); + +protected: + using SfxTabPage::DeactivatePage; + virtual int DeactivatePage ( SfxItemSet* pSet = NULL ); + +private: + ScTabPageProtection( Window* pParent, + const SfxItemSet& rCoreAttrs ); + ~ScTabPageProtection(); + +private: + FixedLine aFlProtect; + TriStateBox aBtnHideCell; + TriStateBox aBtnProtect; + TriStateBox aBtnHideFormula; + FixedInfo aTxtHint; + + FixedLine aFlPrint; + TriStateBox aBtnHidePrint; + FixedInfo aTxtHint2; + + // aktueller Status: + sal_Bool bTriEnabled; // wenn vorher Dont-Care + sal_Bool bDontCare; // alles auf TriState + sal_Bool bProtect; // einzelne Einstellungen ueber TriState sichern + sal_Bool bHideForm; + sal_Bool bHideCell; + sal_Bool bHidePrint; + + // Handler: + DECL_LINK( ButtonClickHdl, TriStateBox* pBox ); + void UpdateButtons(); +}; + + + +#endif // SC_TABPAGES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabpopsh.hxx b/sc/source/ui/inc/tabpopsh.hxx new file mode 100644 index 000000000000..b9db71011897 --- /dev/null +++ b/sc/source/ui/inc/tabpopsh.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TABPOPSH_HXX +#define SC_TABPOPSH_HXX + +#include <sfx2/module.hxx> +#include <sfx2/shell.hxx> + +#include "shellids.hxx" + +class ScTabPopShell : public SfxShell +{ +public: + TYPEINFO(); + SFX_DECL_INTERFACE(SCID_TABPOP_SHELL); + + ScTabPopShell(SfxItemPool& rItemPool); + ~ScTabPopShell(); + + void DummyExec( SfxRequest& rReq ); + void DummyState( SfxItemSet& rSet ); +}; + + + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabsplit.hxx b/sc/source/ui/inc/tabsplit.hxx new file mode 100644 index 000000000000..23ba73b6b307 --- /dev/null +++ b/sc/source/ui/inc/tabsplit.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TABSPLIT_HXX +#define SC_TABSPLIT_HXX + + +#include <vcl/split.hxx> + +class ScViewData; + +class ScTabSplitter : public Splitter +{ +private: + ScViewData* pViewData; + sal_Bool bFixed; + +protected: + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + + virtual void Splitting( Point& rSplitPos ); + +public: + ScTabSplitter( Window* pParent, WinBits nWinStyle, + ScViewData* pData ); + ~ScTabSplitter(); + + void SetFixed(sal_Bool bSet); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx new file mode 100644 index 000000000000..94695bfe74ff --- /dev/null +++ b/sc/source/ui/inc/tabview.hxx @@ -0,0 +1,522 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_TABVIEW_HXX +#define SC_TABVIEW_HXX + +#include <vcl/scrbar.hxx> + +#include <sfx2/ipclient.hxx> + +#include "viewutil.hxx" +#include "select.hxx" + +class ScEditEngineDefaulter; +class ScGridWindow; +class ScOutlineWindow; +class ScRowBar; +class ScColBar; +class ScTabControl; +class ScTabViewShell; +class SfxPrinter; +class ScDrawView; +class SvBorder; +class FuPoor; +class Splitter; +class ScTabSplitter; +class SdrView; +class SdrObject; +class ScHintWindow; +class ScPageBreakData; +class ScHighlightRanges; +struct ChartSelectionInfo; +class SdrHdlList; + +namespace com { namespace sun { namespace star { +namespace chart2 { namespace data { + struct HighlightedRange; +}}}}} + +#define SPLIT_HANDLE_SIZE 3 +#define SC_FORCEMODE_NONE 0xff + +// --------------------------------------------------------------------------- +// Hilfs - Fenster + +class ScCornerButton : public Window +{ +private: + ScViewData* pViewData; + sal_Bool bAdd; + +protected: + virtual void Paint( const Rectangle& rRect ); + virtual void Resize(); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); +public: + ScCornerButton( Window* pParent, ScViewData* pData, sal_Bool bAdditional ); + ~ScCornerButton(); + + virtual void StateChanged( StateChangedType nType ); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); +}; + + +// --------------------------------------------------------------------------- + +class ScTabView +{ +private: + Window* pFrameWin; // als erstes !!! + ScViewData aViewData; // muss ganz vorne stehen ! + + ScViewSelectionEngine* pSelEngine; + ScViewFunctionSet aFunctionSet; + + ScHeaderSelectionEngine* pHdrSelEng; + ScHeaderFunctionSet aHdrFunc; + + SfxInPlaceClient* pIPClient; + + ScDrawView* pDrawView; + + Size aFrameSize; // wie bei DoResize uebergeben + Point aBorderPos; + + sal_Bool bDrawSelMode; // nur Zeichenobjekte selektieren ? + + FuPoor* pDrawActual; + FuPoor* pDrawOld; + + ScGridWindow* pGridWin[4]; + ScColBar* pColBar[2]; + ScRowBar* pRowBar[2]; + ScOutlineWindow* pColOutline[2]; + ScOutlineWindow* pRowOutline[2]; + ScTabSplitter* pHSplitter; + ScTabSplitter* pVSplitter; + ScTabControl* pTabControl; + ScrollBar aVScrollTop; + ScrollBar aVScrollBottom; // anfangs sichtbar + ScrollBar aHScrollLeft; // anfangs sichtbar + ScrollBar aHScrollRight; + ScCornerButton aCornerButton; + ScCornerButton aTopButton; + ScrollBarBox aScrollBarBox; + + ScHintWindow* pInputHintWindow; // Eingabemeldung bei Gueltigkeit + + ScPageBreakData* pPageBreakData; // fuer Seitenumbruch-Modus + ScHighlightRanges* pHighlightRanges; + + ScDocument* pBrushDocument; // cell formats for format paint brush + SfxItemSet* pDrawBrushSet; // drawing object attributes for paint brush + sal_Bool bLockPaintBrush; // keep for more than one use? + + Timer aScrollTimer; + ScGridWindow* pTimerWindow; + MouseEvent aTimerMEvt; + + sal_uLong nTipVisible; + + sal_Bool bDragging; // fuer Scrollbars + long nPrevDragPos; + + sal_Bool bIsBlockMode; // Block markieren + sal_Bool bBlockNeg; // wird Markierung aufgehoben? + sal_Bool bBlockCols; // werden ganze Spalten markiert? + sal_Bool bBlockRows; // werden ganze Zeilen markiert? + + SCCOL nBlockStartX; + SCCOL nBlockStartXOrig; + SCCOL nBlockEndX; + + SCROW nBlockStartY; + SCROW nBlockStartYOrig; + SCROW nBlockEndY; + + SCTAB nBlockStartZ; + SCTAB nBlockEndZ; + + SCCOL nOldCurX; + SCROW nOldCurY; + + double mfPendingTabBarWidth; // Tab bar width relative to frame window width. + + sal_Bool bMinimized; + sal_Bool bInUpdateHeader; + sal_Bool bInActivatePart; + sal_Bool bInZoomUpdate; + sal_Bool bMoveIsShift; + + void Init(); + + void DoAddWin( ScGridWindow* pWin ); + + void InitScrollBar( ScrollBar& rScrollBar, long nMaxVal ); + DECL_LINK( ScrollHdl, ScrollBar* ); + DECL_LINK( EndScrollHdl, ScrollBar* ); + + DECL_LINK( SplitHdl, Splitter* ); + void DoHSplit(long nSplitPos); + void DoVSplit(long nSplitPos); + + DECL_LINK( TimerHdl, Timer* ); + + void UpdateVarZoom(); + + static void SetScrollBar( ScrollBar& rScroll, long nRangeMax, long nVisible, long nPos, sal_Bool bLayoutRTL ); + static long GetScrollBarPos( ScrollBar& rScroll, sal_Bool bLayoutRTL ); + + void GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPageX, SCsROW& rPageY); + void GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, + SCsCOL& rAreaX, SCsROW& rAreaY, ScFollowMode& rMode); + + void SkipCursorHorizontal(SCsCOL& rCurX, SCsROW& rCurY, SCsCOL nOldX, SCsROW nMovX); + void SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, SCsROW nMovY); + +protected: + void UpdateHeaderWidth( const ScVSplitPos* pWhich = NULL, + const SCROW* pPosY = NULL ); + + void HideTip(); + void ShowRefTip(); + + void ZoomChanged(); + void UpdateShow(); + void UpdateVisibleRange(); + void GetBorderSize( SvBorder& rBorder, const Size& rSize ); + + void ResetDrawDragMode(); + sal_Bool IsDrawTextEdit() const; + void DrawEnableAnim(sal_Bool bSet); + //HMHvoid DrawShowMarkHdl(sal_Bool bShow); + + void MakeDrawView( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE ); + + void HideNoteMarker(); + + void UpdateIMap( SdrObject* pObj ); + +public: + ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ); + ~ScTabView(); + + void MakeDrawLayer(); + + void HideListBox(); + + sal_Bool HasHintWindow() const { return pInputHintWindow != NULL; } + void RemoveHintWindow(); + void TestHintWindow(); + + + DECL_LINK( TabBarResize, void* ); + /** Sets an absolute tab bar width (in pixels). */ + void SetTabBarWidth( long nNewWidth ); + /** Sets a relative tab bar width. + @param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */ + void SetRelTabBarWidth( double fRelTabBarWidth ); + /** Sets a relative tab bar width. Tab bar is resized again in next DoResize(). + @param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */ + void SetPendingRelTabBarWidth( double fRelTabBarWidth ); + /** Returns the current tab bar width in pixels. */ + long GetTabBarWidth() const; + /** Returns the current tab bar width relative to the frame window width (0.0 ... 1.0). */ + double GetRelTabBarWidth() const; + /** Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0). */ + double GetPendingRelTabBarWidth() const; + + void DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInner = false ); + void RepeatResize( sal_Bool bUpdateFix = sal_True ); + void UpdateFixPos(); + Point GetGridOffset() const; + + sal_Bool IsDrawSelMode() const { return bDrawSelMode; } + void SetDrawSelMode(sal_Bool bNew) { bDrawSelMode = bNew; } + + void SetDrawFuncPtr(FuPoor* pFuncPtr) { pDrawActual = pFuncPtr; } + void SetDrawFuncOldPtr(FuPoor* pFuncPtr) { pDrawOld = pFuncPtr; } + FuPoor* GetDrawFuncPtr() { return pDrawActual; } + FuPoor* GetDrawFuncOldPtr() { return pDrawOld; } + + void DrawDeselectAll(); + void DrawMarkListHasChanged(); + void UpdateAnchorHandles(); + + ScPageBreakData* GetPageBreakData() { return pPageBreakData; } + ScHighlightRanges* GetHighlightRanges() { return pHighlightRanges; } + + void UpdatePageBreakData( sal_Bool bForcePaint = false ); + + void DrawMarkRect( const Rectangle& rRect ); + + ScViewData* GetViewData() { return &aViewData; } + const ScViewData* GetViewData() const { return &aViewData; } + + ScViewFunctionSet* GetFunctionSet() { return &aFunctionSet; } + ScViewSelectionEngine* GetSelEngine() { return pSelEngine; } + + sal_Bool SelMouseButtonDown( const MouseEvent& rMEvt ); + + ScDrawView* GetScDrawView() { return pDrawView; } + SdrView* GetSdrView(); // gegen CLOKs + + sal_Bool IsMinimized() const { return bMinimized; } + + // bSameTabButMoved = true if the same sheet as before is activated, used after moving/copying/inserting/deleting a sheet + void TabChanged( bool bSameTabButMoved = false ); + void SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool bAll ); + SC_DLLPUBLIC void RefreshZoom(); + void SetPagebreakMode( sal_Bool bSet ); + + void UpdateLayerLocks(); + + void UpdateDrawTextOutliner(); + void DigitLanguageChanged(); + + void UpdateInputLine(); + + void InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType, + sal_Bool bPaint = sal_True ); + void DoneRefMode( sal_Bool bContinue = false ); + void UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ); + void StopRefMode(); + + void StopMarking(); + void FakeButtonUp( ScSplitPos eWhich ); + + Window* GetActiveWin(); + Window* GetWindowByPos( ScSplitPos ePos ); + + ScSplitPos FindWindow( Window* pWindow ) const; + + void SetActivePointer( const Pointer& rPointer ); + + void ActiveGrabFocus(); + + void ClickCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bControl ); + + SC_DLLPUBLIC void SetCursor( SCCOL nPosX, SCROW nPosY, sal_Bool bNew = false ); + + SC_DLLPUBLIC void CellContentChanged(); + void SelectionChanged(); + void CursorPosChanged(); + void UpdateInputContext(); + + void CheckSelectionTransfer(); + + void InvertHorizontal( ScVSplitPos eWhich, long nDragPos ); + void InvertVertical( ScHSplitPos eWhich, long nDragPos ); + + Point GetInsertPos(); + + Point GetChartInsertPos( const Size& rSize, const ScRange& rCellRange ); + Point GetChartDialogPos( const Size& rDialogSize, const Rectangle& rLogicChart ); + + void UpdateAutoFillMark(); + + void HideCursor(); // nur aktiver Teil + void ShowCursor(); + void HideAllCursors(); + void ShowAllCursors(); + + void AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode, + const ScSplitPos* pWhich = NULL ); + + SvxZoomType GetZoomType() const; + void SetZoomType( SvxZoomType eNew, sal_Bool bAll ); + sal_uInt16 CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom ); + +// void CalcZoom( SvxZoomType eType, sal_uInt16& rZoom, SCCOL& rCol, SCROW& rRow ); + + sal_Bool HasPageFieldDataAtCursor() const; + void StartDataSelect(); + + // MoveCursorAbs - absolut + // MoveCursorRel - einzelne Zellen + // MoveCursorPage - Bildschirmseite + // MoveCursorArea - Datenblock + // MoveCursorEnd - links oben / benutzter Bereich + + SC_DLLPUBLIC void MoveCursorAbs( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode, + sal_Bool bShift, sal_Bool bControl, + sal_Bool bKeepOld = false, sal_Bool bKeepSel = false ); + void MoveCursorRel( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, + sal_Bool bShift, sal_Bool bKeepSel = false ); + void MoveCursorPage( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, + sal_Bool bShift, sal_Bool bKeepSel = false ); + void MoveCursorArea( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, + sal_Bool bShift, sal_Bool bKeepSel = false ); + void MoveCursorEnd( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, + sal_Bool bShift, sal_Bool bKeepSel = false ); + void MoveCursorScreen( SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode, sal_Bool bShift ); + + void MoveCursorEnter( sal_Bool bShift ); // Shift fuer Richtung (kein Markieren) + + sal_Bool MoveCursorKeyInput( const KeyEvent& rKeyEvent ); + + void FindNextUnprot( sal_Bool bShift, sal_Bool bInSelection = sal_True ); + + SC_DLLPUBLIC void SetTabNo( SCTAB nTab, bool bNew = false, bool bExtendSelection = false, bool bSameTabButMoved = false ); + void SelectNextTab( short nDir, sal_Bool bExtendSelection = false ); + + void ActivateView( sal_Bool bActivate, sal_Bool bFirst ); + void ActivatePart( ScSplitPos eWhich ); + sal_Bool IsInActivatePart() const { return bInActivatePart; } + + void SetTimer( ScGridWindow* pWin, const MouseEvent& rMEvt ); + void ResetTimer(); + + void ScrollX( long nDeltaX, ScHSplitPos eWhich, sal_Bool bUpdBars = sal_True ); + void ScrollY( long nDeltaY, ScVSplitPos eWhich, sal_Bool bUpdBars = sal_True ); + SC_DLLPUBLIC void ScrollLines( long nDeltaX, long nDeltaY ); // aktives + + sal_Bool ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ); + + void ScrollToObject( SdrObject* pDrawObj ); + void MakeVisible( const Rectangle& rHMMRect ); + + // Zeichnen + + void PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, + ScUpdateMode eMode = SC_UPDATE_ALL ); + + void PaintGrid(); + + void PaintTopArea( SCCOL nStartCol, SCCOL nEndCol ); + void PaintTop(); + + void PaintLeftArea( SCROW nStartRow, SCROW nEndRow ); + void PaintLeft(); + + sal_Bool PaintExtras(); + + void RecalcPPT(); + + void CreateAnchorHandles(SdrHdlList& rHdl, const ScAddress& rAddress); + + void UpdateCopySourceOverlay(); + void UpdateSelectionOverlay(); + void UpdateShrinkOverlay(); + void UpdateAllOverlays(); + + void UpdateFormulas(); + void InterpretVisible(); + void CheckNeedsRepaint(); + + void PaintRangeFinder( long nNumber = -1 ); + void AddHighlightRange( const ScRange& rRange, const Color& rColor ); + void ClearHighlightRanges(); + + void DoChartSelection( const ::com::sun::star::uno::Sequence< + ::com::sun::star::chart2::data::HighlightedRange > & rHilightRanges ); + + long GetGridWidth( ScHSplitPos eWhich ); + long GetGridHeight( ScVSplitPos eWhich ); + + void UpdateScrollBars(); + void SetNewVisArea(); + + void InvalidateAttribs(); + + void MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW nRow ); + void KillEditView( sal_Bool bNoPaint ); + void UpdateEditView(); + + + // Bloecke + + void SelectAll( sal_Bool bContinue = false ); + void SelectAllTables(); + void DeselectAllTables(); + + void MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, + sal_Bool bCols = false, sal_Bool bRows = false, sal_Bool bCellSelection = false ); + void InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, + sal_Bool bTestNeg = false, + sal_Bool bCols = false, sal_Bool bRows = false ); + void InitOwnBlockMode(); + void DoneBlockMode( sal_Bool bContinue = false ); + + sal_Bool IsBlockMode() const { return bIsBlockMode; } + + void ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode); + void ExpandBlockPage(SCsCOL nMovX, SCsROW nMovY); + void ExpandBlockArea(SCsCOL nMovX, SCsROW nMovY); + + void MarkColumns(); + void MarkRows(); + void MarkDataArea( sal_Bool bIncludeCursor = sal_True ); + void MarkMatrixFormula(); + void Unmark(); + + void MarkRange( const ScRange& rRange, sal_Bool bSetCursor = sal_True, sal_Bool bContinue = false ); + + sal_Bool IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; + + void PaintMarks( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ); + void PaintBlock( sal_Bool bReset = false ); + + void SetMarkData( const ScMarkData& rNew ); + void MarkDataChanged(); + + void LockModifiers( sal_uInt16 nModifiers ); + sal_uInt16 GetLockedModifiers() const; + void ViewOptionsHasChanged( sal_Bool bHScrollChanged, + sal_Bool bGraphicsChanged = false); + + Point GetMousePosPixel(); + + void SnapSplitPos( Point& rScreenPosPixel ); + void FreezeSplitters( sal_Bool bFreeze ); + void RemoveSplit(); + void SplitAtCursor(); + void SplitAtPixel( const Point& rPixel, sal_Bool bHor, sal_Bool bVer ); + void InvalidateSplit(); + + void ErrorMessage( sal_uInt16 nGlobStrId ); + Window* GetParentOrChild( sal_uInt16 nChildId ); + + void EnableRefInput(sal_Bool bFlag=sal_True); + + Window* GetFrameWin() const { return pFrameWin; } + + sal_Bool HasPaintBrush() const { return pBrushDocument || pDrawBrushSet; } + ScDocument* GetBrushDocument() const { return pBrushDocument; } + SfxItemSet* GetDrawBrushSet() const { return pDrawBrushSet; } + sal_Bool IsPaintBrushLocked() const { return bLockPaintBrush; } + void SetBrushDocument( ScDocument* pNew, sal_Bool bLock ); + void SetDrawBrushSet( SfxItemSet* pNew, sal_Bool bLock ); + void ResetBrushDocument(); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx new file mode 100644 index 000000000000..c39d9a42a206 --- /dev/null +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -0,0 +1,426 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TABVWSH_HXX +#define SC_TABVWSH_HXX + +#include <svtools/htmlcfg.hxx> +#include <sfx2/viewsh.hxx> +#include <sfx2/viewfac.hxx> +#include <editeng/svxenum.hxx> +#include "scdllapi.h" +#include "dbfunc.hxx" // -> tabview +#include "target.hxx" +#include "rangelst.hxx" // ScRangeListRef +#include "shellids.hxx" +#include "tabprotection.hxx" // for ScPasswordHash + +class FmFormShell; +class SbxObject; +class SdrOle2Obj; +class SfxBindings; +class SfxChildWindow; +class SfxModelessDialog; +class SvxBoxObjectRef; +class SvxNumberInfoItem; +struct SfxChildWinInfo; + +class ScArea; +class ScAuditingShell; +class ScDrawShell; +class ScDrawTextObjectBar; +class ScEditShell; +class ScInputHandler; +class ScPivotShell; +class ScDrawFormShell; +class ScCellShell; +class ScOleObjectShell; +class ScGraphicShell; +class ScMediaShell; +class ScChartShell; +class ScPageBreakShell; +class ScDPObject; +class ScNavigatorSettings; + +struct ScHeaderFieldData; + +namespace editeng { class SvxBorderLine; } + +namespace com { namespace sun { namespace star { namespace frame { + class XDispatchProviderInterceptor; +} } } } + +namespace svx { + class ExtrusionBar; + class FontworkBar; +} + +enum ObjectSelectionType +{ + OST_NONE, + OST_Cell, + OST_Editing, + OST_DrawText, + OST_Drawing, + OST_DrawForm, + OST_Pivot, + OST_Auditing, + OST_OleObject, + OST_Chart, + OST_Graphic, + OST_Media +}; + +//================================================================== + + +class ScTabViewShell: public SfxViewShell, public ScDBFunc +{ +private: + static sal_uInt16 nInsertCtrlState; + static sal_uInt16 nInsCellsCtrlState; + static sal_uInt16 nInsObjCtrlState; + + SvxHtmlOptions aHTMLOpt; + ObjectSelectionType eCurOST; + sal_uInt16 nDrawSfxId; + sal_uInt16 nCtrlSfxId; + sal_uInt16 nFormSfxId; + String sDrawCustom; // current custom shape type + ScDrawShell* pDrawShell; + ScDrawTextObjectBar* pDrawTextShell; + ScEditShell* pEditShell; + ScPivotShell* pPivotShell; + ScAuditingShell* pAuditingShell; + ScDrawFormShell* pDrawFormShell; + ScCellShell* pCellShell; + ScOleObjectShell* pOleObjectShell; + ScChartShell* pChartShell; + ScGraphicShell* pGraphicShell; + ScMediaShell* pMediaShell; + ScPageBreakShell* pPageBreakShell; + svx::ExtrusionBar* pExtrusionBarShell; + svx::FontworkBar* pFontworkBarShell; + + FmFormShell* pFormShell; + + ScInputHandler* pInputHandler; // fuer OLE-Eingabezeile + + ::editeng::SvxBorderLine* pCurFrameLine; + + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XDispatchProviderInterceptor > + xDisProvInterceptor; + + Point aWinPos; + + ScTabViewTarget aTarget; + ScArea* pPivotSource; + ScDPObject* pDialogDPObject; + + ScNavigatorSettings* pNavSettings; + + // used in first Activate + sal_Bool bFirstActivate; + + sal_Bool bActiveDrawSh; + sal_Bool bActiveDrawTextSh; + sal_Bool bActivePivotSh; + sal_Bool bActiveAuditingSh; + sal_Bool bActiveDrawFormSh; + sal_Bool bActiveOleObjectSh; + sal_Bool bActiveChartSh; + sal_Bool bActiveGraphicSh; + sal_Bool bActiveMediaSh; + sal_Bool bActiveEditSh; + + sal_Bool bFormShellAtTop; // does the FormShell need to be on top? + + + sal_Bool bDontSwitch; // EditShell nicht abschalten + sal_Bool bInFormatDialog; // fuer GetSelectionText + sal_Bool bPrintSelected; // for result of SvxPrtQryBox + + sal_Bool bReadOnly; // um Status-Aenderungen zu erkennen + + SbxObject* pScSbxObject; + + sal_Bool bChartAreaValid; // wenn Chart aufgezogen wird + String aEditChartName; + ScRangeListRef aChartSource; + Rectangle aChartPos; + SCTAB nChartDestTab; + sal_uInt16 nCurRefDlgId; + + SfxBroadcaster* pAccessibilityBroadcaster; + + static const int MASTERENUMCOMMANDS = 6; + String aCurrShapeEnumCommand[ MASTERENUMCOMMANDS ]; + +private: + void Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE ); + + SfxShell* GetMySubShell() const; + + void DoReadUserData( const String& rData ); + void DoReadUserDataSequence( const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rSettings ); + + DECL_LINK( SimpleRefClose, String* ); + DECL_LINK( SimpleRefDone, String* ); + DECL_LINK( SimpleRefAborted, String* ); + DECL_LINK( SimpleRefChange, String* ); + DECL_LINK( FormControlActivated, FmFormShell* ); + DECL_LINK( HtmlOptionsHdl, void * ); + +protected: + virtual void Activate(sal_Bool bMDI); + virtual void Deactivate(sal_Bool bMDI); + virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = false ); + + virtual void ShowCursor(bool bOn); + + virtual void Move(); // Benachrichtigung + + virtual void AdjustPosSizePixel( const Point &rPos, const Size &rSize ); // alt + + virtual void InnerResizePixel( const Point &rOfs, const Size &rSize ); // neu + virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ); + virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ); + + virtual void QueryObjAreaPixel( Rectangle& rRect ) const; + + virtual Size GetOptimalSizePixel() const; + + virtual String GetSelectionText( sal_Bool bWholeWord ); + virtual sal_Bool HasSelection( sal_Bool bText ) const; + virtual String GetDescription() const; + + virtual void WriteUserData(String &, sal_Bool bBrowse = false); + virtual void ReadUserData(const String &, sal_Bool bBrowse = false); + virtual void WriteUserDataSequence (::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false ); + virtual void ReadUserDataSequence (const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse = false ); + + virtual void UIDeactivated( SfxInPlaceClient* pClient ); + + virtual bool KeyInput( const KeyEvent &rKeyEvent ); + virtual SdrView* GetDrawView() const; + +public: + TYPEINFO_VISIBILITY(SC_DLLPUBLIC); + + SFX_DECL_INTERFACE(SCID_TABVIEW_SHELL) + SFX_DECL_VIEWFACTORY(ScTabViewShell); + + + // -> Clone-Methode fuer Factory + + // aus einer allgemeinen Shell konstruieren und + // soviel wie moeglich uebernehmen (SliderPos etc.): + + ScTabViewShell( SfxViewFrame* pViewFrame, + SfxViewShell* pOldSh ); + + virtual ~ScTabViewShell(); + + SC_DLLPUBLIC Window* GetDialogParent(); + + bool IsRefInputMode() const; + void ExecuteInputDirect(); + + ScInputHandler* GetInputHandler() const; + void UpdateInputHandler( sal_Bool bForce = false, sal_Bool bStopEditing = sal_True ); + void UpdateInputHandlerCellAdjust( SvxCellHorJustify eJust ); + sal_Bool TabKeyInput(const KeyEvent& rKEvt); + sal_Bool SfxKeyInput(const KeyEvent& rKEvt); + + void SetActive(); + + ::editeng::SvxBorderLine* GetDefaultFrameLine() const { return pCurFrameLine; } + void SetDefaultFrameLine(const ::editeng::SvxBorderLine* pLine ); + + SC_DLLPUBLIC void Execute( SfxRequest& rReq ); + SC_DLLPUBLIC void GetState( SfxItemSet& rSet ); + + void ExecuteTable( SfxRequest& rReq ); + void GetStateTable( SfxItemSet& rSet ); + + void WindowChanged(); + void ExecDraw(SfxRequest&); + void ExecDrawIns(SfxRequest& rReq); + void GetDrawState(SfxItemSet &rSet); + void GetDrawInsState(SfxItemSet &rSet); + void ExecGallery(SfxRequest& rReq); // StarGallery + void GetGalleryState(SfxItemSet& rSet); + + void ExecChildWin(SfxRequest& rReq); + void GetChildWinState( SfxItemSet& rSet ); + + void ExecImageMap( SfxRequest& rReq ); + void GetImageMapState( SfxItemSet& rSet ); + + void ExecTbx( SfxRequest& rReq ); + void GetTbxState( SfxItemSet& rSet ); + + void ExecuteSave( SfxRequest& rReq ); + void GetSaveState( SfxItemSet& rSet ); + void ExecSearch( SfxRequest& rReq ); + + SC_DLLPUBLIC void ExecuteUndo(SfxRequest& rReq); + void GetUndoState(SfxItemSet &rSet); + + void ExecuteSbx( SfxRequest& rReq ); + void GetSbxState( SfxItemSet& rSet ); + + void ExecuteObject(SfxRequest& rReq); + void GetObjectState(SfxItemSet &rSet); + + void ExecDrawOpt(SfxRequest& rReq); + void GetDrawOptState(SfxItemSet &rSet); + + + void SetDrawShell( sal_Bool bActive ); + void SetDrawTextShell( sal_Bool bActive ); + + void SetPivotShell( sal_Bool bActive ); + ScArea* GetPivotSource(){return pPivotSource;} + void SetPivotSource(ScArea* pSrc){pPivotSource=pSrc;} + void SetDialogDPObject( const ScDPObject* pObj ); + const ScDPObject* GetDialogDPObject() const { return pDialogDPObject; } + + sal_Bool GetDontSwitch(){return bDontSwitch;} + void SetDontSwitch(sal_Bool bFlag){bDontSwitch=bFlag;} + + + void SetAuditShell( sal_Bool bActive ); + void SetDrawFormShell( sal_Bool bActive ); + void SetEditShell(EditView* pView, sal_Bool bActive ); + void SetOleObjectShell( sal_Bool bActive ); + void SetChartShell( sal_Bool bActive ); + void SetGraphicShell( sal_Bool bActive ); + void SetMediaShell( sal_Bool bActive ); + + + void SetDrawShellOrSub(); + void SetCurSubShell( ObjectSelectionType eOST, sal_Bool bForce = false ); + + void SetFormShellAtTop( sal_Bool bSet ); + + ObjectSelectionType GetCurObjectSelectionType(); + + virtual ErrCode DoVerb(long nVerb); + + + void StopEditShell(); + sal_Bool IsDrawTextShell() const; + sal_Bool IsAuditShell() const; + + void SetDrawTextUndo( ::svl::IUndoManager* pUndoMgr ); + + void FillFieldData( ScHeaderFieldData& rData ); + + void SetChartArea( const ScRangeListRef& rSource, const Rectangle& rDest ); + sal_Bool GetChartArea( ScRangeListRef& rSource, Rectangle& rDest, SCTAB& rTab ) const; + + void SetEditChartName(const String& aStr){aEditChartName=aStr;} + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + ScNavigatorSettings* GetNavigatorSettings(); + + // Drucken: + virtual SfxPrinter* GetPrinter( sal_Bool bCreate = false ); + virtual sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, + sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ); + + virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); + + void ConnectObject( SdrOle2Obj* pObj ); + sal_Bool ActivateObject( SdrOle2Obj* pObj, long nVerb ); + + void DeactivateOle(); + + SC_DLLPUBLIC static ScTabViewShell* GetActiveViewShell(); + SfxModelessDialog* CreateRefDialog( SfxBindings* pB, SfxChildWindow* pCW, + SfxChildWinInfo* pInfo, + Window* pParent, sal_uInt16 nSlotId ); + + void UpdateOleZoom(); + inline SbxObject* GetScSbxObject() const + { return pScSbxObject; } + inline void SetScSbxObject( SbxObject* pOb ) + { pScSbxObject = pOb; } + + FmFormShell* GetFormShell() const { return pFormShell; } + + void InsertURL( const String& rName, const String& rURL, const String& rTarget, + sal_uInt16 nMode ); + void InsertURLButton( const String& rName, const String& rURL, const String& rTarget, + const Point* pInsPos = NULL ); + void InsertURLField( const String& rName, const String& rURL, const String& rTarget ); + + sal_Bool SelectObject( const String& rName ); + + void SetInFormatDialog(sal_Bool bFlag) {bInFormatDialog=bFlag;} + sal_Bool IsInFormatDialog() {return bInFormatDialog;} + + void ForceMove() { Move(); } + + void MakeNumberInfoItem ( ScDocument* pDoc, + ScViewData* pViewData, + SvxNumberInfoItem** ppItem ); + + void UpdateNumberFormatter ( ScDocument* pDoc, + const SvxNumberInfoItem& rInfoItem ); + + void ExecuteCellFormatDlg ( SfxRequest& rReq, sal_uInt16 nTabPage = 0xffff ); + + sal_Bool GetFunction( String& rFuncStr, sal_uInt16 nErrCode = 0 ); + + void StartSimpleRefDialog( const String& rTitle, const String& rInitVal, + sal_Bool bCloseOnButtonUp, sal_Bool bSingleCell, sal_Bool bMultiSelection ); + void StopSimpleRefDialog(); + + void SetCurRefDlgId( sal_uInt16 nNew ); + + void AddAccessibilityObject( SfxListener& rObject ); + void RemoveAccessibilityObject( SfxListener& rObject ); + void BroadcastAccessibility( const SfxHint &rHint ); + sal_Bool HasAccessibilityObjects(); + + bool ExecuteRetypePassDlg(ScPasswordHash eDesiredHash); + + using ScTabView::ShowCursor; +}; + +//================================================================== + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/target.hxx b/sc/source/ui/inc/target.hxx new file mode 100644 index 000000000000..f01793b80206 --- /dev/null +++ b/sc/source/ui/inc/target.hxx @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TARGET_HXX +#define SC_TARGET_HXX + +#include <svl/undo.hxx> + +class ScTabViewShell; + +class ScTabViewTarget : public SfxRepeatTarget +{ +private: + ScTabViewShell* pViewShell; + +public: + TYPEINFO(); + + ScTabViewTarget( ScTabViewShell* pShell ) : pViewShell( pShell ) {} + virtual ~ScTabViewTarget(); + + ScTabViewShell* GetViewShell() const { return pViewShell; } +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tbinsert.hrc b/sc/source/ui/inc/tbinsert.hrc new file mode 100644 index 000000000000..78ff1ca0ec84 --- /dev/null +++ b/sc/source/ui/inc/tbinsert.hrc @@ -0,0 +1,30 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#define RID_TOOLBOX_INSERT 1 +#define RID_TOOLBOX_INSCELLS 2 +#define RID_TOOLBOX_INSOBJ 3 diff --git a/sc/source/ui/inc/tbinsert.hxx b/sc/source/ui/inc/tbinsert.hxx new file mode 100644 index 000000000000..1910b2f7a081 --- /dev/null +++ b/sc/source/ui/inc/tbinsert.hxx @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TBINSERT_HXX +#define SC_TBINSERT_HXX + +#include <sfx2/tbxctrl.hxx> + +class ScTbxInsertCtrl : public SfxToolBoxControl +{ + sal_uInt16 nLastSlotId; + + using SfxToolBoxControl::Select; + virtual void Select( sal_Bool bMod1 = false ); + +public: + SFX_DECL_TOOLBOX_CONTROL(); + + ScTbxInsertCtrl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rBox ); + ~ScTbxInsertCtrl(); + + virtual SfxPopupWindowType GetPopupWindowType() const; + virtual SfxPopupWindow* CreatePopupWindow(); + virtual void StateChanged( sal_uInt16 nSID, + SfxItemState eState, + const SfxPoolItem* pState ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tbzoomsliderctrl.hxx b/sc/source/ui/inc/tbzoomsliderctrl.hxx new file mode 100644 index 000000000000..481801c14af4 --- /dev/null +++ b/sc/source/ui/inc/tbzoomsliderctrl.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * +************************************************************************/ +#ifndef _SC_ZOOMSLIDERTBCONTRL_HXX +#define _SC_ZOOMSLIDERTBCONTRL_HXX + +#include <vcl/window.hxx> +#include <svl/poolitem.hxx> +#include <sfx2/tbxctrl.hxx> +#include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/frame/XFrame.hpp> +#include <svx/zoomslideritem.hxx> + + +//class ScZoomSliderControl define +class ScZoomSliderControl: public SfxToolBoxControl +{ +public: + SFX_DECL_TOOLBOX_CONTROL(); + ScZoomSliderControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ); + ~ScZoomSliderControl(); + + virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); + virtual Window* CreateItemWindow( Window *pParent ); +}; + +//======================================================================== +// class ScZoomSliderWnd define--------------------------------------- +//======================================================================== +class ScZoomSliderWnd: public Window +{ +private: + struct ScZoomSliderWnd_Impl; + ScZoomSliderWnd_Impl* mpImpl; + Size aLogicalSize; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > m_xDispatchProvider; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame; + + sal_uInt16 Offset2Zoom( long nOffset ) const; + long Zoom2Offset( sal_uInt16 nZoom ) const; + void DoPaint( const Rectangle& rRect ); + +public: + ScZoomSliderWnd( Window* pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& rDispatchProvider, + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _xFrame , sal_uInt16 nCurrentZoom ); + ~ScZoomSliderWnd(); + void UpdateFromItem( const SvxZoomSliderItem* pZoomSliderItem ); + +protected: + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void Paint( const Rectangle& rRect ); +}; +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/textdlgs.hxx b/sc/source/ui/inc/textdlgs.hxx new file mode 100644 index 000000000000..202409e00d7b --- /dev/null +++ b/sc/source/ui/inc/textdlgs.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TEXTDLGS_HXX +#define SC_TEXTDLGS_HXX + +#include <sfx2/tabdlg.hxx> + +class SfxObjectShell; + +// +// Zeichen-Tab-Dialog +// + +class ScCharDlg : public SfxTabDialog +{ +private: + const SfxItemSet& rOutAttrs; + const SfxObjectShell& rDocShell; + + virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); + +public: + ScCharDlg( Window* pParent, const SfxItemSet* pAttr, + const SfxObjectShell* pDocShell ); + ~ScCharDlg() {} +}; + +// +// Absatz-Tab-Dialog +// + +class ScParagraphDlg : public SfxTabDialog +{ +private: + const SfxItemSet& rOutAttrs; + + virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); + +public: + ScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ); + ~ScParagraphDlg() {} +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/textimportoptions.hrc b/sc/source/ui/inc/textimportoptions.hrc new file mode 100644 index 000000000000..f31c5ab05eb5 --- /dev/null +++ b/sc/source/ui/inc/textimportoptions.hrc @@ -0,0 +1,39 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <sc.hrc> + +#define BTN_OK 1 +#define BTN_CANCEL 2 +#define BTN_HELP 3 + +#define FL_CHOOSE_LANG 4 +#define RB_AUTOMATIC 5 +#define RB_CUSTOM 6 +#define LB_CUSTOM_LANG 7 +#define FL_OPTION 8 +#define BTN_CONVERT_DATE 9 diff --git a/sc/source/ui/inc/textimportoptions.hxx b/sc/source/ui/inc/textimportoptions.hxx new file mode 100644 index 000000000000..82fa4a67fcb4 --- /dev/null +++ b/sc/source/ui/inc/textimportoptions.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UI_IMPORTOPTIONS_HXX +#define SC_UI_IMPORTOPTIONS_HXX + +#include "vcl/dialog.hxx" +#include "vcl/button.hxx" +#include "vcl/fixed.hxx" +#include "i18npool/lang.h" +#include "svx/langbox.hxx" + +class ScTextImportOptionsDlg : public ModalDialog +{ +public: + ScTextImportOptionsDlg(Window* pParent); + virtual ~ScTextImportOptionsDlg(); + + virtual short Execute(); + + LanguageType getLanguageType() const; + bool isDateConversionSet() const; + +private: + void init(); + +private: + OKButton maBtnOk; + CancelButton maBtnCancel; + HelpButton maBtnHelp; + + FixedLine maFlChooseLang; + + RadioButton maRbAutomatic; + RadioButton maRbCustom; + + SvxLanguageBox maLbCustomLang; + + FixedLine maFlOption; + + CheckBox maBtnConvertDate; + + DECL_LINK( OKHdl, OKButton* ); + + DECL_LINK( RadioHdl, RadioButton* ); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx new file mode 100644 index 000000000000..9ab7c107561b --- /dev/null +++ b/sc/source/ui/inc/tpcalc.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPCALC_HXX +#define SC_TPCALC_HXX + + +#include <sfx2/tabdlg.hxx> +#include <vcl/fixed.hxx> +#include <vcl/field.hxx> +#include <vcl/group.hxx> +#include <svtools/stdctrl.hxx> +#include "editfield.hxx" + +//=================================================================== + +class ScDocOptions; + +class ScTpCalcOptions : public SfxTabPage +{ +public: + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rCoreSet ); + static sal_uInt16* GetRanges (); + virtual sal_Bool FillItemSet ( SfxItemSet& rCoreSet ); + virtual void Reset ( const SfxItemSet& rCoreSet ); + using SfxTabPage::DeactivatePage; + virtual int DeactivatePage ( SfxItemSet* pSet = NULL ); + +private: + ScTpCalcOptions( Window* pParent, + const SfxItemSet& rCoreSet ); + ~ScTpCalcOptions(); + +private: + FixedLine aGbZRefs; + CheckBox aBtnIterate; + FixedText aFtSteps; + NumericField aEdSteps; + FixedText aFtEps; + ScDoubleField aEdEps; + + FixedLine aSeparatorFL; + FixedLine aGbDate; + RadioButton aBtnDateStd; + RadioButton aBtnDateSc10; + RadioButton aBtnDate1904; + + CheckBox aBtnCase; + CheckBox aBtnCalc; + CheckBox aBtnMatch; + CheckBox aBtnRegex; + CheckBox aBtnLookUp; + CheckBox aBtnGeneralPrec; + + FixedText aFtPrec; + NumericField aEdPrec; + + ScDocOptions* pOldOptions; + ScDocOptions* pLocalOptions; + sal_uInt16 nWhichCalc; + +#ifdef _TPCALC_CXX +private: + void Init(); + + //------------------------------------ + // Handler: + DECL_LINK( RadioClickHdl, RadioButton* ); + DECL_LINK( CheckClickHdl, CheckBox* ); + +#endif +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpcompatibility.hxx b/sc/source/ui/inc/tpcompatibility.hxx new file mode 100644 index 000000000000..91f7254a3834 --- /dev/null +++ b/sc/source/ui/inc/tpcompatibility.hxx @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * LibreOffice - a multi-platform office productivity suite + * + * This file is part of LibreOffice. + * + * LibreOffice is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * LibreOffice 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with LibreOffice. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __SC_TPCOMPATIBILITY_HXX__ +#define __SC_TPCOMPATIBILITY_HXX__ + +#include <sfx2/tabdlg.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> + +#include <boost/shared_ptr.hpp> + +class ScDocOptions; + +class ScTpCompatOptions : public SfxTabPage +{ +public: + using SfxTabPage::DeactivatePage; + + static SfxTabPage* Create (Window* pParent, const SfxItemSet& rCoreAttrs); + + virtual sal_Bool FillItemSet(SfxItemSet& rCoreAttrs); + virtual void Reset(const SfxItemSet& rCoreAttrs); + virtual int DeactivatePage(SfxItemSet* pSet = NULL); + +private: + explicit ScTpCompatOptions(Window* pParent, const SfxItemSet& rCoreAttrs); + virtual ~ScTpCompatOptions(); + +private: + FixedLine maFlKeyBindings; + FixedText maFtKeyBindings; + ListBox maLbKeyBindings; + + ::boost::shared_ptr<ScDocOptions> mpOldOptions; + ::boost::shared_ptr<ScDocOptions> mpNewOptions; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx new file mode 100644 index 000000000000..ae8042e3ab2d --- /dev/null +++ b/sc/source/ui/inc/tpformula.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2010 Novell, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPFORMULA_HXX +#define SC_TPFORMULA_HXX + +#include <sfx2/tabdlg.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/edit.hxx> +#include <vcl/button.hxx> + +#include <memory> + +class ScDocOptions; +class SfxItemSet; +class Window; + +class ScTpFormulaOptions : public SfxTabPage +{ +public: + using SfxTabPage::DeactivatePage; + + static SfxTabPage* Create (Window* pParent, const SfxItemSet& rCoreSet); + +// static USHORT* GetRanges(); + virtual sal_Bool FillItemSet(SfxItemSet& rCoreSet); + virtual void Reset( const SfxItemSet& rCoreSet ); + virtual int DeactivatePage(SfxItemSet* pSet = NULL); + +private: + explicit ScTpFormulaOptions(Window* pParent, const SfxItemSet& rCoreSet); + virtual ~ScTpFormulaOptions(); + + void Init(); + void ResetSeparators(); + void OnFocusSeparatorInput(Edit* pEdit); + + bool IsValidSeparator(const ::rtl::OUString& rSep) const; + bool IsValidSeparatorSet() const; + + DECL_LINK( ButtonHdl, PushButton* ); + DECL_LINK( SepModifyHdl, Edit* ); + DECL_LINK( SepEditOnFocusHdl, Edit* ); + +private: + FixedLine maFlFormulaOpt; + FixedText maFtFormulaSyntax; + ListBox maLbFormulaSyntax; + CheckBox maCbEnglishFuncName; + + FixedLine maFlFormulaSeps; + FixedText maFtSepFuncArg; + Edit maEdSepFuncArg; + FixedText maFtSepArrayCol; + Edit maEdSepArrayCol; + FixedText maFtSepArrayRow; + Edit maEdSepArrayRow; + PushButton maBtnSepReset; + + ::std::auto_ptr<ScDocOptions> mpOldOptions; + ::std::auto_ptr<ScDocOptions> mpNewOptions; + + /** Stores old separator value of currently focused separator edit box. + This value is used to revert undesired value change. */ + ::rtl::OUString maOldSepValue; + + sal_Unicode mnDecSep; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx new file mode 100644 index 000000000000..171b1a56af90 --- /dev/null +++ b/sc/source/ui/inc/tphf.hxx @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPHF_HXX +#define SC_TPHF_HXX + + +#include <svx/hdft.hxx> + +class ScStyleDlg; + +//======================================================================== + +class ScHFPage : public SvxHFPage +{ +public: + virtual ~ScHFPage(); + + virtual void Reset( const SfxItemSet& rSet ); + virtual sal_Bool FillItemSet( SfxItemSet& rOutSet ); + + void SetPageStyle( const String& rName ) { aStrPageStyle = rName; } + void SetStyleDlg ( const ScStyleDlg* pDlg ) { pStyleDlg = pDlg; } + +protected: + ScHFPage( Window* pParent, + sal_uInt16 nResId, + const SfxItemSet& rSet, + sal_uInt16 nSetId ); + + virtual void ActivatePage(); + virtual void DeactivatePage(); + virtual void ActivatePage( const SfxItemSet& rSet ); + virtual int DeactivatePage( SfxItemSet* pSet = 0 ); + +private: + PushButton aBtnEdit; + SfxItemSet aDataSet; + String aStrPageStyle; + sal_uInt16 nPageUsage; + const ScStyleDlg* pStyleDlg; + +#ifdef _TPHF_CXX +private: + DECL_LINK( BtnHdl, PushButton* ); + DECL_LINK( HFEditHdl, void* ); + DECL_LINK( TurnOnHdl, CheckBox* ); +#endif +}; + +//======================================================================== + +class ScHeaderPage : public ScHFPage +{ +public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet ); + static sal_uInt16* GetRanges(); + +private: + ScHeaderPage( Window* pParent, const SfxItemSet& rSet ); +}; + +//======================================================================== + +class ScFooterPage : public ScHFPage +{ +public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet ); + static sal_uInt16* GetRanges(); + +private: + ScFooterPage( Window* pParent, const SfxItemSet& rSet ); +}; + + +#endif // SC_TPHF_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tphfedit.hxx b/sc/source/ui/inc/tphfedit.hxx new file mode 100644 index 000000000000..7c1a994e1080 --- /dev/null +++ b/sc/source/ui/inc/tphfedit.hxx @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPHFEDIT_HXX +#define SC_TPHFEDIT_HXX + +#include <sfx2/tabdlg.hxx> +#include <svx/pageitem.hxx> +#include <svtools/stdctrl.hxx> +#include <vcl/group.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/timer.hxx> +#include <vcl/virdev.hxx> +#include "scdllapi.h" +#include "scitems.hxx" // wegen enum SvxNumType +#include "popmenu.hxx" +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <cppuhelper/weakref.hxx> + +//=================================================================== + +class ScHeaderEditEngine; +class ScPatternAttr; +class EditView; +class EditTextObject; +class SvxFieldItem; +class ScAccessibleEditObject; +class ScEditWindow; + +SC_DLLPUBLIC ScEditWindow* GetScEditWindow (); + +enum ScEditWindowLocation +{ + Left, + Center, + Right +}; + +class SC_DLLPUBLIC ScEditWindow : public Control +{ +public: + ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLocation eLoc ); + ~ScEditWindow(); + + using Control::SetFont; + void SetFont( const ScPatternAttr& rPattern ); + using Control::SetText; + void SetText( const EditTextObject& rTextObject ); + EditTextObject* CreateTextObject(); + void SetCharAttriutes(); + + void InsertField( const SvxFieldItem& rFld ); + + void SetNumType(SvxNumType eNumType); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); + + inline ScHeaderEditEngine* GetEditEngine() const {return pEdEngine;} +protected: + virtual void Paint( const Rectangle& rRec ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + virtual void KeyInput( const KeyEvent& rKEvt ); + virtual void Command( const CommandEvent& rCEvt ); + virtual void GetFocus(); + virtual void LoseFocus(); + +private: + ScHeaderEditEngine* pEdEngine; + EditView* pEdView; + ScEditWindowLocation eLocation; + bool mbRTL; + + com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAcc; + ScAccessibleEditObject* pAcc; +}; + +//=================================================================== +class SC_DLLPUBLIC ScExtIButton : public ImageButton +{ +private: + + Timer aTimer; + ScPopupMenu* pPopupMenu; + Link aMLink; + sal_uInt16 nSelected; + + SC_DLLPRIVATE DECL_LINK( TimerHdl, Timer*); + +protected: + + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt); + virtual void Click(); + + virtual void StartPopup(); + +public: + + ScExtIButton(Window* pParent, const ResId& rResId ); + + void SetPopupMenu(ScPopupMenu* pPopUp); + + sal_uInt16 GetSelected(); + + void SetMenuHdl( const Link& rLink ) { aMLink = rLink; } + const Link& GetMenuHdl() const { return aMLink; } + + virtual long PreNotify( NotifyEvent& rNEvt ); +}; + +#endif // SC_TPHFEDIT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx new file mode 100644 index 000000000000..7aa00147fa64 --- /dev/null +++ b/sc/source/ui/inc/tpprint.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPPRINT_HXX +#define SC_TPPRINT_HXX + +#include <sfx2/tabdlg.hxx> +#include <vcl/fixed.hxx> + +//=================================================================== + +class ScTpPrintOptions : public SfxTabPage +{ + FixedLine aPagesFL; + CheckBox aSkipEmptyPagesCB; + FixedLine aSheetsFL; + CheckBox aSelectedSheetsCB; + + ScTpPrintOptions( Window* pParent, const SfxItemSet& rCoreSet ); + ~ScTpPrintOptions(); + +public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rCoreSet ); + static sal_uInt16* GetRanges(); + virtual sal_Bool FillItemSet( SfxItemSet& rCoreSet ); + virtual void Reset( const SfxItemSet& rCoreSet ); + using SfxTabPage::DeactivatePage; + virtual int DeactivatePage( SfxItemSet* pSet = NULL ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx new file mode 100644 index 000000000000..fefd0575f3d2 --- /dev/null +++ b/sc/source/ui/inc/tpsort.hxx @@ -0,0 +1,224 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPSORT_HXX +#define SC_TPSORT_HXX + + +#include <sfx2/tabdlg.hxx> +#include <vcl/edit.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <svtools/stdctrl.hxx> +#include <svx/langbox.hxx> + + +#include "global.hxx" +#include "address.hxx" + +//------------------------------------------------------------------------ + +// +1 because one field is reserved for the "- undefined -" entry +#define SC_MAXFIELDS MAXCOLCOUNT+1 + +class ScViewData; +class ScSortDlg; +struct ScSortParam; + +//======================================================================== +// Kriterien (Sort Criteria) + +class ScTabPageSortFields : public SfxTabPage +{ +public: + ScTabPageSortFields( Window* pParent, + const SfxItemSet& rArgSet ); + ~ScTabPageSortFields(); + + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rArgSet ); + static sal_uInt16* GetRanges (); + virtual sal_Bool FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); + +protected: +// fuer Datenaustausch (sollte noch umgestellt werden!) +// virtual void ActivatePage ( const SfxItemSet& rSet ); + using SfxTabPage::ActivatePage; + using SfxTabPage::DeactivatePage; + virtual void ActivatePage (); + virtual int DeactivatePage ( SfxItemSet* pSet = 0); + +private: + FixedLine aFlSort1; + ListBox aLbSort1; + RadioButton aBtnUp1; + RadioButton aBtnDown1; + + FixedLine aFlSort2; + ListBox aLbSort2; + RadioButton aBtnUp2; + RadioButton aBtnDown2; + + FixedLine aFlSort3; + ListBox aLbSort3; + RadioButton aBtnUp3; + RadioButton aBtnDown3; + + String aStrUndefined; + String aStrColumn; + String aStrRow; + + const sal_uInt16 nWhichSort; + ScSortDlg* pDlg; + ScViewData* pViewData; + const ScSortParam& rSortData; + SCCOLROW nFieldArr[SC_MAXFIELDS]; + sal_uInt16 nFieldCount; + SCCOL nFirstCol; + SCROW nFirstRow; + sal_Bool bHasHeader; + sal_Bool bSortByRows; + + ListBox* aSortLbArr[3]; + RadioButton* aDirBtnArr[3][2]; + FixedLine* aFlArr[3]; + +#ifdef _TPSORT_CXX +private: + void Init (); + void DisableField ( sal_uInt16 nField ); + void EnableField ( sal_uInt16 nField ); + void FillFieldLists (); + sal_uInt16 GetFieldSelPos ( SCCOLROW nField ); + + // Handler ------------------------ + DECL_LINK( SelectHdl, ListBox * ); +#endif +}; + +//======================================================================== +// Sortieroptionen (Sort Options) + +class ScDocument; +class ScRangeData; +class CollatorRessource; +class CollatorWrapper; + +#if ENABLE_LAYOUT_EXPERIMENTAL +#include <sfx2/layout.hxx> +#include <layout/layout-pre.hxx> +#else /* !ENABLE_LAYOUT_EXPERIMENTAL */ +#define LocalizedString String +#endif /* !ENABLE_LAYOUT_EXPERIMENTAL */ + +class ScTabPageSortOptions : public SfxTabPage +{ +public: + ScTabPageSortOptions( Window* pParent, + const SfxItemSet& rArgSet ); + ~ScTabPageSortOptions(); + +#undef SfxTabPage +#define SfxTabPage ::SfxTabPage + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rArgSet ); + static sal_uInt16* GetRanges (); + virtual sal_Bool FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); + +protected: +// fuer Datenaustausch (sollte noch umgestellt werden!) +// virtual void ActivatePage ( const SfxItemSet& rSet ); + using SfxTabPage::ActivatePage; + using SfxTabPage::DeactivatePage; + virtual void ActivatePage (); + virtual int DeactivatePage ( SfxItemSet* pSet = 0); + +private: + + CheckBox aBtnCase; + CheckBox aBtnHeader; + CheckBox aBtnFormats; + CheckBox aBtnNaturalSort; + + CheckBox aBtnCopyResult; + ListBox aLbOutPos; + Edit aEdOutPos; + + CheckBox aBtnSortUser; + ListBox aLbSortUser; + + FixedText aFtLanguage; + SvxLanguageBox aLbLanguage; + FixedText aFtAlgorithm; + ListBox aLbAlgorithm; + + FixedLine aLineDirection; + RadioButton aBtnTopDown; + RadioButton aBtnLeftRight; + +// FixedText aFtAreaLabel; +// FixedInfo aFtArea; + LocalizedString aStrRowLabel; + LocalizedString aStrColLabel; + LocalizedString aStrUndefined; + String aStrAreaLabel; + + const sal_uInt16 nWhichSort; + const ScSortParam& rSortData; + ScViewData* pViewData; + ScDocument* pDoc; + ScSortDlg* pDlg; + ScAddress theOutPos; + + CollatorRessource* pColRes; + CollatorWrapper* pColWrap; + +#ifdef _TPSORT_CXX +private: + void Init (); + void FillUserSortListBox (); + void FillOutPosList (); + + // Handler ------------------------ + DECL_LINK( EnableHdl, CheckBox * ); + DECL_LINK( SelOutPosHdl, ListBox * ); + void EdOutPosModHdl ( Edit* pEd ); + DECL_LINK( SortDirHdl, RadioButton * ); + DECL_LINK( FillAlgorHdl, void * ); +#endif +}; + +#if ENABLE_LAYOUT_EXPERIMENTAL +#include <layout/layout-post.hxx> +#endif /* ENABLE_LAYOUT_EXPERIMENTAL */ + +#endif // SC_TPSORT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpstat.hxx b/sc/source/ui/inc/tpstat.hxx new file mode 100644 index 000000000000..46f6b7fdaf0e --- /dev/null +++ b/sc/source/ui/inc/tpstat.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPSTAT_HXX +#define SC_TPSTAT_HXX + + +#include <sfx2/tabdlg.hxx> +#include <vcl/fixed.hxx> +#include <svtools/stdctrl.hxx> + + + +//======================================================================== + +class ScDocStatPage: public SfxTabPage +{ +public: + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet ); + +private: + ScDocStatPage( Window *pParent, const SfxItemSet& rSet ); + ~ScDocStatPage(); + +protected: + virtual sal_Bool FillItemSet( SfxItemSet& rSet ); + virtual void Reset ( const SfxItemSet& rSet ); + +private: + FixedLine aFlInfo; + FixedText aFtTablesLbl; + FixedInfo aFtTables; + FixedText aFtCellsLbl; + FixedInfo aFtCells; + FixedText aFtPagesLbl; + FixedInfo aFtPages; +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx new file mode 100644 index 000000000000..8accbe98279b --- /dev/null +++ b/sc/source/ui/inc/tpsubt.hxx @@ -0,0 +1,191 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPSUBT_HXX +#define SC_TPSUBT_HXX + +#include <sfx2/tabdlg.hxx> +#include <svx/checklbx.hxx> +#include <vcl/fixed.hxx> +#include "global.hxx" + +//------------------------------------------------------------------------ + +// +1 because one field is reserved for the "- none -" entry +#define SC_MAXFIELDS MAXCOLCOUNT+1 + +class ScViewData; +class ScDocument; +struct ScSubTotalParam; + +//======================================================================== +// Gruppenseiten: Basisklasse + +class ScTpSubTotalGroup : public SfxTabPage +{ +protected: + ScTpSubTotalGroup( Window* pParent, sal_uInt16 nResId, + const SfxItemSet& rArgSet ); + +public: + virtual ~ScTpSubTotalGroup(); + + static sal_uInt16* GetRanges (); + bool DoReset ( sal_uInt16 nGroupNo, + const SfxItemSet& rArgSet ); + bool DoFillItemSet ( sal_uInt16 nGroupNo, + SfxItemSet& rArgSet ); +protected: + FixedText aFtGroup; + ListBox aLbGroup; + FixedText aFtColumns; + SvxCheckListBox aLbColumns; + FixedText aFtFunctions; + ListBox aLbFunctions; + const String aStrNone; + const String aStrColumn; + + ScViewData* pViewData; + ScDocument* pDoc; + + const sal_uInt16 nWhichSubTotals; + const ScSubTotalParam& rSubTotalData; + SCCOL nFieldArr[SC_MAXFIELDS]; + const sal_uInt16 nFieldCount; + +private: + void Init (); + void FillListBoxes (); + ScSubTotalFunc LbPosToFunc ( sal_uInt16 nPos ); + sal_uInt16 FuncToLbPos ( ScSubTotalFunc eFunc ); + sal_uInt16 GetFieldSelPos ( SCCOL nField ); + + // Handler ------------------------ + DECL_LINK( SelectHdl, ListBox * ); + DECL_LINK( CheckHdl, ListBox * ); +}; + +//------------------------------------------------------------------------ + +class ScTpSubTotalGroup1 : public ScTpSubTotalGroup +{ +protected: + ScTpSubTotalGroup1( Window* pParent, + const SfxItemSet& rArgSet ); + +public: + virtual ~ScTpSubTotalGroup1(); + + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rArgSet ); + virtual sal_Bool FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); +}; + +//------------------------------------------------------------------------ + +class ScTpSubTotalGroup2 : public ScTpSubTotalGroup +{ +protected: + ScTpSubTotalGroup2( Window* pParent, + const SfxItemSet& rArgSet ); + +public: + virtual ~ScTpSubTotalGroup2(); + + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rArgSet ); + virtual sal_Bool FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); +}; + +//------------------------------------------------------------------------ + +class ScTpSubTotalGroup3 : public ScTpSubTotalGroup +{ +protected: + ScTpSubTotalGroup3( Window* pParent, + const SfxItemSet& rArgSet ); + +public: + virtual ~ScTpSubTotalGroup3(); + + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rArgSet ); + virtual sal_Bool FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); +}; + +//======================================================================== +// Optionen: + +class ScTpSubTotalOptions : public SfxTabPage +{ +protected: + ScTpSubTotalOptions( Window* pParent, + const SfxItemSet& rArgSet ); + +public: + virtual ~ScTpSubTotalOptions(); + + static sal_uInt16* GetRanges (); + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rArgSet ); + virtual sal_Bool FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); + +private: + FixedLine aFlGroup; + CheckBox aBtnPagebreak; + CheckBox aBtnCase; + CheckBox aBtnSort; + FixedLine aFlSort; + RadioButton aBtnAscending; + RadioButton aBtnDescending; + CheckBox aBtnFormats; + CheckBox aBtnUserDef; + ListBox aLbUserDef; + + ScViewData* pViewData; + ScDocument* pDoc; + const sal_uInt16 nWhichSubTotals; + const ScSubTotalParam& rSubTotalData; + +private: + void Init (); + void FillUserSortListBox (); + + // Handler ------------------------ + DECL_LINK( CheckHdl, CheckBox * ); +}; + + + +#endif // SC_TPSORT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx new file mode 100644 index 000000000000..d72b9f306e4e --- /dev/null +++ b/sc/source/ui/inc/tptable.hxx @@ -0,0 +1,116 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPTABLE_HXX +#define SC_TPTABLE_HXX + +#include <sfx2/tabdlg.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/field.hxx> + +//=================================================================== + +/** A vcl/NumericField that additionally supports empty text. + @descr Value 0 is set as empty text, and empty text is returned as 0. */ +class EmptyNumericField : public NumericField +{ +public: + inline explicit EmptyNumericField( Window* pParent, WinBits nWinStyle ) : + NumericField( pParent, nWinStyle ) {} + inline explicit EmptyNumericField( Window* pParent, const ResId& rResId ) : + NumericField( pParent, rResId ) {} + + virtual void Modify(); + virtual void SetValue( sal_Int64 nValue ); + virtual sal_Int64 GetValue() const; +}; + +//=================================================================== + +class ScTablePage : public SfxTabPage +{ +public: + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rCoreSet ); + static sal_uInt16* GetRanges (); + virtual sal_Bool FillItemSet ( SfxItemSet& rCoreSet ); + virtual void Reset ( const SfxItemSet& rCoreSet ); + using SfxTabPage::DeactivatePage; + virtual int DeactivatePage ( SfxItemSet* pSet = NULL ); + virtual void DataChanged ( const DataChangedEvent& rDCEvt ); + +private: + ScTablePage( Window* pParent, const SfxItemSet& rCoreSet ); + virtual ~ScTablePage(); + + void ShowImage(); + +private: + FixedLine aFlPageDir; + RadioButton aBtnTopDown; + RadioButton aBtnLeftRight; + FixedImage aBmpPageDir; + Image aImgLeftRight; + Image aImgTopDown; + CheckBox aBtnPageNo; + NumericField aEdPageNo; + + FixedLine aFlPrint; + CheckBox aBtnHeaders; + CheckBox aBtnGrid; + CheckBox aBtnNotes; + CheckBox aBtnObjects; + CheckBox aBtnCharts; + CheckBox aBtnDrawings; + CheckBox aBtnFormulas; + CheckBox aBtnNullVals; + + FixedLine aFlScale; + FixedText aFtScaleMode; + ListBox aLbScaleMode; + FixedText aFtScaleAll; + MetricField aEdScaleAll; + FixedText aFtScalePageWidth; + EmptyNumericField aEdScalePageWidth; + FixedText aFtScalePageHeight; + EmptyNumericField aEdScalePageHeight; + FixedText aFtScalePageNum; + NumericField aEdScalePageNum; + +private: + //------------------------------------ + // Handler: + DECL_LINK( PageDirHdl, RadioButton* ); + DECL_LINK( PageNoHdl, CheckBox* ); + DECL_LINK( ScaleHdl, ListBox* ); +}; + +#endif // SC_TPTABLE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx new file mode 100644 index 000000000000..f627baa52225 --- /dev/null +++ b/sc/source/ui/inc/tpusrlst.hxx @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPUSRLST_HXX +#define SC_TPUSRLST_HXX + +#include <sfx2/tabdlg.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <svtools/svmedit.hxx> + +//======================================================================== +// Benutzerdefinierte Listen: + +class ScUserList; +class ScDocument; +class ScViewData; +class ScRangeUtil; + +class ScTpUserLists : public SfxTabPage +{ +public: + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rAttrSet ); + static sal_uInt16* GetRanges (); + virtual sal_Bool FillItemSet ( SfxItemSet& rCoreAttrs ); + virtual void Reset ( const SfxItemSet& rCoreAttrs ); + using SfxTabPage::DeactivatePage; + virtual int DeactivatePage ( SfxItemSet* pSet = NULL ); + +private: + ScTpUserLists( Window* pParent, + const SfxItemSet& rArgSet ); + ~ScTpUserLists(); + +private: + FixedText aFtLists; + ListBox aLbLists; + FixedText aFtEntries; + MultiLineEdit aEdEntries; + FixedText aFtCopyFrom; + Edit aEdCopyFrom; + PushButton aBtnNew; + PushButton aBtnAdd; + PushButton aBtnRemove; + PushButton aBtnCopy; + + const String aStrQueryRemove; + const String aStrNew; + const String aStrCancel; + const String aStrAdd; + const String aStrModify; + const String aStrCopyList; + const String aStrCopyFrom; + const String aStrCopyErr; + + const sal_uInt16 nWhichUserLists; + ScUserList* pUserLists; + + ScDocument* pDoc; + ScViewData* pViewData; + ScRangeUtil* pRangeUtil; + String aStrSelectedArea; + + sal_Bool bModifyMode; + sal_Bool bCancelMode; + sal_Bool bCopyDone; + sal_uInt16 nCancelPos; + +#ifdef _TPUSRLST_CXX +private: + void Init (); + sal_uInt16 UpdateUserListBox (); + void UpdateEntries ( sal_uInt16 nList ); + void MakeListStr ( String& rListStr ); + void AddNewList ( const String& rEntriesStr ); + void RemoveList ( sal_uInt16 nList ); + void ModifyList ( sal_uInt16 nSelList, + const String& rEntriesStr ); + void CopyListFromArea ( const ScRefAddress& rStartPos, + const ScRefAddress& rEndPos ); + + // Handler: + DECL_LINK( LbSelectHdl, ListBox* ); + DECL_LINK( BtnClickHdl, PushButton* ); + DECL_LINK( EdEntriesModHdl, MultiLineEdit* ); +#endif +}; + + + +#endif // SC_TPUSRLST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx new file mode 100644 index 000000000000..68093f0ce0f5 --- /dev/null +++ b/sc/source/ui/inc/tpview.hxx @@ -0,0 +1,173 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPVIEW_HXX +#define SC_TPVIEW_HXX + +#include <sfx2/tabdlg.hxx> +#include <vcl/field.hxx> +#include <vcl/fixed.hxx> +#include <vcl/group.hxx> +#include <svtools/ctrlbox.hxx> +#include <svx/strarray.hxx> + +//======================================================================== +// View-Optionen: + +class ScViewOptions; + +//======================================================================== +// TabPage Inhalte + +class ScTpContentOptions : public SfxTabPage +{ + FixedLine aLinesGB; + CheckBox aGridCB; + FixedText aColorFT; + ColorListBox aColorLB; + CheckBox aBreakCB; + CheckBox aGuideLineCB; + CheckBox aHandleCB; + CheckBox aBigHandleCB; + + FixedLine aSeparator1FL; + + FixedLine aDisplayGB; + CheckBox aFormulaCB; + CheckBox aNilCB; + CheckBox aAnnotCB; + CheckBox aValueCB; + CheckBox aAnchorCB; + CheckBox aClipMarkCB; + CheckBox aRangeFindCB; + + FixedLine aObjectGB; + FixedText aObjGrfFT; + ListBox aObjGrfLB; + FixedText aDiagramFT; + ListBox aDiagramLB; + FixedText aDrawFT; + ListBox aDrawLB; + + FixedLine aZoomGB; + CheckBox aSyncZoomCB; + + FixedLine aSeparator2FL; + + FixedLine aWindowGB; + CheckBox aRowColHeaderCB; + CheckBox aHScrollCB; + CheckBox aVScrollCB; + CheckBox aTblRegCB; + CheckBox aOutlineCB; + + ScViewOptions* pLocalOptions; + + void InitGridOpt(); + DECL_LINK( GridHdl, CheckBox* ); + DECL_LINK( SelLbObjHdl, ListBox* ); + DECL_LINK( CBHdl, CheckBox* ); + + ScTpContentOptions( Window* pParent, + const SfxItemSet& rArgSet ); + ~ScTpContentOptions(); + +public: + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rCoreSet ); + virtual sal_Bool FillItemSet ( SfxItemSet& rCoreSet ); + virtual void Reset ( const SfxItemSet& rCoreSet ); + using SfxTabPage::ActivatePage; + using SfxTabPage::DeactivatePage; + virtual void ActivatePage( const SfxItemSet& ); + virtual int DeactivatePage( SfxItemSet* pSet = 0 ); + + +}; + +//======================================================================== +// TabPage Layout +class ScDocument; +class ScTpLayoutOptions : public SfxTabPage +{ + FixedLine aUnitGB; + FixedText aUnitFT; + ListBox aUnitLB; + FixedText aTabFT; + MetricField aTabMF; + + FixedLine aSeparatorFL; + FixedLine aLinkGB; + FixedText aLinkFT; + RadioButton aAlwaysRB; + RadioButton aRequestRB; + RadioButton aNeverRB; + + FixedLine aOptionsGB; + CheckBox aAlignCB; + ListBox aAlignLB; + CheckBox aEditModeCB; + CheckBox aFormatCB; + CheckBox aExpRefCB; + CheckBox aMarkHdrCB; + CheckBox aTextFmtCB; + CheckBox aReplWarnCB; + + SvxStringArray aUnitArr; + + DECL_LINK( CBHdl, CheckBox* ); + + DECL_LINK(MetricHdl, ListBox*); + DECL_LINK( AlignHdl, CheckBox* ); + + ScDocument *pDoc; + + DECL_LINK( UpdateHdl, CheckBox* ); + + ScTpLayoutOptions( Window* pParent, + const SfxItemSet& rArgSet ); + ~ScTpLayoutOptions(); + +public: + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rCoreSet ); + virtual sal_Bool FillItemSet ( SfxItemSet& rCoreSet ); + virtual void Reset ( const SfxItemSet& rCoreSet ); + using SfxTabPage::ActivatePage; + using SfxTabPage::DeactivatePage; + virtual void ActivatePage( const SfxItemSet& ); + virtual int DeactivatePage( SfxItemSet* pSet = 0 ); + + void SetDocument(ScDocument* pPtr){pDoc = pPtr;} + +}; +//======================================================================== + +#endif // SC_TPUSRLST_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/transobj.hxx b/sc/source/ui/inc/transobj.hxx new file mode 100644 index 000000000000..2afa83c05cb6 --- /dev/null +++ b/sc/source/ui/inc/transobj.hxx @@ -0,0 +1,118 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TRANSOBJ_HXX +#define SC_TRANSOBJ_HXX + +#include <svtools/transfer.hxx> +#include "global.hxx" +#include "address.hxx" + +class ScDocShell; +class ScMarkData; +class SfxObjectShell; + +namespace com { namespace sun { namespace star { + namespace sheet { + class XSheetCellRanges; + } +}}} + +#include <sfx2/objsh.hxx> + +class ScTransferObj : public TransferableHelper +{ +private: + ScDocument* pDoc; + ScRange aBlock; + SCROW nNonFiltered; // non-filtered rows + TransferableDataHelper aOleData; + TransferableObjectDescriptor aObjDesc; + SfxObjectShellRef aDocShellRef; + SfxObjectShellRef aDrawPersistRef; + com::sun::star::uno::Reference<com::sun::star::sheet::XSheetCellRanges> xDragSourceRanges; + SCCOL nDragHandleX; + SCROW nDragHandleY; + SCTAB nVisibleTab; + sal_uInt16 nDragSourceFlags; + sal_Bool bDragWasInternal; + sal_Bool bUsedForLink; + bool bHasFiltered; // if has filtered rows + bool bUseInApi; // to recognize clipboard content copied from API + + void InitDocShell(); + static void StripRefs( ScDocument* pDoc, SCCOL nStartX, SCROW nStartY, + SCCOL nEndX, SCROW nEndY, + ScDocument* pDestDoc=0, + SCCOL nSubX=0, SCROW nSubY=0 ); + static void PaintToDev( OutputDevice* pDev, ScDocument* pDoc, double nPrintFactor, + const ScRange& rBlock, sal_Bool bMetaFile ); + static void GetAreaSize( ScDocument* pDoc, SCTAB nTab1, SCTAB nTab2, SCROW& nRow, SCCOL& nCol ); + +public: + ScTransferObj( ScDocument* pClipDoc, const TransferableObjectDescriptor& rDesc ); + virtual ~ScTransferObj(); + + virtual void AddSupportedFormats(); + virtual sal_Bool GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + virtual sal_Bool WriteObject( SotStorageStreamRef& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId, + const ::com::sun::star::datatransfer::DataFlavor& rFlavor ); + virtual void ObjectReleased(); + virtual void DragFinished( sal_Int8 nDropAction ); + + ScDocument* GetDocument() { return pDoc; } // owned by ScTransferObj + const ScRange& GetRange() const { return aBlock; } + SCROW GetNonFilteredRows() const { return nNonFiltered; } + SCCOL GetDragHandleX() const { return nDragHandleX; } + SCROW GetDragHandleY() const { return nDragHandleY; } + SCTAB GetVisibleTab() const { return nVisibleTab; } + sal_uInt16 GetDragSourceFlags() const { return nDragSourceFlags; } + bool HasFilteredRows() const { return bHasFiltered; } + bool GetUseInApi() const { return bUseInApi; } + ScDocShell* GetSourceDocShell(); + ScDocument* GetSourceDocument(); + ScMarkData GetSourceMarkData(); + + void SetDrawPersist( const SfxObjectShellRef& rRef ); + void SetDragHandlePos( SCCOL nX, SCROW nY ); + void SetVisibleTab( SCTAB nNew ); + void SetDragSource( ScDocShell* pSourceShell, const ScMarkData& rMark ); + void SetDragSourceFlags( sal_uInt16 nFlags ); + void SetDragWasInternal(); + SC_DLLPUBLIC void SetUseInApi( bool bSet ); + + static SC_DLLPUBLIC ScTransferObj* GetOwnClipboard( Window* pUIWin ); + + static SfxObjectShell* SetDrawClipDoc( sal_Bool bAnyOle ); // update ScGlobal::pDrawClipDocShellRef + virtual sal_Int64 SAL_CALL getSomething( const com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( com::sun::star::uno::RuntimeException ); + static const com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx new file mode 100644 index 000000000000..c97c14143798 --- /dev/null +++ b/sc/source/ui/inc/ui_pch.hxx @@ -0,0 +1,327 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// ItemID-Defines etc. muessen immer ganz vorne stehen + +#include "scitems.hxx" + +#define _ZFORLIST_DECLARE_TABLE + +#define _PRINTFUN_CXX +#define _INPUTHDL_CXX + +#include <tools/solar.h> +#include <tools/string.hxx> +#include <svl/solar.hrc> +#include <tools/rtti.hxx> +#include <string.h> +#include <tools/contnr.hxx> +#include <vcl/sv.h> +#include <tools/ref.hxx> +#include <tools/link.hxx> +#include <i18npool/lang.h> +#include <sfx2/sfx.hrc> +#include <svl/memberid.hrc> +#include <sfx2/sfxsids.hrc> +#include <svl/cntwids.hrc> +#include <tools/resid.hxx> +#include <tools/rc.hxx> +#include <tools/resmgr.hxx> +#include <tools/gen.hxx> +#include <tools/fract.hxx> +#include <tools/date.hxx> +#include <tools/time.hxx> +#include <vcl/keycod.hxx> +#include <vcl/keycodes.hxx> +#include <tools/globname.hxx> +#include <tools/color.hxx> +#include <vcl/region.hxx> +#include <vcl/mapmod.hxx> +#include <vcl/bitmap.hxx> +#include <svx/svxids.hrc> +#include <vcl/vclenum.hxx> +#include <sot/object.hxx> +#include <sot/sotdata.hxx> +#include <sot/factory.hxx> +#include <tools/ownlist.hxx> +#include <vcl/font.hxx> +#include <vcl/wall.hxx> +#include <vcl/settings.hxx> +#include <vcl/accel.hxx> +#include <vcl/outdev.hxx> +#include <vcl/pointr.hxx> +#include <vcl/ptrstyle.hxx> +#include <tools/wintypes.hxx> +#include <vcl/event.hxx> +#include <limits.h> +#include <tools/errinf.hxx> +#include <tools/errcode.hxx> +#include <tools/stream.hxx> +#include <vcl/color.hxx> +#include <vcl/window.hxx> +#include <global.hxx> +#include <vcl/syswin.hxx> +#include <tools/debug.hxx> +#include <svl/svarray.hxx> +#include <vcl/ctrl.hxx> +#include <svl/hint.hxx> +#include <svl/poolitem.hxx> +#include <vcl/image.hxx> +#include <vcl/timer.hxx> +#include <tools/unqidx.hxx> +#include <vcl/symbol.hxx> +#include <vcl/fixed.hxx> +#include <svl/brdcst.hxx> +#include <vcl/timer.hxx> +#include <sc.hrc> +#include <stdarg.h> +#include <svx/dialogs.hrc> +#include <basic/sbxdef.hxx> +#include <svl/lstner.hxx> +#include <sfx2/shell.hxx> +#include <vcl/window.hxx> +#include <vcl/group.hxx> +#include <tools/unqid.hxx> +#include <tools/table.hxx> +#include <svl/itemset.hxx> +#include <vcl/dialog.hxx> +#include <vcl/button.hxx> +#include <rangelst.hxx> +#include <vcl/edit.hxx> +#include <vcl/combobox.h> +#include <tools/shl.hxx> +#include <vcl/field.hxx> +#include <vcl/spinfld.hxx> +#include <vcl/combobox.hxx> +#include <tools/pstm.hxx> +#include <svl/eitem.hxx> +#include <svl/itempool.hxx> +#include <sfx2/tabdlg.hxx> +#include <vcl/tabdlg.hxx> +#include <vcl/tabpage.hxx> +#include <vcl/tabctrl.hxx> +#include <shellids.hxx> +#include <vcl/event.hxx> +#include <svl/intitem.hxx> +#include <svtools/confitem.hxx> +#include <markdata.hxx> +#include <svx/optgrid.hxx> +#include <vcl/apptypes.hxx> +#include <viewopti.hxx> +#include <viewdata.hxx> +#include <sfx2/viewsh.hxx> +#include <sfx2/clientsh.hxx> +#include <document.hxx> +#include <vcl/prntypes.hxx> +#include <table.hxx> +#include <column.hxx> +#include <markarr.hxx> +#include <vcl/mapmod.hxx> +#include <svl/undo.hxx> +#include <vcl/seleng.hxx> +#include <rsc/rscsfx.hxx> +#include <svx/zoomitem.hxx> +#include <vcl/scrbar.hxx> +#include <viewutil.hxx> +#include <vcl/svapp.hxx> +#include <tools/datetime.hxx> +#include <tabview.hxx> +#include <select.hxx> +#include <sfx2/imgdef.hxx> +#include <viewfunc.hxx> +#include <sfx2/module.hxx> +#include <dbfunc.hxx> +#include <vcl/accel.hxx> +#include <svl/smplhint.hxx> +#include <sfx2/viewfac.hxx> +#include <sot/storage.hxx> +#include <sfx2/objsh.hxx> +#include <target.hxx> +#include <tabvwsh.hxx> +#include <svl/inethist.hxx> +#include <svl/inetdef.hxx> +#include <sfx2/sfxdefs.hxx> +#include <svtools/compat.hxx> +#include <svl/inetmsg.hxx> +#include <sfx2/app.hxx> +#include <tools/urlobj.hxx> +#include <scdll.hxx> +#include <sfx2/msg.hxx> +#include <svl/ownlist.hxx> +#include <sfx2/objface.hxx> +#include <sfx2/viewfrm.hxx> +#include <sfx2/frame.hxx> +#include <scresid.hxx> +#include <sfx2/ipfrm.hxx> +#include <docsh.hxx> +#include <vcl/wintypes.hxx> +#include <sfx2/docfac.hxx> +#include <scitems.hxx> +#include <vcl/virdev.hxx> +#include <globstr.hrc> +#include <tcov.hxx> +#include <vcl/dialog.hxx> +#include <vcl/gdimtf.hxx> +#include <vcl/lstbox.h> +#include <sfx2/minarray.hxx> +#include <sfx2/bindings.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/pointr.hxx> +#include <vcl/prntypes.hxx> +#include <vcl/jobset.hxx> +#include <svx/svdtypes.hxx> +#include <vcl/btndlg.hxx> +#include <vcl/svapp.hxx> +#include <svl/svstdarr.hxx> +#include <vcl/edit.hxx> +#include <svl/stritem.hxx> +#include <collect.hxx> +#include <svx/svdsob.hxx> +#include <vcl/button.hxx> +#include <svx/svdobj.hxx> +#include <svx/svdglue.hxx> +#include <svx/svdlayer.hxx> +#include <vcl/msgbox.hxx> +#include <svx/svdmrkv.hxx> +#include <svx/svdmark.hxx> +#include <svx/svdhdl.hxx> +#include <svx/svdsnpv.hxx> +#include <svx/svdpntv.hxx> +#include <svx/svddrag.hxx> +#include <svx/svdhlpln.hxx> +#include <scmod.hxx> +#include <sfx2/request.hxx> +#include <vcl/field.hxx> +#include <svx/svdview.hxx> +#include <svx/svdcrtv.hxx> +#include <vcl/print.hxx> +#include <vcl/floatwin.hxx> +#include <vcl/wrkwin.hxx> +#include <sfx2/childwin.hxx> +#include <sfx2/chalign.hxx> +#include <sfx2/dispatch.hxx> +#include <vcl/graph.hxx> +#include <vcl/bitmapex.hxx> +#include <vcl/animate.hxx> +#include <vcl/graph.h> +#include <editeng/editdata.hxx> +#include <svtools/stdctrl.hxx> +#include <sfx2/basedlgs.hxx> +#include <conditio.hxx> +#include <vcl/combobox.hxx> +#include <vcl/print.hxx> +#include <uiitems.hxx> +#include <svx/svdmodel.hxx> +#include <vcl/gdiobj.hxx> +#include <editeng/editeng.hxx> +#include <svx/pageitem.hxx> +#include <anyrefdg.hxx> +#include <basic/sbxcore.hxx> +#include <vcl/ctrl.hxx> +#include <svx/xenum.hxx> +#include <dbcolect.hxx> +#include <sot/exchange.hxx> +#include <math.h> +#include <vcl/wrkwin.hxx> +#include <basic/sbxvar.hxx> +#include <vcl/image.hxx> +#include <svx/xdef.hxx> +#include <drwlayer.hxx> +#include <editutil.hxx> +#include <svx/xit.hxx> +#include <svx/xcolit.hxx> +#include <attrib.hxx> +#include <patattr.hxx> +#include <svx/xfillit0.hxx> +#include <svx/xlineit0.hxx> +#include <svx/xflasit.hxx> +#include <svx/xlnasit.hxx> +#include <svx/svdattr.hxx> +#include <svx/sdangitm.hxx> +#include <svx/sderitm.hxx> +#include <svx/sdmetitm.hxx> +#include <svx/svddef.hxx> +#include <svx/sdooitm.hxx> +#include <svx/sdprcitm.hxx> +#include <svx/sdshcitm.hxx> +#include <svx/sdshitm.hxx> +#include <svx/sdshtitm.hxx> +#include <svx/sdsxyitm.hxx> +#include <svx/sdtaaitm.hxx> +#include <svx/sdtacitm.hxx> +#include <svx/sdtaditm.hxx> +#include <svx/sdtagitm.hxx> +#include <svx/sdtaiitm.hxx> +#include <svx/sdynitm.hxx> +#include <svx/sdtaitm.hxx> +#include <svx/sdtakitm.hxx> +#include <svx/sdtayitm.hxx> +#include <svx/sdtcfitm.hxx> +#include <svx/sdtditm.hxx> +#include <svx/sdtfsitm.hxx> +#include <svx/sdtmfitm.hxx> +#include <tools/poly.hxx> +#include <vcl/gdimtf.hxx> +#include <cell.hxx> +#include <stddef.h> +#include <tools/mempool.hxx> +#include <svl/style.hrc> +#include <drawview.hxx> +#include <svx/view3d.hxx> +#include <svx/def3d.hxx> +#include <vcl/floatwin.hxx> +#include <basic/sbxobj.hxx> +#include <editeng/svxenum.hxx> +#include <svx/xtextit0.hxx> +#include <svx/svdtrans.hxx> +#include <svl/style.hxx> +#include <reffact.hxx> +#include <svx/svdotext.hxx> +#include <svx/svdoattr.hxx> +#include <tools/wldcrd.hxx> +#include <rangenam.hxx> +#include <undobase.hxx> +#include <vcl/dockwin.hxx> +#include <vcl/virdev.hxx> +#include <rangeutl.hxx> +#include <vcl/toolbox.hxx> +#include <fupoor.hxx> +#include <docpool.hxx> +#include <vcl/button.hxx> +#include <svl/srchitem.hxx> +#include <svx/svdorect.hxx> +#include <svl/whiter.hxx> +#include <stlpool.hxx> +#include <editeng/eeitem.hxx> +#include <inputhdl.hxx> +#include <svx/svdpage.hxx> + + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/uiitems.hxx b/sc/source/ui/inc/uiitems.hxx new file mode 100644 index 000000000000..584b6e5dc815 --- /dev/null +++ b/sc/source/ui/inc/uiitems.hxx @@ -0,0 +1,374 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UIITEMS_HXX +#define SC_UIITEMS_HXX + +#include "scdllapi.h" +#include "conditio.hxx" +#include "sortparam.hxx" +#include "queryparam.hxx" +#include "subtotalparam.hxx" +#include "paramisc.hxx" +#include <svl/poolitem.hxx> + +class ScEditEngineDefaulter; +class EditTextObject; +class ScViewData; +class ScDPSaveData; + +// --------------------------------------------------------------------------- + +// Items + +class ScInputStatusItem : public SfxPoolItem +{ + ScAddress aCursorPos; + ScAddress aStartPos; + ScAddress aEndPos; + String aString; + EditTextObject* pEditData; + +public: + TYPEINFO(); + + ScInputStatusItem( sal_uInt16 nWhich, + const ScAddress& rCurPos, + const ScAddress& rStartPos, + const ScAddress& rEndPos, + const String& rString, + const EditTextObject* pData ); + ScInputStatusItem( const ScInputStatusItem& rItem ); + ~ScInputStatusItem(); + + virtual String GetValueText() const; + + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + const ScAddress& GetPos() const { return aCursorPos; } + const ScAddress& GetStartPos() const { return aStartPos; } + const ScAddress& GetEndPos() const { return aEndPos; } + SCTAB GetTab() const { return aCursorPos.Tab(); } + SCCOL GetCol() const { return aCursorPos.Col(); } + SCROW GetRow() const { return aCursorPos.Row(); } + SCCOL GetStartCol() const { return aStartPos.Col(); } + SCROW GetStartRow() const { return aStartPos.Row(); } + SCCOL GetEndCol() const { return aEndPos.Col(); } + SCROW GetEndRow() const { return aEndPos.Row(); } + + const String& GetString() const { return aString; } + const EditTextObject* GetEditData() const { return pEditData; } +}; + + +#define SC_TAB_INSERTED 1 +#define SC_TAB_DELETED 2 +#define SC_TAB_MOVED 3 +#define SC_TAB_COPIED 4 +#define SC_TAB_HIDDEN 5 + +class ScTablesHint : public SfxHint +{ + sal_uInt16 nId; + SCTAB nTab1; + SCTAB nTab2; + +public: + TYPEINFO(); + ScTablesHint(sal_uInt16 nNewId, SCTAB nTable1, SCTAB nTable2=0); + ~ScTablesHint(); + + sal_uInt16 GetId() const { return nId; } + SCTAB GetTab1() const { return nTab1; } + SCTAB GetTab2() const { return nTab2; } +}; + +class ScEditViewHint : public SfxHint +{ + ScEditEngineDefaulter* pEditEngine; + ScAddress aCursorPos; + +public: + TYPEINFO(); + ScEditViewHint( ScEditEngineDefaulter* pEngine, const ScAddress& rCurPos ); + ~ScEditViewHint(); + + SCCOL GetCol() const { return aCursorPos.Col(); } + SCROW GetRow() const { return aCursorPos.Row(); } + SCTAB GetTab() const { return aCursorPos.Tab(); } + ScEditEngineDefaulter* GetEngine() const { return pEditEngine; } + +private: + ScEditViewHint(); // disabled +}; + +class ScIndexHint : public SfxHint +{ + sal_uInt16 nId; + sal_uInt16 nIndex; + +public: + TYPEINFO(); + ScIndexHint(sal_uInt16 nNewId, sal_uInt16 nIdx); + ~ScIndexHint(); + + sal_uInt16 GetId() const { return nId; } + sal_uInt16 GetIndex() const { return nIndex; } +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer den Sortierdialog: + +class SC_DLLPUBLIC ScSortItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScSortItem( sal_uInt16 nWhich, + ScViewData* ptrViewData, + const ScSortParam* pSortData ); + ScSortItem( sal_uInt16 nWhich, + const ScSortParam* pSortData ); + ScSortItem( const ScSortItem& rItem ); + ~ScSortItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const; + + ScViewData* GetViewData () const { return pViewData; } + const ScSortParam& GetSortData () const { return theSortData; } + +private: + ScViewData* pViewData; + ScSortParam theSortData; +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer den Filterdialog: + +class SC_DLLPUBLIC ScQueryItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScQueryItem( sal_uInt16 nWhich, + ScViewData* ptrViewData, + const ScQueryParam* pQueryData ); + ScQueryItem( sal_uInt16 nWhich, + const ScQueryParam* pQueryData ); + ScQueryItem( const ScQueryItem& rItem ); + ~ScQueryItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + ScViewData* GetViewData () const { return pViewData; } + const ScQueryParam& GetQueryData() const { return theQueryData; } + + sal_Bool GetAdvancedQuerySource(ScRange& rSource) const; + void SetAdvancedQuerySource(const ScRange* pSource); + +private: + ScViewData* pViewData; + ScQueryParam theQueryData; + sal_Bool bIsAdvanced; + ScRange aAdvSource; +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer den Zwischenergebnisdialog: + +class SC_DLLPUBLIC ScSubTotalItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScSubTotalItem( sal_uInt16 nWhich, + ScViewData* ptrViewData, + const ScSubTotalParam* pSubTotalData ); + ScSubTotalItem( sal_uInt16 nWhich, + const ScSubTotalParam* pSubTotalData ); + ScSubTotalItem( const ScSubTotalItem& rItem ); + ~ScSubTotalItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberUd ) const; + + ScViewData* GetViewData () const { return pViewData; } + const ScSubTotalParam& GetSubTotalData() const { return theSubTotalData; } + +private: + ScViewData* pViewData; + ScSubTotalParam theSubTotalData; +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer die Benutzerlisten-TabPage: + +class SC_DLLPUBLIC ScUserListItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScUserListItem( sal_uInt16 nWhich ); + ScUserListItem( const ScUserListItem& rItem ); + ~ScUserListItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + void SetUserList ( const ScUserList& rUserList ); + ScUserList* GetUserList () const { return pUserList; } + +private: + ScUserList* pUserList; +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer die Konsolidieren-Dialog + +class ScConsolidateItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScConsolidateItem( sal_uInt16 nWhich, + const ScConsolidateParam* pParam ); + ScConsolidateItem( const ScConsolidateItem& rItem ); + ~ScConsolidateItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + const ScConsolidateParam& GetData() const { return theConsData; } + +private: + ScConsolidateParam theConsData; +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer den Pivot-Dialog + +class ScPivotItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScPivotItem( sal_uInt16 nWhich, const ScDPSaveData* pData, + const ScRange* pRange, sal_Bool bNew ); + ScPivotItem( const ScPivotItem& rItem ); + ~ScPivotItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + const ScDPSaveData& GetData() const { return *pSaveData; } + const ScRange& GetDestRange() const { return aDestRange; } + sal_Bool IsNewSheet() const { return bNewSheet; } + +private: + ScDPSaveData* pSaveData; + ScRange aDestRange; + sal_Bool bNewSheet; +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer den Solver-Dialog + +class ScSolveItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScSolveItem( sal_uInt16 nWhich, + const ScSolveParam* pParam ); + ScSolveItem( const ScSolveItem& rItem ); + ~ScSolveItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + const ScSolveParam& GetData() const { return theSolveData; } + +private: + ScSolveParam theSolveData; +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer den Mehrfachoperationen-Dialog + +class ScTabOpItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScTabOpItem( sal_uInt16 nWhich, + const ScTabOpParam* pParam ); + ScTabOpItem( const ScTabOpItem& rItem ); + ~ScTabOpItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + const ScTabOpParam& GetData() const { return theTabOpData; } + +private: + ScTabOpParam theTabOpData; +}; + +//---------------------------------------------------------------------------- +// Parameter-Item fuer den Dialog bedingte Formatierung + +class ScCondFrmtItem : public SfxPoolItem +{ +public: + TYPEINFO(); + ScCondFrmtItem( sal_uInt16 nWhich, +//! const ScConditionalFormat* pCondFrmt ); + const ScConditionalFormat& rCondFrmt ); + ScCondFrmtItem( const ScCondFrmtItem& rItem ); + ~ScCondFrmtItem(); + + virtual String GetValueText() const; + virtual int operator==( const SfxPoolItem& ) const; + virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; + + const ScConditionalFormat& GetData() const { return theCondFrmtData; } + +private: + ScConditionalFormat theCondFrmtData; +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx new file mode 100644 index 000000000000..701378430d2d --- /dev/null +++ b/sc/source/ui/inc/undobase.hxx @@ -0,0 +1,179 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UNDOBASE_HXX +#define SC_UNDOBASE_HXX + +#include <svl/undo.hxx> +#include "global.hxx" +#include "address.hxx" +#include "docsh.hxx" + +class ScDocument; +class ScDocShell; +class SdrUndoAction; +class ScRefUndoData; +class ScDBData; + +//---------------------------------------------------------------------------- + +class ScSimpleUndo: public SfxUndoAction +{ +public: + TYPEINFO(); + ScSimpleUndo( ScDocShell* pDocSh ); + virtual ~ScSimpleUndo(); + + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + +protected: + ScDocShell* pDocShell; + SfxUndoAction* pDetectiveUndo; + + bool IsPaintLocked() const { return pDocShell->IsPaintLocked(); } + + bool SetViewMarkData( const ScMarkData& rMarkData ); + + void BeginUndo(); + void EndUndo(); + void BeginRedo(); + void EndRedo(); + + static void ShowTable( SCTAB nTab ); + static void ShowTable( const ScRange& rRange ); +}; + +//---------------------------------------------------------------------------- + +enum ScBlockUndoMode { SC_UNDO_SIMPLE, SC_UNDO_MANUALHEIGHT, SC_UNDO_AUTOHEIGHT }; + +class ScBlockUndo: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScBlockUndo( ScDocShell* pDocSh, const ScRange& rRange, + ScBlockUndoMode eBlockMode ); + virtual ~ScBlockUndo(); + +protected: + ScRange aBlockRange; + SdrUndoAction* pDrawUndo; + ScBlockUndoMode eMode; + + void BeginUndo(); + void EndUndo(); +// void BeginRedo(); + void EndRedo(); + + sal_Bool AdjustHeight(); + void ShowBlock(); +}; + +//---------------------------------------------------------------------------- + +// for functions that act on a database range - takes care of the unnamed database range +// (collected separately, before the undo action, for showing dialogs etc.) + +class ScDBFuncUndo: public ScSimpleUndo +{ +protected: + ScDBData* pAutoDBRange; + ScRange aOriginalRange; + SdrUndoAction* mpDrawUndo; + +public: + TYPEINFO(); + ScDBFuncUndo( ScDocShell* pDocSh, const ScRange& rOriginal, SdrUndoAction* pDrawUndo = 0 ); + virtual ~ScDBFuncUndo(); + + void SetDrawUndoAction( SdrUndoAction* pDrawUndo ); + + void BeginUndo(); + void EndUndo(); + void BeginRedo(); + void EndRedo(); +}; + +//---------------------------------------------------------------------------- + +enum ScMoveUndoMode { SC_UNDO_REFFIRST, SC_UNDO_REFLAST }; + +class ScMoveUndo: public ScSimpleUndo // mit Referenzen +{ +public: + TYPEINFO(); + ScMoveUndo( ScDocShell* pDocSh, + ScDocument* pRefDoc, ScRefUndoData* pRefData, + ScMoveUndoMode eRefMode ); + virtual ~ScMoveUndo(); + +protected: + SdrUndoAction* pDrawUndo; + ScDocument* pRefUndoDoc; + ScRefUndoData* pRefUndoData; + ScMoveUndoMode eMode; + + void BeginUndo(); + void EndUndo(); +// void BeginRedo(); +// void EndRedo(); + +private: + void UndoRef(); +}; + +//---------------------------------------------------------------------------- + +class ScUndoWrapper: public SfxUndoAction // for manual merging of actions +{ + SfxUndoAction* pWrappedUndo; + +public: + TYPEINFO(); + ScUndoWrapper( SfxUndoAction* pUndo ); + virtual ~ScUndoWrapper(); + + SfxUndoAction* GetWrappedUndo() { return pWrappedUndo; } + void ForgetWrappedUndo(); + + virtual sal_Bool IsLinked(); + virtual void SetLinked( sal_Bool bIsLinked ); + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual String GetComment() const; + virtual String GetRepeatComment(SfxRepeatTarget&) const; + virtual sal_uInt16 GetId() const; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx new file mode 100644 index 000000000000..16fc7591ac08 --- /dev/null +++ b/sc/source/ui/inc/undoblk.hxx @@ -0,0 +1,997 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_UNDOBLK_HXX +#define SC_UNDOBLK_HXX + +#include "undobase.hxx" +#include "markdata.hxx" +#include "viewutil.hxx" +#include "spellparam.hxx" +#include "cellmergeoption.hxx" + +#include "cell.hxx" + +#include <boost/shared_ptr.hpp> + +class ScDocShell; +class ScBaseCell; +class ScDocument; +class ScOutlineTable; +class ScRangeName; +class ScRangeList; +class ScDBCollection; +class ScPatternAttr; +class SvxBoxItem; +class SvxBoxInfoItem; +class SvxSearchItem; +class SdrUndoAction; + +//---------------------------------------------------------------------------- + +class ScUndoInsertCells: public ScMoveUndo +{ +public: + TYPEINFO(); + ScUndoInsertCells( ScDocShell* pNewDocShell, + const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios, + InsCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData, + sal_Bool bNewPartOfPaste ); + virtual ~ScUndoInsertCells(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat( SfxRepeatTarget& rTarget ); + virtual sal_Bool CanRepeat( SfxRepeatTarget& rTarget ) const; + + virtual String GetComment() const; + + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + +private: + ScRange aEffRange; + SCTAB nCount; + SCTAB* pTabs; + SCTAB* pScenarios; + sal_uLong nEndChangeAction; + InsCellCmd eCmd; + sal_Bool bPartOfPaste; + SfxUndoAction* pPasteUndo; + + void DoChange ( const sal_Bool bUndo ); + void SetChangeTrack(); +}; + + +class ScUndoDeleteCells: public ScMoveUndo +{ +public: + TYPEINFO(); + ScUndoDeleteCells( ScDocShell* pNewDocShell, + const ScRange& rRange, SCTAB nNewCount, SCTAB* pNewTabs, SCTAB* pNewScenarios, + DelCellCmd eNewCmd, ScDocument* pUndoDocument, ScRefUndoData* pRefData ); + virtual ~ScUndoDeleteCells(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScRange aEffRange; + SCTAB nCount; + SCTAB* pTabs; + SCTAB* pScenarios; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + DelCellCmd eCmd; + + void DoChange ( const sal_Bool bUndo ); + void SetChangeTrack(); +}; + + +class ScUndoDeleteMulti: public ScMoveUndo +{ +public: + TYPEINFO(); + ScUndoDeleteMulti( ScDocShell* pNewDocShell, + sal_Bool bNewRows, sal_Bool bNeedsRefresh, SCTAB nNewTab, + const SCCOLROW* pRng, SCCOLROW nRngCnt, + ScDocument* pUndoDocument, ScRefUndoData* pRefData ); + virtual ~ScUndoDeleteMulti(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + sal_Bool bRows; + sal_Bool bRefresh; + SCTAB nTab; + SCCOLROW* pRanges; + SCCOLROW nRangeCnt; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + + void DoChange() const; + void SetChangeTrack(); +}; + + +class ScUndoCut: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoCut( ScDocShell* pNewDocShell, + ScRange aRange, // adjusted for merged cells + ScAddress aOldEnd, // end position without adjustment + const ScMarkData& rMark, // selected sheets + ScDocument* pNewUndoDoc ); + virtual ~ScUndoCut(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + ScRange aExtendedRange; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + + void DoChange( const sal_Bool bUndo ); + void SetChangeTrack(); +}; + + +struct ScUndoPasteOptions +{ + sal_uInt16 nFunction; + sal_Bool bSkipEmpty; + sal_Bool bTranspose; + sal_Bool bAsLink; + InsCellCmd eMoveMode; + + ScUndoPasteOptions() : + nFunction( PASTE_NOFUNC ), + bSkipEmpty( false ), + bTranspose( false ), + bAsLink( false ), + eMoveMode( INS_NONE ) + {} +}; + +class ScUndoPaste: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoPaste( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + const ScMarkData& rMark, + ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, + sal_uInt16 nNewFlags, + ScRefUndoData* pRefData, void* pFill1, void* pFill2, void* pFill3, + sal_Bool bRedoIsFilled = sal_True, + const ScUndoPasteOptions* pOptions = NULL ); + virtual ~ScUndoPaste(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + ScDocument* pRedoDoc; + sal_uInt16 nFlags; + ScRefUndoData* pRefUndoData; + ScRefUndoData* pRefRedoData; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + sal_Bool bRedoFilled; + ScUndoPasteOptions aPasteOptions; + + void DoChange( const sal_Bool bUndo ); + void SetChangeTrack(); +}; + + +class ScUndoDragDrop: public ScMoveUndo +{ +public: + TYPEINFO(); + ScUndoDragDrop( ScDocShell* pNewDocShell, + const ScRange& rRange, ScAddress aNewDestPos, sal_Bool bNewCut, + ScDocument* pUndoDocument, ScRefUndoData* pRefData, + sal_Bool bScenario ); + virtual ~ScUndoDragDrop(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScRange aSrcRange; + ScRange aDestRange; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + sal_Bool bCut; + sal_Bool bKeepScenarioFlags; + + void PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const; + void DoUndo( ScRange aRange ) const; + + void SetChangeTrack(); +}; + + +class ScUndoDeleteContents: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoDeleteContents( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + const ScRange& rRange, + ScDocument* pNewUndoDoc, sal_Bool bNewMulti, + sal_uInt16 nNewFlags, sal_Bool bObjects ); + virtual ~ScUndoDeleteContents(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScRange aRange; + ScMarkData aMarkData; + ScDocument* pUndoDoc; // Blockmarkierung und geloeschte Daten + SdrUndoAction* pDrawUndo; // geloeschte Objekte + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + sal_uInt16 nFlags; + sal_Bool bMulti; // Mehrfachselektion + + void DoChange( const sal_Bool bUndo ); + void SetChangeTrack(); +}; + + +class ScUndoFillTable: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoFillTable( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + ScDocument* pNewUndoDoc, sal_Bool bNewMulti, SCTAB nSrc, + sal_uInt16 nFlg, sal_uInt16 nFunc, sal_Bool bSkip, sal_Bool bLink ); + virtual ~ScUndoFillTable(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScRange aRange; + ScMarkData aMarkData; + ScDocument* pUndoDoc; // Blockmarkierung und geloeschte Daten + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + sal_uInt16 nFlags; + sal_uInt16 nFunction; + SCTAB nSrcTab; + sal_Bool bMulti; // Mehrfachselektion + sal_Bool bSkipEmpty; + sal_Bool bAsLink; + + void DoChange( const sal_Bool bUndo ); + void SetChangeTrack(); +}; + + +class ScUndoSelectionAttr: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoSelectionAttr( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + ScDocument* pNewUndoDoc, sal_Bool bNewMulti, + const ScPatternAttr* pNewApply, + const SvxBoxItem* pNewOuter = NULL, + const SvxBoxInfoItem* pNewInner = NULL ); + virtual ~ScUndoSelectionAttr(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + + ScEditDataArray* GetDataArray(); +private: + ScMarkData aMarkData; + ScRange aRange; + ScEditDataArray aDataArray; + ScDocument* pUndoDoc; + sal_Bool bMulti; + ScPatternAttr* pApplyPattern; + SvxBoxItem* pLineOuter; + SvxBoxInfoItem* pLineInner; + + void DoChange( const sal_Bool bUndo ); + void ChangeEditData( const bool bUndo ); +}; + + +class ScUndoWidthOrHeight: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoWidthOrHeight( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + SCCOLROW nNewStart, SCTAB nNewStartTab, + SCCOLROW nNewEnd, SCTAB nNewEndTab, + ScDocument* pNewUndoDoc, + SCCOLROW nNewCnt, SCCOLROW* pNewRanges, + ScOutlineTable* pNewUndoTab, + ScSizeMode eNewMode, sal_uInt16 nNewSizeTwips, + sal_Bool bNewWidth ); + virtual ~ScUndoWidthOrHeight(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + SCCOLROW nStart; + SCCOLROW nEnd; + SCTAB nStartTab; + SCTAB nEndTab; + ScDocument* pUndoDoc; + ScOutlineTable* pUndoTab; + SCCOLROW nRangeCnt; + SCCOLROW* pRanges; + sal_uInt16 nNewSize; + sal_Bool bWidth; + ScSizeMode eMode; + SdrUndoAction* pDrawUndo; +}; + + +class ScUndoAutoFill: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoAutoFill( ScDocShell* pNewDocShell, + const ScRange& rRange, const ScRange& rSourceArea, + ScDocument* pNewUndoDoc, const ScMarkData& rMark, + FillDir eNewFillDir, + FillCmd eNewFillCmd, FillDateCmd eNewFillDateCmd, + double fNewStartValue, double fNewStepValue, double fNewMaxValue ); + virtual ~ScUndoAutoFill(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScRange aSource; + ScMarkData aMarkData; + ScDocument* pUndoDoc; + FillDir eFillDir; + FillCmd eFillCmd; + FillDateCmd eFillDateCmd; + double fStartValue; + double fStepValue; + double fMaxValue; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + + void SetChangeTrack(); +}; + + +class ScUndoMerge: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption, + bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo); + virtual ~ScUndoMerge(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScCellMergeOption maOption; + bool mbMergeContents; // Merge contents in Redo(). + ScDocument* mpUndoDoc; // wenn Daten zusammengefasst + SdrUndoAction* mpDrawUndo; + + void DoChange( bool bUndo ) const; +}; + + +class ScUndoAutoFormat: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoAutoFormat( ScDocShell* pNewDocShell, + const ScRange& rRange, ScDocument* pNewUndoDoc, + const ScMarkData& rMark, + sal_Bool bNewSize, sal_uInt16 nNewFormatNo ); + virtual ~ScUndoAutoFormat(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScDocument* pUndoDoc; // geloeschte Daten + ScMarkData aMarkData; + sal_Bool bSize; + sal_uInt16 nFormatNo; +}; + + +class ScUndoReplace: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoReplace( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, + const String& rNewUndoStr, ScDocument* pNewUndoDoc, + const SvxSearchItem* pItem ); + virtual ~ScUndoReplace(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScAddress aCursorPos; + ScMarkData aMarkData; + String aUndoStr; // Daten bei Einfachmarkierung + ScDocument* pUndoDoc; // Blockmarkierung und geloeschte Daten + SvxSearchItem* pSearchItem; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + + void SetChangeTrack(); +}; + + +class ScUndoTabOp: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoTabOp( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + ScDocument* pNewUndoDoc, + const ScRefAddress& rFormulaCell, + const ScRefAddress& rFormulaEnd, + const ScRefAddress& rRowCell, + const ScRefAddress& rColCell, + sal_uInt8 nMode ); + virtual ~ScUndoTabOp(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScRange aRange; + ScDocument* pUndoDoc; // geloeschte Daten + ScRefAddress theFormulaCell; + ScRefAddress theFormulaEnd; + ScRefAddress theRowCell; + ScRefAddress theColCell; + sal_uInt8 nMode; +}; + + +class ScUndoConversion : public ScSimpleUndo +{ +public: + TYPEINFO(); + + ScUndoConversion( + ScDocShell* pNewDocShell, const ScMarkData& rMark, + SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScDocument* pNewUndoDoc, + SCCOL nNewX, SCROW nNewY, SCTAB nNewZ, ScDocument* pNewRedoDoc, + const ScConversionParam& rConvParam ); + virtual ~ScUndoConversion(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScAddress aCursorPos; + ScDocument* pUndoDoc; // Blockmarkierung und geloeschte Daten + ScAddress aNewCursorPos; + ScDocument* pRedoDoc; // Blockmarkierung und neue Daten + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + ScConversionParam maConvParam; /// Conversion type and parameters. + + void DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPos ); + void SetChangeTrack(); +}; + +class ScUndoRefConversion: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRefConversion( ScDocShell* pNewDocShell, + const ScRange& aMarkRange, const ScMarkData& rMark, + ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, sal_Bool bNewMulti, sal_uInt16 nNewFlag); + virtual ~ScUndoRefConversion(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + ScDocument* pRedoDoc; + ScRange aRange; + sal_Bool bMulti; + sal_uInt16 nFlags; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + + void DoChange( ScDocument* pRefDoc); + void SetChangeTrack(); +}; + +class ScUndoListNames: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoListNames( ScDocShell* pNewDocShell, + const ScRange& rRange, + ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc ); + virtual ~ScUndoListNames(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScDocument* pUndoDoc; + ScDocument* pRedoDoc; + + void DoChange( ScDocument* pSrcDoc ) const; +}; + + +class ScUndoUseScenario: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoUseScenario( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + const ScArea& rDestArea, ScDocument* pNewUndoDoc, + const String& rNewName ); + virtual ~ScUndoUseScenario(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScDocument* pUndoDoc; + ScRange aRange; + ScMarkData aMarkData; + String aName; +}; + + +class ScUndoSelectionStyle: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoSelectionStyle( ScDocShell* pNewDocShell, + const ScMarkData& rMark, + const ScRange& rRange, + const String& rName, + ScDocument* pNewUndoDoc ); + virtual ~ScUndoSelectionStyle(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + virtual sal_uInt16 GetId() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + String aStyleName; + ScRange aRange; + + void DoChange( const sal_Bool bUndo ); +}; + + +class ScUndoRefreshLink: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRefreshLink( ScDocShell* pNewDocShell, + ScDocument* pNewUndoDoc ); + virtual ~ScUndoRefreshLink(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScDocument* pUndoDoc; + ScDocument* pRedoDoc; +}; + + +class ScUndoEnterMatrix: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoEnterMatrix( ScDocShell* pNewDocShell, + const ScRange& rArea, + ScDocument* pNewUndoDoc, + const String& rForm ); + virtual ~ScUndoEnterMatrix(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScDocument* pUndoDoc; + String aFormula; + formula::FormulaGrammar::AddressConvention eConv; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + + void SetChangeTrack(); +}; + + +class ScUndoInsertAreaLink : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoInsertAreaLink( ScDocShell* pShell, + const String& rDoc, + const String& rFlt, const String& rOpt, + const String& rArea, const ScRange& rDestRange, + sal_uLong nRefreshDelay ); + virtual ~ScUndoInsertAreaLink(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + String aDocName; + String aFltName; + String aOptions; + String aAreaName; + ScRange aRange; + sal_uLong nRefreshDelay; +}; + + +class ScUndoRemoveAreaLink : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRemoveAreaLink( ScDocShell* pShell, + const String& rDoc, + const String& rFlt, const String& rOpt, + const String& rArea, const ScRange& rDestRange, + sal_uLong nRefreshDelay ); + virtual ~ScUndoRemoveAreaLink(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + String aDocName; + String aFltName; + String aOptions; + String aAreaName; + ScRange aRange; + sal_uLong nRefreshDelay; +}; + + +class ScUndoUpdateAreaLink : public ScSimpleUndo //! auch BlockUndo umstellen? +{ +public: + TYPEINFO(); + ScUndoUpdateAreaLink( ScDocShell* pShell, + const String& rOldD, + const String& rOldF, const String& rOldO, + const String& rOldA, const ScRange& rOldR, + sal_uLong nOldRD, + const String& rNewD, + const String& rNewF, const String& rNewO, + const String& rNewA, const ScRange& rNewR, + sal_uLong nNewRD, + ScDocument* pUndo, ScDocument* pRedo, + sal_Bool bDoInsert ); + virtual ~ScUndoUpdateAreaLink(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + String aOldDoc; + String aOldFlt; + String aOldOpt; + String aOldArea; + ScRange aOldRange; + String aNewDoc; + String aNewFlt; + String aNewOpt; + String aNewArea; + ScRange aNewRange; + ScDocument* pUndoDoc; + ScDocument* pRedoDoc; + sal_uLong nOldRefresh; + sal_uLong nNewRefresh; + sal_Bool bWithInsert; + + void DoChange( const sal_Bool bUndo ) const; +}; + + +class ScUndoIndent: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoIndent( ScDocShell* pNewDocShell, const ScMarkData& rMark, + ScDocument* pNewUndoDoc, sal_Bool bIncrement ); + virtual ~ScUndoIndent(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + sal_Bool bIsIncrement; +}; + + +class ScUndoTransliterate: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMarkData& rMark, + ScDocument* pNewUndoDoc, sal_Int32 nType ); + virtual ~ScUndoTransliterate(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + sal_Int32 nTransliterationType; +}; + + +class ScUndoClearItems: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoClearItems( ScDocShell* pNewDocShell, const ScMarkData& rMark, + ScDocument* pNewUndoDoc, const sal_uInt16* pW ); + virtual ~ScUndoClearItems(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + sal_uInt16* pWhich; +}; + + +class ScUndoRemoveBreaks: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRemoveBreaks( ScDocShell* pNewDocShell, + SCTAB nNewTab, ScDocument* pNewUndoDoc ); + virtual ~ScUndoRemoveBreaks(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + ScDocument* pUndoDoc; +}; + + +class ScUndoRemoveMerge: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoRemoveMerge( ScDocShell* pNewDocShell, + const ScCellMergeOption& rOption, + ScDocument* pNewUndoDoc ); + virtual ~ScUndoRemoveMerge(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + void SetCurTab(); + + ScCellMergeOption maOption; + ScDocument* pUndoDoc; +}; + + +class ScUndoBorder: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoBorder( ScDocShell* pNewDocShell, + const ScRangeList& rRangeList, + ScDocument* pNewUndoDoc, + const SvxBoxItem& rNewOuter, + const SvxBoxInfoItem& rNewInner ); + virtual ~ScUndoBorder(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScDocument* pUndoDoc; + ScRangeList* pRanges; + SvxBoxItem* pOuter; + SvxBoxInfoItem* pInner; +}; + + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx new file mode 100644 index 000000000000..2ab9ab1a9cfa --- /dev/null +++ b/sc/source/ui/inc/undocell.hxx @@ -0,0 +1,377 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UNDOCELL_HXX +#define SC_UNDOCELL_HXX + +#include "undobase.hxx" +#include "postit.hxx" + +#include <boost/shared_ptr.hpp> + +class ScDocShell; +class ScBaseCell; +class ScPatternAttr; +class EditTextObject; +class SdrUndoAction; +class ScDetOpList; +class ScDetOpData; +class ScRangeName; + +//---------------------------------------------------------------------------- + +class ScUndoCursorAttr: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoCursorAttr( ScDocShell* pNewDocShell, + SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, + const ScPatternAttr* pOldPat, const ScPatternAttr* pNewPat, + const ScPatternAttr* pApplyPat, sal_Bool bAutomatic ); + virtual ~ScUndoCursorAttr(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + + /** once the objects are passed to this class, their life-cycle is + managed by this class; the calling function must pass new'ed + objects to this method. */ + void SetEditData( EditTextObject* pOld, EditTextObject* pNew ); + +private: + SCCOL nCol; + SCROW nRow; + SCTAB nTab; + ScPatternAttr* pOldPattern; + ScPatternAttr* pNewPattern; + ScPatternAttr* pApplyPattern; + ::boost::shared_ptr<EditTextObject> pOldEditData; + ::boost::shared_ptr<EditTextObject> pNewEditData; + sal_Bool bIsAutomatic; + + void DoChange( const ScPatternAttr* pWhichPattern, const ::boost::shared_ptr<EditTextObject>& pEditData ) const; +}; + + +class ScUndoEnterData: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoEnterData( ScDocShell* pNewDocShell, + SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, + SCTAB nNewCount, SCTAB* pNewTabs, + ScBaseCell** ppOldData, sal_Bool* pHasForm, sal_uLong* pOldForm, + const String& rNewStr, EditTextObject* pObj = NULL ); + virtual ~ScUndoEnterData(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + String aNewString; + SCTAB* pTabs; + ScBaseCell** ppOldCells; + sal_Bool* pHasFormat; + sal_uLong* pOldFormats; + EditTextObject* pNewEditData; + sal_uLong nEndChangeAction; + SCCOL nCol; + SCROW nRow; + SCTAB nTab; + SCTAB nCount; // markierte Tabellen + + void DoChange() const; + void SetChangeTrack(); +}; + + +class ScUndoEnterValue: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoEnterValue( ScDocShell* pNewDocShell, + const ScAddress& rNewPos, + ScBaseCell* pUndoCell, double nVal, sal_Bool bHeight ); + virtual ~ScUndoEnterValue(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScAddress aPos; + ScBaseCell* pOldCell; + double nValue; + sal_uLong nEndChangeAction; + sal_Bool bNeedHeight; + + void SetChangeTrack(); +}; + + +class ScUndoPutCell: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoPutCell( ScDocShell* pNewDocShell, + const ScAddress& rNewPos, + ScBaseCell* pUndoCell, ScBaseCell* pRedoCell, sal_Bool bHeight ); + virtual ~ScUndoPutCell(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScAddress aPos; + ScBaseCell* pOldCell; + ScBaseCell* pEnteredCell; + sal_uLong nEndChangeAction; + sal_Bool bNeedHeight; + + void SetChangeTrack(); +}; + + +class ScUndoPageBreak: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoPageBreak( ScDocShell* pNewDocShell, + SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, + sal_Bool bNewColumn, sal_Bool bNewInsert ); + virtual ~ScUndoPageBreak(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCCOL nCol; + SCROW nRow; + SCTAB nTab; + sal_Bool bColumn; // Spalten- oder Zeilenumbruch + sal_Bool bInsert; // Einfuegen oder Loeschen + + void DoChange( sal_Bool bInsert ) const; +}; + +class ScUndoPrintZoom: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoPrintZoom( ScDocShell* pNewDocShell, SCTAB nT, + sal_uInt16 nOS, sal_uInt16 nOP, sal_uInt16 nNS, sal_uInt16 nNP ); + virtual ~ScUndoPrintZoom(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + sal_uInt16 nOldScale; + sal_uInt16 nOldPages; + sal_uInt16 nNewScale; + sal_uInt16 nNewPages; + + void DoChange( sal_Bool bUndo ); +}; + +class ScUndoThesaurus: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoThesaurus( ScDocShell* pNewDocShell, + SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, + const String& rNewUndoStr, const EditTextObject* pUndoTObj, + const String& rNewRedoStr, const EditTextObject* pRedoTObj); + virtual ~ScUndoThesaurus(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCCOL nCol; + SCROW nRow; + SCTAB nTab; + String aUndoStr; // Daten bei StringZelle + EditTextObject* pUndoTObject; // bei EditZelle + String aRedoStr; + EditTextObject* pRedoTObject; + sal_uLong nEndChangeAction; + + void DoChange( sal_Bool bUndo, const String& rStr, + const EditTextObject* pTObj ); + void SetChangeTrack( ScBaseCell* pOldCell ); +}; + +// ============================================================================ + +/** Undo action for inserting, removing, and replacing a cell note. */ +class ScUndoReplaceNote : public ScSimpleUndo +{ +public: + TYPEINFO(); + + /** Constructs an undo action for inserting or removing a cell note. */ + ScUndoReplaceNote( + ScDocShell& rDocShell, + const ScAddress& rPos, + const ScNoteData& rNoteData, + bool bInsert, + SdrUndoAction* pDrawUndo ); + + /** Constructs an undo action for replacing a cell note with another. */ + ScUndoReplaceNote( + ScDocShell& rDocShell, + const ScAddress& rPos, + const ScNoteData& rOldData, + const ScNoteData& rNewData, + SdrUndoAction* pDrawUndo ); + + virtual ~ScUndoReplaceNote(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat( SfxRepeatTarget& rTarget ); + virtual sal_Bool CanRepeat( SfxRepeatTarget& rTarget ) const; + + virtual String GetComment() const; + +private: + void DoInsertNote( const ScNoteData& rNoteData ); + void DoRemoveNote( const ScNoteData& rNoteData ); + +private: + ScAddress maPos; + ScNoteData maOldData; + ScNoteData maNewData; + SdrUndoAction* mpDrawUndo; +}; + +// ============================================================================ + +/** Undo action for showing or hiding a cell note caption. */ +class ScUndoShowHideNote : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoShowHideNote( ScDocShell& rDocShell, const ScAddress& rPos, bool bShow ); + virtual ~ScUndoShowHideNote(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat( SfxRepeatTarget& rTarget ); + virtual sal_Bool CanRepeat( SfxRepeatTarget& rTarget ) const; + + virtual String GetComment() const; + +private: + ScAddress maPos; + bool mbShown; +}; + +// ============================================================================ + +class ScUndoDetective: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoDetective( ScDocShell* pNewDocShell, + SdrUndoAction* pDraw, const ScDetOpData* pOperation, + ScDetOpList* pUndoList = NULL ); + virtual ~ScUndoDetective(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + sal_Bool bIsDelete; + ScDetOpList* pOldList; + sal_uInt16 nAction; + ScAddress aPos; + SdrUndoAction* pDrawUndo; +}; + + +class ScUndoRangeNames: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRangeNames( ScDocShell* pNewDocShell, + ScRangeName* pOld, ScRangeName* pNew ); + virtual ~ScUndoRangeNames(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScRangeName* pOldRanges; + ScRangeName* pNewRanges; + + void DoChange( sal_Bool bUndo ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undodat.hxx b/sc/source/ui/inc/undodat.hxx new file mode 100644 index 000000000000..f8d26d008daa --- /dev/null +++ b/sc/source/ui/inc/undodat.hxx @@ -0,0 +1,541 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UNDODAT_HXX +#define SC_UNDODAT_HXX + +#include "undobase.hxx" +#include "rangeutl.hxx" // ScArea +#include "rangelst.hxx" // ScRangeListRef +#include "markdata.hxx" +#include "sortparam.hxx" +#include "queryparam.hxx" +#include "subtotalparam.hxx" +#include "pivot.hxx" + +class ScDocShell; +class ScDocument; +class ScOutlineTable; +class ScRangeName; +class ScDBData; +class ScDBCollection; +class ScDPObject; +class SdrUndoAction; + +//---------------------------------------------------------------------------- + +class ScUndoDoOutline: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoDoOutline( ScDocShell* pNewDocShell, + SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab, + ScDocument* pNewUndoDoc, sal_Bool bNewColumns, + sal_uInt16 nNewLevel, sal_uInt16 nNewEntry, sal_Bool bNewShow ); + virtual ~ScUndoDoOutline(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCCOLROW nStart; + SCCOLROW nEnd; + SCTAB nTab; + ScDocument* pUndoDoc; + sal_Bool bColumns; + sal_uInt16 nLevel; + sal_uInt16 nEntry; + sal_Bool bShow; +}; + + +class ScUndoMakeOutline: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoMakeOutline( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + ScOutlineTable* pNewUndoTab, + sal_Bool bNewColumns, sal_Bool bNewMake ); + virtual ~ScUndoMakeOutline(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScAddress aBlockStart; + ScAddress aBlockEnd; + ScOutlineTable* pUndoTable; + sal_Bool bColumns; + sal_Bool bMake; +}; + + +class ScUndoOutlineLevel: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoOutlineLevel( ScDocShell* pNewDocShell, + SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab, + ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab, + sal_Bool bNewColumns, sal_uInt16 nNewLevel ); + virtual ~ScUndoOutlineLevel(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCCOLROW nStart; + SCCOLROW nEnd; + SCTAB nTab; + ScDocument* pUndoDoc; + ScOutlineTable* pUndoTable; + sal_Bool bColumns; + sal_uInt16 nLevel; +}; + + +class ScUndoOutlineBlock: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoOutlineBlock( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab, + sal_Bool bNewShow ); + virtual ~ScUndoOutlineBlock(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScAddress aBlockStart; + ScAddress aBlockEnd; + ScDocument* pUndoDoc; + ScOutlineTable* pUndoTable; + sal_Bool bShow; +}; + + +class ScUndoRemoveAllOutlines: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRemoveAllOutlines( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab ); + virtual ~ScUndoRemoveAllOutlines(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScAddress aBlockStart; + ScAddress aBlockEnd; + ScDocument* pUndoDoc; + ScOutlineTable* pUndoTable; +}; + + +class ScUndoAutoOutline: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoAutoOutline( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab ); + virtual ~ScUndoAutoOutline(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScAddress aBlockStart; + ScAddress aBlockEnd; + ScDocument* pUndoDoc; + ScOutlineTable* pUndoTable; +}; + + +class ScUndoSubTotals: public ScDBFuncUndo +{ +public: + TYPEINFO(); + ScUndoSubTotals( ScDocShell* pNewDocShell, SCTAB nNewTab, + const ScSubTotalParam& rNewParam, SCROW nNewEndY, + ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab, +// ScDBData* pNewData, + ScRangeName* pNewUndoRange, ScDBCollection* pNewUndoDB ); + virtual ~ScUndoSubTotals(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + ScSubTotalParam aParam; // Original uebergebener Parameter + SCROW nNewEndRow; // Ergebnis-Groesse + ScDocument* pUndoDoc; + ScOutlineTable* pUndoTable; +// ScDBData* pUndoDBData; + ScRangeName* pUndoRange; + ScDBCollection* pUndoDB; +}; + + +class ScUndoSort: public ScDBFuncUndo +{ +public: + TYPEINFO(); + ScUndoSort( ScDocShell* pNewDocShell, SCTAB nNewTab, + const ScSortParam& rParam, + sal_Bool bQuery, ScDocument* pNewUndoDoc, + ScDBCollection* pNewUndoDB, const ScRange* pDest = NULL ); + virtual ~ScUndoSort(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + ScSortParam aSortParam; + sal_Bool bRepeatQuery; + ScDocument* pUndoDoc; + ScDBCollection* pUndoDB; // wegen Quell- und Zielbereich + sal_Bool bDestArea; + ScRange aDestRange; +}; + + +class ScUndoQuery: public ScDBFuncUndo +{ +public: + TYPEINFO(); + ScUndoQuery( ScDocShell* pNewDocShell, SCTAB nNewTab, + const ScQueryParam& rParam, ScDocument* pNewUndoDoc, + ScDBCollection* pNewUndoDB, const ScRange* pOld, + sal_Bool bSize, const ScRange* pAdvSrc ); + virtual ~ScUndoQuery(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SdrUndoAction* pDrawUndo; + SCTAB nTab; + ScQueryParam aQueryParam; + ScDocument* pUndoDoc; + ScDBCollection* pUndoDB; // wegen Quell- und Zielbereich + ScRange aOldDest; + ScRange aAdvSource; + sal_Bool bIsAdvanced; + sal_Bool bDestArea; + sal_Bool bDoSize; +}; + + +class ScUndoAutoFilter: public ScDBFuncUndo +{ +private: + String aDBName; + sal_Bool bFilterSet; + + void DoChange( sal_Bool bUndo ); + +public: + TYPEINFO(); + ScUndoAutoFilter( ScDocShell* pNewDocShell, const ScRange& rRange, + const String& rName, sal_Bool bSet ); + virtual ~ScUndoAutoFilter(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; +}; + + +class ScUndoDBData: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoDBData( ScDocShell* pNewDocShell, + ScDBCollection* pNewUndoColl, ScDBCollection* pNewRedoColl ); + virtual ~ScUndoDBData(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScDBCollection* pUndoColl; + ScDBCollection* pRedoColl; +}; + + +class ScUndoImportData: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoImportData( ScDocShell* pNewDocShell, SCTAB nNewTab, + const ScImportParam& rParam, SCCOL nNewEndX, SCROW nNewEndY, + SCCOL nNewFormula, + ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, + ScDBData* pNewUndoData, ScDBData* pNewRedoData ); + virtual ~ScUndoImportData(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + ScImportParam aImportParam; + SCCOL nEndCol; + SCROW nEndRow; + ScDocument* pUndoDoc; + ScDocument* pRedoDoc; + ScDBData* pUndoDBData; + ScDBData* pRedoDBData; + SCCOL nFormulaCols; + sal_Bool bRedoFilled; +}; + + +class ScUndoRepeatDB: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRepeatDB( ScDocShell* pNewDocShell, SCTAB nNewTab, + SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY, + SCROW nResultEndRow, SCCOL nCurX, SCROW nCurY, + ScDocument* pNewUndoDoc, ScOutlineTable* pNewUndoTab, + ScRangeName* pNewUndoRange, ScDBCollection* pNewUndoDB, + const ScRange* pOldQ, const ScRange* pNewQ ); + virtual ~ScUndoRepeatDB(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScAddress aBlockStart; + ScAddress aBlockEnd; + SCROW nNewEndRow; + ScAddress aCursorPos; + ScDocument* pUndoDoc; + ScOutlineTable* pUndoTable; + ScRangeName* pUndoRange; + ScDBCollection* pUndoDB; + ScRange aOldQuery; + ScRange aNewQuery; + sal_Bool bQuerySize; +}; + + +class ScUndoDataPilot: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoDataPilot( ScDocShell* pNewDocShell, + ScDocument* pOldDoc, ScDocument* pNewDoc, + const ScDPObject* pOldObj, const ScDPObject* pNewObj, + sal_Bool bMove ); + virtual ~ScUndoDataPilot(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScDocument* pOldUndoDoc; + ScDocument* pNewUndoDoc; + ScDPObject* pOldDPObject; + ScDPObject* pNewDPObject; + sal_Bool bAllowMove; +}; + + +class ScUndoConsolidate: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoConsolidate( ScDocShell* pNewDocShell, + const ScArea& rArea, const ScConsolidateParam& rPar, + ScDocument* pNewUndoDoc, sal_Bool bReference, + SCROW nInsCount, ScOutlineTable* pTab, + ScDBData* pData ); + virtual ~ScUndoConsolidate(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScArea aDestArea; + ScDocument* pUndoDoc; + ScConsolidateParam aParam; + sal_Bool bInsRef; + SCSIZE nInsertCount; + ScOutlineTable* pUndoTab; + ScDBData* pUndoData; +}; + + +class ScUndoChartData: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoChartData( ScDocShell* pNewDocShell, + const String& rName, const ScRange& rNew, + sal_Bool bColHdr, sal_Bool bRowHdr, sal_Bool bAdd ); + ScUndoChartData( ScDocShell* pNewDocShell, + const String& rName, const ScRangeListRef& rNew, + sal_Bool bColHdr, sal_Bool bRowHdr, sal_Bool bAdd ); + virtual ~ScUndoChartData(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + String aChartName; + ScRangeListRef aOldRangeListRef; + sal_Bool bOldColHeaders; + sal_Bool bOldRowHeaders; +// ScRange aNewRange; + ScRangeListRef aNewRangeListRef; + sal_Bool bNewColHeaders; + sal_Bool bNewRowHeaders; + sal_Bool bAddRange; + + void Init(); +}; + +// amelia +class ScUndoDataForm: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoDataForm( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + const ScMarkData& rMark, + ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, + sal_uInt16 nNewFlags, + ScRefUndoData* pRefData, void* pFill1, void* pFill2, void* pFill3, + sal_Bool bRedoIsFilled = true + ); + virtual ~ScUndoDataForm(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + ScDocument* pRedoDoc; + sal_uInt16 nFlags; + ScRefUndoData* pRefUndoData; + ScRefUndoData* pRefRedoData; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + sal_Bool bRedoFilled; + + void DoChange( const sal_Bool bUndo ); + void SetChangeTrack(); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undodraw.hxx b/sc/source/ui/inc/undodraw.hxx new file mode 100644 index 000000000000..f8f633a2dc7c --- /dev/null +++ b/sc/source/ui/inc/undodraw.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UNDODRAW_HXX +#define SC_UNDODRAW_HXX + +#include <svl/undo.hxx> + +class ScDocShell; + +class ScUndoDraw: public SfxUndoAction +{ + SfxUndoAction* pDrawUndo; + ScDocShell* pDocShell; + +public: + TYPEINFO(); + ScUndoDraw( SfxUndoAction* pUndo, ScDocShell* pDocSh ); + virtual ~ScUndoDraw(); + + SfxUndoAction* GetDrawUndo() { return pDrawUndo; } + void ForgetDrawUndo(); + + virtual sal_Bool IsLinked(); + virtual void SetLinked( sal_Bool bIsLinked ); + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual String GetComment() const; + virtual String GetRepeatComment(SfxRepeatTarget&) const; + virtual sal_uInt16 GetId() const; +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undoolk.hxx b/sc/source/ui/inc/undoolk.hxx new file mode 100644 index 000000000000..9d34785ea1af --- /dev/null +++ b/sc/source/ui/inc/undoolk.hxx @@ -0,0 +1,47 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UNDOOLK_HXX +#define SC_UNDOOLK_HXX + +#include <tools/solar.h> + +class SdrUndoAction; +class ScDocument; + +SdrUndoAction* GetSdrUndoAction ( ScDocument* pDoc ); +void DoSdrUndoAction ( SdrUndoAction* pUndoAction, ScDocument* pDoc ); +void RedoSdrUndoAction ( SdrUndoAction* pUndoAction ); +void DeleteSdrUndoAction ( SdrUndoAction* pUndoAction ); +void EnableDrawAdjust ( ScDocument* pDoc, sal_Bool bEnable ); + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undostyl.hxx b/sc/source/ui/inc/undostyl.hxx new file mode 100644 index 000000000000..f5069ab031b0 --- /dev/null +++ b/sc/source/ui/inc/undostyl.hxx @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UNDOSTYL_HXX +#define SC_UNDOSTYL_HXX + +#include <rsc/rscsfx.hxx> +#include "undobase.hxx" + +class ScDocShell; +class SfxStyleSheetBase; + +//---------------------------------------------------------------------------- + +class ScStyleSaveData +{ +private: + String aName; + String aParent; + SfxItemSet* pItems; + +public: + ScStyleSaveData(); + ScStyleSaveData( const ScStyleSaveData& rOther ); + ~ScStyleSaveData(); + ScStyleSaveData& operator=( const ScStyleSaveData& rOther ); + + void InitFromStyle( const SfxStyleSheetBase* pSource ); + + const String& GetName() const { return aName; } + const String& GetParent() const { return aParent; } + const SfxItemSet* GetItems() const { return pItems; } +}; + +class ScUndoModifyStyle: public ScSimpleUndo +{ +private: + SfxStyleFamily eFamily; + ScStyleSaveData aOldData; + ScStyleSaveData aNewData; + + static void DoChange( ScDocShell* pDocSh, + const String& rName, SfxStyleFamily eStyleFamily, + const ScStyleSaveData& rData ); + +public: + TYPEINFO(); + ScUndoModifyStyle( ScDocShell* pDocSh, + SfxStyleFamily eFam, + const ScStyleSaveData& rOld, + const ScStyleSaveData& rNew ); + virtual ~ScUndoModifyStyle(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; +}; + +class ScUndoApplyPageStyle: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoApplyPageStyle( ScDocShell* pDocSh, const String& rNewStyle ); + virtual ~ScUndoApplyPageStyle(); + + void AddSheetAction( SCTAB nTab, const String& rOld ); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + struct ApplyStyleEntry + { + SCTAB mnTab; + String maOldStyle; + explicit ApplyStyleEntry( SCTAB nTab, const String& rOldStyle ); + }; + typedef ::std::vector< ApplyStyleEntry > ApplyStyleVec; + + ApplyStyleVec maEntries; + String maNewStyle; +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx new file mode 100644 index 000000000000..0c6bec3782af --- /dev/null +++ b/sc/source/ui/inc/undotab.hxx @@ -0,0 +1,527 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UNDOTAB_HXX +#define SC_UNDOTAB_HXX + +#include "undobase.hxx" +#include "markdata.hxx" +#include "formula/grammar.hxx" +#include <tools/color.hxx> +#include "tabbgcolor.hxx" + +#ifndef _SVSTDARR_STRINGS + +#define _SVSTDARR_STRINGS +#include <svl/svstdarr.hxx> + +#endif + +#include <com/sun/star/uno/Sequence.hxx> + +#include <boost/shared_ptr.hpp> +#include <memory> +#include <vector> + +class ScDocShell; +class ScDocument; +class SdrUndoAction; +class ScPrintRangeSaver; +class SdrObject; +class ScDocProtection; +class ScTableProtection; + +//---------------------------------------------------------------------------- + +class ScUndoInsertTab : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoInsertTab( + ScDocShell* pNewDocShell, + SCTAB nTabNum, + sal_Bool bApp, + const String& rNewName); + virtual ~ScUndoInsertTab(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + String sNewName; + SdrUndoAction* pDrawUndo; + sal_uLong nEndChangeAction; + SCTAB nTab; + sal_Bool bAppend; + + void SetChangeTrack(); +}; + +class ScUndoInsertTables : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoInsertTables( + ScDocShell* pNewDocShell, + SCTAB nTabNum, + sal_Bool bApp, + SvStrings *pNewNameList); + virtual ~ScUndoInsertTables(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + + SdrUndoAction* pDrawUndo; + SvStrings* pNameList; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + SCTAB nTab; + sal_Bool bAppend; + + void SetChangeTrack(); +}; + + +class ScUndoDeleteTab: public ScMoveUndo // Draw vom Move fuer geloeschte Tabelle +{ +public: + TYPEINFO(); + ScUndoDeleteTab( + ScDocShell* pNewDocShell, + const std::vector<SCTAB> &theTabs, //SCTAB nNewTab, + ScDocument* pUndoDocument, + ScRefUndoData* pRefData ); + virtual ~ScUndoDeleteTab(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + std::vector<SCTAB> theTabs; + sal_uLong nStartChangeAction; + sal_uLong nEndChangeAction; + + void SetChangeTrack(); +}; + + +class ScUndoRenameTab: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRenameTab( + ScDocShell* pNewDocShell, + SCTAB nT, + const String& rOldName, + const String& rNewName); + virtual ~ScUndoRenameTab(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + String sOldName; + String sNewName; + + void DoChange( SCTAB nTab, const String& rName ) const; +}; + + +class ScUndoMoveTab: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoMoveTab( + ScDocShell* pNewDocShell, + ::std::vector<SCTAB>* pOldTabs, + ::std::vector<SCTAB>* pNewTabs, + ::std::vector< ::rtl::OUString>* pOldNames = NULL, + ::std::vector< ::rtl::OUString>* pNewNames = NULL ); + + virtual ~ScUndoMoveTab(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ::boost::shared_ptr< ::std::vector<SCTAB> > mpOldTabs; + ::boost::shared_ptr< ::std::vector<SCTAB> > mpNewTabs; + ::boost::shared_ptr< ::std::vector< ::rtl::OUString> > mpOldNames; + ::boost::shared_ptr< ::std::vector< ::rtl::OUString> > mpNewNames; + + void DoChange( sal_Bool bUndo ) const; +}; + + +class ScUndoCopyTab: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoCopyTab( + ScDocShell* pNewDocShell, + ::std::vector<SCTAB>* pOldTabs, + ::std::vector<SCTAB>* pNewTabs, + ::std::vector< ::rtl::OUString>* pNewNames = NULL ); + + virtual ~ScUndoCopyTab(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ::boost::shared_ptr< ::std::vector<SCTAB> > mpOldTabs; + ::boost::shared_ptr< ::std::vector<SCTAB> > mpNewTabs; + ::boost::shared_ptr< ::std::vector< ::rtl::OUString> > mpNewNames; + SdrUndoAction* pDrawUndo; + + void DoChange() const; +}; + +class ScUndoTabColor: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoTabColor( + ScDocShell* pNewDocShell, + SCTAB nT, + const Color& aOTabBgColor, + const Color& aNTabBgColor); + ScUndoTabColor( + ScDocShell* pNewDocShell, + const ScUndoTabColorInfo::List& rUndoTabColorList); + virtual ~ScUndoTabColor(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + +virtual String GetComment() const; + +private: + ScUndoTabColorInfo::List aTabColorList; + bool bIsMultipleUndo; + + void DoChange(bool bUndoType) const; +}; + +class ScUndoMakeScenario: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoMakeScenario( + ScDocShell* pNewDocShell, + SCTAB nSrc, SCTAB nDest, + const String& rN, const String& rC, + const Color& rCol, sal_uInt16 nF, + const ScMarkData& rMark ); + virtual ~ScUndoMakeScenario(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nSrcTab; + SCTAB nDestTab; + String aName; + String aComment; + Color aColor; + sal_uInt16 nFlags; + ScMarkData aMarkData; + SdrUndoAction* pDrawUndo; +}; + + +class ScUndoImportTab : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoImportTab( + ScDocShell* pShell, + SCTAB nNewTab, SCTAB nNewCount, + sal_Bool bNewLink ); + virtual ~ScUndoImportTab(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + SCTAB nCount; + sal_Bool bLink; + ScDocument* pRedoDoc; + SdrUndoAction* pDrawUndo; + + void DoChange() const; +}; + + +class ScUndoRemoveLink : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRemoveLink( // vor dem Loeschen aufrufen! + ScDocShell* pShell, + const String& rDoc ); + virtual ~ScUndoRemoveLink(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + String aDocName; + String aFltName; + String aOptions; + sal_uLong nRefreshDelay; + sal_uInt16 nCount; + SCTAB* pTabs; + sal_uInt8* pModes; + String* pTabNames; + + void DoChange( sal_Bool bLink ) const; +}; + + +class ScUndoShowHideTab : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoShowHideTab( + ScDocShell* pShell, + SCTAB nNewTab, sal_Bool bNewShow ); + virtual ~ScUndoShowHideTab(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + sal_Bool bShow; + + void DoChange( sal_Bool bShow ) const; +}; + +// ============================================================================ + +/** This class implements undo & redo of document protect & unprotect + operations. */ +class ScUndoDocProtect : public ScSimpleUndo +{ +public: + ScUndoDocProtect(ScDocShell* pShell, ::std::auto_ptr<ScDocProtection> pProtectSettings); + virtual ~ScUndoDocProtect(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + ::std::auto_ptr<ScDocProtection> mpProtectSettings; + + void DoProtect(bool bProtect); +}; + +// ============================================================================ + +/** This class implements undo & redo of both protect and unprotect of + sheet. */ +class ScUndoTabProtect : public ScSimpleUndo +{ +public: + ScUndoTabProtect(ScDocShell* pShell, SCTAB nTab, + ::std::auto_ptr<ScTableProtection> pProtectSettings); + virtual ~ScUndoTabProtect(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB mnTab; + ::std::auto_ptr<ScTableProtection> mpProtectSettings; + + void DoProtect(bool bProtect); +}; + + +class ScUndoPrintRange : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoPrintRange( ScDocShell* pShell, SCTAB nNewTab, + ScPrintRangeSaver* pOld, ScPrintRangeSaver* pNew ); + virtual ~ScUndoPrintRange(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + ScPrintRangeSaver* pOldRanges; + ScPrintRangeSaver* pNewRanges; + + void DoChange( sal_Bool bUndo ); +}; + + +class ScUndoScenarioFlags: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoScenarioFlags( + ScDocShell* pNewDocShell, SCTAB nT, + const String& rON, const String& rNN, + const String& rOC, const String& rNC, + const Color& rOCol, const Color& rNCol, + sal_uInt16 nOF, sal_uInt16 nNF ); + + virtual ~ScUndoScenarioFlags(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + String aOldName; + String aNewName; + String aOldComment; + String aNewComment; + Color aOldColor; + Color aNewColor; + sal_uInt16 nOldFlags; + sal_uInt16 nNewFlags; +}; + + +class ScUndoRenameObject: public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoRenameObject( + ScDocShell* pNewDocShell, const String& rPN, + const String& rON, const String& rNN ); + + virtual ~ScUndoRenameObject(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + String aPersistName; // to find object (works only for OLE objects) + String aOldName; + String aNewName; + + SdrObject* GetObject(); +}; + + +class ScUndoLayoutRTL : public ScSimpleUndo +{ +public: + TYPEINFO(); + ScUndoLayoutRTL( ScDocShell* pShell, SCTAB nNewTab, sal_Bool bNewRTL ); + virtual ~ScUndoLayoutRTL(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual sal_Bool CanRepeat(SfxRepeatTarget& rTarget) const; + + virtual String GetComment() const; + +private: + SCTAB nTab; + sal_Bool bRTL; + + void DoChange( sal_Bool bNew ); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/undoutil.hxx b/sc/source/ui/inc/undoutil.hxx new file mode 100644 index 000000000000..48985a132fe3 --- /dev/null +++ b/sc/source/ui/inc/undoutil.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_UNDOUTIL_HXX +#define SC_UNDOUTIL_HXX + +#include "address.hxx" +#include <tools/solar.h> + +class ScRange; +class ScDocShell; +class ScDBData; +class ScDocument; + +//---------------------------------------------------------------------------- + +class ScUndoUtil +{ +public: + // Block markieren (unsichtbar, muss repainted werden) + static void MarkSimpleBlock( ScDocShell* pDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ ); + static void MarkSimpleBlock( ScDocShell* pDocShell, + const ScAddress& rBlockStart, + const ScAddress& rBlockEnd ); + static void MarkSimpleBlock( ScDocShell* pDocShell, + const ScRange& rRange ); + + // Bereich +1 painten + static void PaintMore( ScDocShell* pDocShell, + const ScRange& rRange ); + + // DB-Bereich im Dokument suchen ("unbenannt" oder nach Bereich) + // legt neu an, wenn nicht gefunden + static ScDBData* GetOldDBData( ScDBData* pUndoData, ScDocument* pDoc, SCTAB nTab, + SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/validate.hrc b/sc/source/ui/inc/validate.hrc new file mode 100644 index 000000000000..bde827c84e00 --- /dev/null +++ b/sc/source/ui/inc/validate.hrc @@ -0,0 +1,85 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#define TP_VALIDATION_VALUES 696 +#define TP_VALIDATION_INPUTHELP 697 +#define TP_VALIDATION_ERROR 698 +#define TAB_DLG_VALIDATION 699 + +#define FT_ALLOW 1 +#define LB_ALLOW 2 +#define TSB_ALLOW_BLANKS 3 +#define FT_VALUE 4 +#define LB_VALUE 5 +#define FT_MIN 6 +#define EDT_MIN 7 +#define FT_MAX 8 +#define EDT_MAX 9 + +#define FL_CONTENT 10 + +#define TSB_HELP 11 +#define FT_TITLE 12 +#define EDT_TITLE 13 +#define FT_INPUTHELP 14 +#define EDT_INPUTHELP 15 + +#define TSB_SHOW 21 +#define FT_ACTION 22 +#define FT_ERROR 23 +#define LB_ACTION 24 +#define EDT_ERROR 25 +#define BTN_SEARCH 26 + +#define CB_SHOWLIST 27 +#define CB_SORTLIST 28 +#define EDT_LIST 29 +#define FT_SOURCEHINT 30 +#define RB_VALIDITY_REF 88 + +/* Position indexes for "Allow" list box. + They do not map directly to ScValidationMode and can safely be modified to + change the order of the list box entries. */ +#define SC_VALIDDLG_ALLOW_ANY 0 +#define SC_VALIDDLG_ALLOW_WHOLE 1 +#define SC_VALIDDLG_ALLOW_DECIMAL 2 +#define SC_VALIDDLG_ALLOW_DATE 3 +#define SC_VALIDDLG_ALLOW_TIME 4 +#define SC_VALIDDLG_ALLOW_RANGE 5 +#define SC_VALIDDLG_ALLOW_LIST 6 +#define SC_VALIDDLG_ALLOW_TEXTLEN 7 + +/* Position indexes for "Data" list box. + They do not map directly to ScConditionMode and can safely be modified to + change the order of the list box entries. */ +#define SC_VALIDDLG_DATA_EQUAL 0 +#define SC_VALIDDLG_DATA_LESS 1 +#define SC_VALIDDLG_DATA_GREATER 2 +#define SC_VALIDDLG_DATA_EQLESS 3 +#define SC_VALIDDLG_DATA_EQGREATER 4 +#define SC_VALIDDLG_DATA_NOTEQUAL 5 +#define SC_VALIDDLG_DATA_BETWEEN 6 +#define SC_VALIDDLG_DATA_NOTBETWEEN 7 diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx new file mode 100644 index 000000000000..0ad2ac9c6df2 --- /dev/null +++ b/sc/source/ui/inc/validate.hxx @@ -0,0 +1,324 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_VALIDATE_HXX +#define SC_VALIDATE_HXX + +#include <sfx2/tabdlg.hxx> +#include <vcl/edit.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <svtools/svmedit.hxx> + +#include "anyrefdg.hxx" + +// ============================================================================ + +struct ScRefHandlerCaller{ + virtual ~ScRefHandlerCaller(){} +}; +class ScRefHandlerHelper +{ +protected: + ScRefHandlerCaller *m_pHandler; + void (ScRefHandlerCaller::*m_pSetReferenceHdl)( const ScRange& , ScDocument* ); + void (ScRefHandlerCaller::*m_pSetActiveHdl)(); + void (ScRefHandlerCaller::*m_pRefInputStartPreHdl)( formula::RefEdit* pEdit, formula::RefButton* pButton ); + void (ScRefHandlerCaller::*m_pRefInputStartPostHdl)( formula::RefEdit* pEdit, formula::RefButton* pButton ); + void (ScRefHandlerCaller::*m_pRefInputDonePreHdl)(); + void (ScRefHandlerCaller::*m_pRefInputDonePostHdl)(); + +public: + typedef void (ScRefHandlerCaller::*PFUNCSETREFHDLTYPE)( const ScRange& , ScDocument* ); + typedef void (ScRefHandlerCaller::*PCOMMONHDLTYPE)(); + typedef void (ScRefHandlerCaller::*PINPUTSTARTDLTYPE)( formula::RefEdit* pEdit, formula::RefButton* pButton ); + + PFUNCSETREFHDLTYPE SetSetRefHdl( PFUNCSETREFHDLTYPE pNewHdl ) + { + PFUNCSETREFHDLTYPE pOldHdl = m_pSetReferenceHdl; + m_pSetReferenceHdl = pNewHdl; + return pOldHdl; + } + + PCOMMONHDLTYPE SetSetActHdl( PCOMMONHDLTYPE pNewHdl ) + { + PCOMMONHDLTYPE pOldHdl = m_pSetActiveHdl; + m_pSetActiveHdl = pNewHdl; + return pOldHdl; + } + + ScRefHandlerCaller *SetHandler( ScRefHandlerCaller *pNewHandler ) + { + ScRefHandlerCaller *pOldHandler = m_pHandler; + m_pHandler = pNewHandler; + return pOldHandler; + } + void SetRefInputStartPreHdl( PINPUTSTARTDLTYPE pNewHdl ){ m_pRefInputStartPreHdl = pNewHdl; } + void SetRefInputDonePostHdl( void (ScRefHandlerCaller::*pNewHdl)() ){ m_pRefInputDonePostHdl = pNewHdl; } + void SetRefInputStartPostHdl( PINPUTSTARTDLTYPE pNewHdl ){ m_pRefInputStartPostHdl = pNewHdl; } + void SetRefInputDonePreHdl( void (ScRefHandlerCaller::*pNewHdl)() ){ m_pRefInputDonePreHdl = pNewHdl; } + + ScRefHandlerHelper():m_pHandler(NULL), m_pSetReferenceHdl( NULL ), m_pSetActiveHdl(NULL), m_pRefInputStartPreHdl( NULL ), m_pRefInputStartPostHdl( NULL ), m_pRefInputDonePreHdl( NULL ), m_pRefInputDonePostHdl( NULL ){} +}; + +/** The "Validity" tab dialog. */ +class ScValidationDlg :public ScRefHdlrImpl<ScValidationDlg, SfxTabDialog, false>, public ScRefHandlerHelper +{ + typedef ScRefHdlrImpl<ScValidationDlg, SfxTabDialog, false> ScValidationDlgBase; + + DECL_LINK( OkHdl, Button * ); + + bool m_bOwnRefHdlr:1; + + ScTabViewShell *m_pTabVwSh; + bool m_bRefInputting:1; + bool EnterRefStatus(); + bool LeaveRefStatus(); + +public: + explicit ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet, ScTabViewShell * pTabViewSh, SfxBindings *pB = NULL ); + virtual ~ScValidationDlg(); + inline static ScValidationDlg * Find1AliveObject( Window *pAncestor ); + bool IsAlive(); + inline ScTabViewShell * GetTabViewShell(); + + bool SetupRefDlg(); + bool RemoveRefDlg( sal_Bool bRestoreModal = sal_True ); + + virtual void SetModal( sal_Bool bModal ){ ScValidationDlgBase::SetModalInputMode( bModal ); } + + virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) + { + if ( m_pHandler && m_pSetReferenceHdl ) + (m_pHandler->*m_pSetReferenceHdl)( rRef, pDoc ); + } + + virtual void SetActive() + { + if ( m_pHandler && m_pSetActiveHdl ) + (m_pHandler->*m_pSetActiveHdl)(); + } + + void CloseRefDialog() + { + DBG_ASSERT( false, "should not execute here!!!when the edit kill focus, should remove refhandler.\r\n" ); + + if ( IsInExecute() ) + EndDialog( false ); + else if ( GetStyle() & WB_CLOSEABLE ) + Close(); + } + + bool IsRefInputting(){ return m_bRefInputting; } + + virtual void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ) + { + if( !CanInputStart( pEdit ) ) + return; + + if ( m_pHandler && m_pRefInputStartPreHdl ) + (m_pHandler->*m_pRefInputStartPreHdl)( pEdit, pButton ); + m_bRefInputting = true; + ScValidationDlgBase::RefInputStart( pEdit, pButton ); + if ( m_pHandler && m_pRefInputStartPostHdl ) + (m_pHandler->*m_pRefInputStartPostHdl)( pEdit, pButton ); + } + + virtual void RefInputDone( sal_Bool bForced = false ) + { + if( !CanInputDone( bForced ) ) + return; + + if ( m_pHandler && m_pRefInputDonePreHdl ) + (m_pHandler->*m_pRefInputDonePreHdl)(); + + ScValidationDlgBase::RefInputDone( bForced ); + m_bRefInputting = false; + + if ( m_pHandler && m_pRefInputDonePostHdl ) + (m_pHandler->*m_pRefInputDonePostHdl)(); + } + + sal_Bool IsChildFocus(); + + enum { SLOTID = SID_VALIDITY_REFERENCE }; + + sal_Bool Close(); +}; + + +// ============================================================================ + +/** The tab page "Criteria" from the Validation dialog. */ +class ScTPValidationValue : public ScRefHandlerCaller, public SfxTabPage +{ +public: + explicit ScTPValidationValue( Window* pParent, const SfxItemSet& rArgSet ); + virtual ~ScTPValidationValue(); + + static SfxTabPage* Create( Window* pParent, const SfxItemSet& rArgSet ); + static sal_uInt16* GetRanges(); + + virtual sal_Bool FillItemSet( SfxItemSet& rArgSet ); + virtual void Reset( const SfxItemSet& rArgSet ); + +private: + void Init(); + + String GetFirstFormula() const; + String GetSecondFormula() const; + + void SetFirstFormula( const String& rFmlaStr ); + void SetSecondFormula( const String& rFmlaStr ); + + DECL_LINK( SelectHdl, ListBox* ); + DECL_LINK( CheckHdl, CheckBox* ); + + FixedText maFtAllow; + ListBox maLbAllow; + CheckBox maCbAllow; /// Allow blank cells. + CheckBox maCbShow; /// Show selection list in cell. + CheckBox maCbSort; /// Sort selection list in cell. + FixedText maFtValue; + ListBox maLbValue; + FixedText maFtMin; + formula::RefEdit maEdMin; + MultiLineEdit maEdList; /// Entries for explicit list + FixedText maFtMax; + formula::RefEdit maEdMax; + FixedText maFtHint; /// Hint text for cell range validity. + + String maStrMin; + String maStrMax; + String maStrValue; + String maStrRange; + String maStrList; + sal_Unicode mcFmlaSep; /// List separator in formulas. + + DECL_LINK( EditSetFocusHdl, Edit *); + DECL_LINK( KillFocusHdl, Window *); + void OnClick( Button *pBtn ); + formula::RefEdit* m_pRefEdit; + class ScRefButtonEx:public ::formula::RefButton + { + void Click(); + public: + ScRefButtonEx( Window* pParent, const ResId& rResId, formula::RefEdit* pEdit = NULL, ScRefHandler *pRefHdlr = NULL ): ::formula::RefButton( pParent, rResId, pEdit, pRefHdlr ){} + }m_btnRef; + friend class ScRefButtonEx; + void SetReferenceHdl( const ScRange& , ScDocument* ); + void SetActiveHdl(); + void RefInputStartPreHdl( formula::RefEdit* pEdit, formula::RefButton* pButton ); + void RefInputDonePreHdl(); + void RefInputDonePostHdl(); + ScValidationDlg * GetValidationDlg(); + + void TidyListBoxes(); +public: + sal_uInt16 GetAllowEntryPos(); + String GetMinText(); + void SetupRefDlg(); + void RemoveRefDlg(); +}; + + +//================================================================== + +class ScTPValidationHelp : public SfxTabPage +{ +private: + TriStateBox aTsbHelp; + FixedLine aFlContent; + FixedText aFtTitle; + Edit aEdtTitle; + FixedText aFtInputHelp; + MultiLineEdit aEdInputHelp; + + const SfxItemSet& mrArgSet; + + void Init(); + + // Handler ------------------------ + // DECL_LINK( SelectHdl, ListBox * ); + +public: + ScTPValidationHelp( Window* pParent, const SfxItemSet& rArgSet ); + ~ScTPValidationHelp(); + + static SfxTabPage* Create ( Window* pParent, const SfxItemSet& rArgSet ); + static sal_uInt16* GetRanges (); + virtual sal_Bool FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); +}; + +//================================================================== + +class ScTPValidationError : public SfxTabPage +{ +private: + TriStateBox aTsbShow; + FixedLine aFlContent; + FixedText aFtAction; + ListBox aLbAction; + PushButton aBtnSearch; + FixedText aFtTitle; + Edit aEdtTitle; + FixedText aFtError; + MultiLineEdit aEdError; + + const SfxItemSet& mrArgSet; + + void Init(); + + // Handler ------------------------ + DECL_LINK( SelectActionHdl, ListBox * ); + DECL_LINK( ClickSearchHdl, PushButton * ); + +public: + ScTPValidationError( Window* pParent, const SfxItemSet& rArgSet ); + ~ScTPValidationError(); + + static SfxTabPage* Create ( Window* pParent, const SfxItemSet& rArgSet ); + static sal_uInt16* GetRanges (); + virtual sal_Bool FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); +}; + +inline ScTabViewShell *ScValidationDlg::GetTabViewShell() +{ + return m_pTabVwSh; +} + +inline ScValidationDlg * ScValidationDlg::Find1AliveObject( Window *pAncestor ) +{ + return static_cast<ScValidationDlg *>( SC_MOD()->Find1RefWindow( SLOTID, pAncestor ) ); +} + +#endif // SC_VALIDATE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx new file mode 100644 index 000000000000..83a15fc79b60 --- /dev/null +++ b/sc/source/ui/inc/viewdata.hxx @@ -0,0 +1,568 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_VIEWDATA_HXX +#define SC_VIEWDATA_HXX + +#include <svx/zoomitem.hxx> +#include "scdllapi.h" +#include "viewopti.hxx" +#include "markdata.hxx" + + +// --------------------------------------------------------------------------- + +#define SC_SLIDER_SIZE 2 +#define SC_SMALL3DSHADOW COL_BLACK +#define SC_SIZE_NONE 65535 +const SCCOL SC_TABSTART_NONE = SCCOL_MAX; + +#define SC_FILL_NONE 0 +#define SC_FILL_FILL 1 +#define SC_FILL_EMBED_LT 2 +#define SC_FILL_EMBED_RB 3 +#define SC_FILL_MATRIX 4 + +enum ScSplitMode { SC_SPLIT_NONE = 0, SC_SPLIT_NORMAL, SC_SPLIT_FIX }; + +enum ScSplitPos { SC_SPLIT_TOPLEFT, SC_SPLIT_TOPRIGHT, SC_SPLIT_BOTTOMLEFT, SC_SPLIT_BOTTOMRIGHT }; +enum ScHSplitPos { SC_SPLIT_LEFT, SC_SPLIT_RIGHT }; +enum ScVSplitPos { SC_SPLIT_TOP, SC_SPLIT_BOTTOM }; + +inline ScHSplitPos WhichH( ScSplitPos ePos ); +inline ScVSplitPos WhichV( ScSplitPos ePos ); +inline ScSplitPos Which( ScHSplitPos eHPos ); +inline ScSplitPos Which( ScVSplitPos eVPos ); + +// Bildschirmverhalten bei Cursorbewegungen: +enum ScFollowMode { SC_FOLLOW_NONE, SC_FOLLOW_LINE, SC_FOLLOW_FIX, SC_FOLLOW_JUMP }; + +// Mausmodi um Bereiche zu selektieren +enum ScRefType { SC_REFTYPE_NONE, SC_REFTYPE_REF, SC_REFTYPE_FILL, + SC_REFTYPE_EMBED_LT, SC_REFTYPE_EMBED_RB }; + +/** States GetSimpleArea() returns for the underlying selection marks, so the + caller can react if the result is not of type SC_MARK_SIMPLE. */ +enum ScMarkType +{ + SC_MARK_NONE = 0, // Not returned by GetSimpleArea(), used internally. + // Nothing marked always results in the + // current cursor position being selected and a simple mark. + SC_MARK_SIMPLE = 1, // Simple rectangular area marked, no filtered rows. + SC_MARK_FILTERED = 2, // At least one mark contains filtered rows. + SC_MARK_SIMPLE_FILTERED = // Simple rectangular area marked containing filtered rows. + SC_MARK_SIMPLE | + SC_MARK_FILTERED, // 3 + SC_MARK_MULTI = 4 // Multiple selection marks. + /* TODO: if filtered multi-selection was implemented, this would be the value to use. */ +#if 0 + , + SC_MARK_MULTI_FILTERED = // Multiple selection marks containing filtered rows. + SC_MARK_MULTI | + SC_MARK_FILTERED // 6 +#endif +}; + +enum ScPasteFlags +{ + SC_PASTE_NONE = 0, // No flags specified + SC_PASTE_MODE = 1, // Enable paste-mode + SC_PASTE_BORDER = 2, // Show a border around the source cells +}; + +class ScDocShell; +class ScDocument; +class ScDBFunc; +class ScTabViewShell; +class ScDrawView; +class ScEditEngineDefaulter; +class EditView; +class EditStatus; +class Outliner; +class Window; +class SfxObjectShell; +class SfxBindings; +class SfxDispatcher; +class ScPatternAttr; +class ScRangeListRef; +class ScExtDocOptions; +class ScViewData; + +//-------------------------------------------------------------------------- + +class ScViewDataTable // Daten pro Tabelle +{ +friend class ScViewData; +private: + SvxZoomType eZoomType; // selected zoom type (normal view) + Fraction aZoomX; // selected zoom X + Fraction aZoomY; // selected zoom Y (displayed) + Fraction aPageZoomX; // zoom in page break preview mode + Fraction aPageZoomY; + + long nTPosX[2]; // MapMode - Offset (Twips) + long nTPosY[2]; + long nMPosX[2]; // MapMode - Offset (1/100 mm) + long nMPosY[2]; + long nPixPosX[2]; // Offset in Pixeln + long nPixPosY[2]; + long nHSplitPos; + long nVSplitPos; + + ScSplitMode eHSplitMode; + ScSplitMode eVSplitMode; + ScSplitPos eWhichActive; + + SCCOL nFixPosX; // Zellposition des Splitters beim Fixieren + SCROW nFixPosY; + + SCCOL nCurX; + SCROW nCurY; + SCCOL nOldCurX; + SCROW nOldCurY; + SCCOL nPosX[2]; + SCROW nPosY[2]; + + bool bShowGrid; // per-sheet show grid-lines option. + + sal_Bool bOldCurValid; // "virtuelle" Cursorpos. bei zusammengefassten + + ScViewDataTable(); + ~ScViewDataTable(); + + void WriteUserDataSequence( + com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings, + const ScViewData& rViewData, SCTAB nTab ); + + void ReadUserDataSequence( + const com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings, + ScViewData& rViewData, SCTAB nTab, bool& rHasZoom); +}; + +// --------------------------------------------------------------------------- + +class SC_DLLPUBLIC ScViewData +{ +private: + double nPPTX, nPPTY; // Scaling-Faktoren + + ScViewDataTable* pTabData[MAXTABCOUNT]; + ScViewDataTable* pThisTab; // Daten der angezeigten Tabelle + ScDocShell* pDocShell; + ScDocument* pDoc; + ScDBFunc* pView; + ScTabViewShell* pViewShell; + EditView* pEditView[4]; // gehoert dem Fenster + ScViewOptions* pOptions; + EditView* pSpellingView; + + ScMarkData aMarkData; + + long nEditMargin; + + Size aScenButSize; // Groesse eines Szenario-Buttons + + Size aScrSize; + MapMode aLogicMode; // skalierter 1/100mm-MapMode + + SvxZoomType eDefZoomType; // default zoom and type for missing TabData + Fraction aDefZoomX; + Fraction aDefZoomY; + Fraction aDefPageZoomX; // zoom in page break preview mode + Fraction aDefPageZoomY; + + ScRefType eRefType; + + SCTAB nTabNo; // angezeigte Tabelle + SCTAB nRefTabNo; // Tabelle auf die sich RefInput bezieht + SCCOL nRefStartX; + SCROW nRefStartY; + SCTAB nRefStartZ; + SCCOL nRefEndX; + SCROW nRefEndY; + SCTAB nRefEndZ; + SCCOL nFillStartX; // Fill-Cursor + SCROW nFillStartY; + SCCOL nFillEndX; + SCROW nFillEndY; + SCCOL nEditCol; // Position dazu + SCROW nEditRow; + SCCOL nEditStartCol; + SCCOL nEditEndCol; // Ende der Edit-View + SCROW nEditEndRow; + SCCOL nTabStartCol; // fuer Enter nach Tab + ScRange aDelRange; // fuer AutoFill-Loeschen + + ScPasteFlags nPasteFlags; + + ScSplitPos eEditActivePart; // the part that was active when edit mode was started + sal_Bool bEditActive[4]; // aktiv? + sal_Bool bActive; // aktives Fenster ? + sal_Bool bIsRefMode; // Referenzeingabe + sal_Bool bDelMarkValid; // nur gueltig bei SC_REFTYPE_FILL + sal_uInt8 nFillMode; // Modus + sal_Bool bPagebreak; // Seitenumbruch-Vorschaumodus + + sal_Bool bSelCtrlMouseClick; // special selection handling for ctrl-mouse-click + + SC_DLLPRIVATE DECL_LINK (EmptyEditHdl, EditStatus*); + SC_DLLPRIVATE DECL_LINK (EditEngineHdl, EditStatus*); + + SC_DLLPRIVATE void CalcPPT(); + SC_DLLPRIVATE void CreateTabData( SCTAB nNewTab ); + SC_DLLPRIVATE void CreateTabData( std::vector< SCTAB >& rvTabs ); + SC_DLLPRIVATE void CreateSelectedTabData(); + +public: + ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ); + ScViewData( const ScViewData& rViewData ); + ~ScViewData(); + + void InitData( ScDocument* pDocument ); + + ScDocShell* GetDocShell() const { return pDocShell; } + ScDBFunc* GetView() const { return pView; } + ScTabViewShell* GetViewShell() const { return pViewShell; } + + SfxObjectShell* GetSfxDocShell() const; + SfxBindings& GetBindings(); // from ViewShell's ViewFrame + SfxDispatcher& GetDispatcher(); // from ViewShell's ViewFrame + + ScMarkData& GetMarkData() { return aMarkData; } + const ScMarkData& GetMarkData() const { return aMarkData; } + + Window* GetDialogParent(); // von tabvwsh weitergeleitet + Window* GetActiveWin(); // von View + ScDrawView* GetScDrawView(); // von View + sal_Bool IsMinimized(); // von View + + void UpdateInputHandler( sal_Bool bForce = false, sal_Bool bStopEditing = sal_True ); + + void WriteUserData(String& rData); + void ReadUserData(const String& rData); + void WriteExtOptions( ScExtDocOptions& rOpt ) const; + void ReadExtOptions( const ScExtDocOptions& rOpt ); + void WriteUserDataSequence(com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings); + void ReadUserDataSequence(const com::sun::star::uno::Sequence <com::sun::star::beans::PropertyValue>& rSettings); + + ScDocument* GetDocument() const; + + sal_Bool IsActive() const { return bActive; } + void Activate(sal_Bool bActivate) { bActive = bActivate; } + + void UpdateThis(); + + void InsertTab( SCTAB nTab ); + void DeleteTab( SCTAB nTab ); + void CopyTab( SCTAB nSrcTab, SCTAB nDestTab ); + void MoveTab( SCTAB nSrcTab, SCTAB nDestTab ); + + SCTAB GetRefTabNo() const { return nRefTabNo; } + void SetRefTabNo( SCTAB nNewTab ) { nRefTabNo = nNewTab; } + + SCTAB GetTabNo() const { return nTabNo; } + ScSplitPos GetActivePart() const { return pThisTab->eWhichActive; } + SCCOL GetPosX( ScHSplitPos eWhich ) const { return pThisTab->nPosX[eWhich]; } + SCROW GetPosY( ScVSplitPos eWhich ) const { return pThisTab->nPosY[eWhich]; } + SCCOL GetCurX() const { return pThisTab->nCurX; } + SCROW GetCurY() const { return pThisTab->nCurY; } + sal_Bool HasOldCursor() const { return pThisTab->bOldCurValid; } + SCCOL GetOldCurX() const; + SCROW GetOldCurY() const; + ScSplitMode GetHSplitMode() const { return pThisTab->eHSplitMode; } + ScSplitMode GetVSplitMode() const { return pThisTab->eVSplitMode; } + long GetHSplitPos() const { return pThisTab->nHSplitPos; } + long GetVSplitPos() const { return pThisTab->nVSplitPos; } + SCCOL GetFixPosX() const { return pThisTab->nFixPosX; } + SCROW GetFixPosY() const { return pThisTab->nFixPosY; } + sal_Bool IsPagebreakMode() const { return bPagebreak; } + bool IsPasteMode() const { return nPasteFlags & SC_PASTE_MODE; } + bool ShowPasteSource() const { return nPasteFlags & SC_PASTE_BORDER; } + + void SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX ); + void SetPosY( ScVSplitPos eWhich, SCROW nNewPosY ); + void SetCurX( SCCOL nNewCurX ) { pThisTab->nCurX = nNewCurX; } + void SetCurY( SCROW nNewCurY ) { pThisTab->nCurY = nNewCurY; } + void SetOldCursor( SCCOL nNewX, SCROW nNewY ); + void ResetOldCursor(); + void SetHSplitMode( ScSplitMode eMode ) { pThisTab->eHSplitMode = eMode; } + void SetVSplitMode( ScSplitMode eMode ) { pThisTab->eVSplitMode = eMode; } + void SetHSplitPos( long nPos ) { pThisTab->nHSplitPos = nPos; } + void SetVSplitPos( long nPos ) { pThisTab->nVSplitPos = nPos; } + void SetFixPosX( SCCOL nPos ) { pThisTab->nFixPosX = nPos; } + void SetFixPosY( SCROW nPos ) { pThisTab->nFixPosY = nPos; } + void SetPagebreakMode( sal_Bool bSet ); + void SetPasteMode ( ScPasteFlags nFlags ) { nPasteFlags = nFlags; } + + void SetZoomType( SvxZoomType eNew, sal_Bool bAll ); + void SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs ); + void SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vector< SCTAB >& tabs ); + void SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool bAll ); + void RefreshZoom(); + + void SetSelCtrlMouseClick( sal_Bool bTmp ) { bSelCtrlMouseClick = bTmp; } + + SvxZoomType GetZoomType() const { return pThisTab->eZoomType; } + const Fraction& GetZoomX() const { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; } + const Fraction& GetZoomY() const { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; } + + void SetShowGrid( bool bShow ); + bool GetShowGrid() const { return pThisTab->bShowGrid; } + + const MapMode& GetLogicMode( ScSplitPos eWhich ); + const MapMode& GetLogicMode(); // Offset 0 + + long GetTPosX( ScHSplitPos eWhich ) const { return pThisTab->nTPosX[eWhich]; } + long GetTPosY( ScVSplitPos eWhich ) const { return pThisTab->nTPosY[eWhich]; } + + double GetPPTX() const { return nPPTX; } + double GetPPTY() const { return nPPTY; } + + ScMarkType GetSimpleArea( SCCOL& rStartCol, SCROW& rStartRow, SCTAB& rStartTab, + SCCOL& rEndCol, SCROW& rEndRow, SCTAB& rEndTab ) const; + ScMarkType GetSimpleArea( ScRange& rRange ) const; + /// May modify rNewMark using MarkToSimple(). + ScMarkType GetSimpleArea( ScRange & rRange, ScMarkData & rNewMark ) const; + void GetMultiArea( ScRangeListRef& rRange ) const; + + sal_Bool SimpleColMarked(); + sal_Bool SimpleRowMarked(); + + sal_Bool IsMultiMarked(); + + void SetFillMode( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ); + void SetDragMode( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, + sal_uInt8 nMode ); + void GetFillData( SCCOL& rStartCol, SCROW& rStartRow, + SCCOL& rEndCol, SCROW& rEndRow ); + void ResetFillMode(); + sal_Bool IsAnyFillMode() { return nFillMode != SC_FILL_NONE; } + sal_Bool IsFillMode() { return nFillMode == SC_FILL_FILL; } + sal_uInt8 GetFillMode() { return nFillMode; } + + // TRUE: Zelle ist zusammengefasst + sal_Bool GetMergeSizePixel( SCCOL nX, SCROW nY, long& rSizeXPix, long& rSizeYPix ); + sal_Bool GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWhich, + SCsCOL& rPosX, SCsROW& rPosY, + sal_Bool bTestMerge = sal_True, sal_Bool bRepair = false, + sal_Bool bNextIfLarge = sal_True ); + void GetMouseQuadrant( const Point& rClickPos, ScSplitPos eWhich, + SCsCOL nPosX, SCsROW nPosY, sal_Bool& rLeft, sal_Bool& rTop ); + + sal_Bool IsRefMode() const { return bIsRefMode; } + ScRefType GetRefType() const { return eRefType; } + SCCOL GetRefStartX() const { return nRefStartX; } + SCROW GetRefStartY() const { return nRefStartY; } + SCTAB GetRefStartZ() const { return nRefStartZ; } + SCCOL GetRefEndX() const { return nRefEndX; } + SCROW GetRefEndY() const { return nRefEndY; } + SCTAB GetRefEndZ() const { return nRefEndZ; } + + void SetRefMode( sal_Bool bNewMode, ScRefType eNewType ) + { bIsRefMode = bNewMode; eRefType = eNewType; } + + void SetRefStart( SCCOL nNewX, SCROW nNewY, SCTAB nNewZ ) + { nRefStartX = nNewX; nRefStartY = nNewY; nRefStartZ = nNewZ; } + void SetRefEnd( SCCOL nNewX, SCROW nNewY, SCTAB nNewZ ) + { nRefEndX = nNewX; nRefEndY = nNewY; nRefEndZ = nNewZ; } + + void ResetDelMark() { bDelMarkValid = false; } + void SetDelMark( const ScRange& rRange ) + { aDelRange = rRange; bDelMarkValid = sal_True; } + + sal_Bool GetDelMark( ScRange& rRange ) const + { rRange = aDelRange; return bDelMarkValid; } + + inline void GetMoveCursor( SCCOL& rCurX, SCROW& rCurY ); + + const ScViewOptions& GetOptions() const { return *pOptions; } + void SetOptions( const ScViewOptions& rOpt ); + + sal_Bool IsGridMode () const { return pOptions->GetOption( VOPT_GRID ); } + void SetGridMode ( sal_Bool bNewMode ) { pOptions->SetOption( VOPT_GRID, bNewMode ); } + sal_Bool IsSyntaxMode () const { return pOptions->GetOption( VOPT_SYNTAX ); } + void SetSyntaxMode ( sal_Bool bNewMode ) { pOptions->SetOption( VOPT_SYNTAX, bNewMode ); } + sal_Bool IsHeaderMode () const { return pOptions->GetOption( VOPT_HEADER ); } + void SetHeaderMode ( sal_Bool bNewMode ) { pOptions->SetOption( VOPT_HEADER, bNewMode ); } + sal_Bool IsTabMode () const { return pOptions->GetOption( VOPT_TABCONTROLS ); } + void SetTabMode ( sal_Bool bNewMode ) { pOptions->SetOption( VOPT_TABCONTROLS, bNewMode ); } + sal_Bool IsVScrollMode () const { return pOptions->GetOption( VOPT_VSCROLL ); } + void SetVScrollMode ( sal_Bool bNewMode ) { pOptions->SetOption( VOPT_VSCROLL, bNewMode ); } + sal_Bool IsHScrollMode () const { return pOptions->GetOption( VOPT_HSCROLL ); } + void SetHScrollMode ( sal_Bool bNewMode ) { pOptions->SetOption( VOPT_HSCROLL, bNewMode ); } + sal_Bool IsOutlineMode () const { return pOptions->GetOption( VOPT_OUTLINER ); } + void SetOutlineMode ( sal_Bool bNewMode ) { pOptions->SetOption( VOPT_OUTLINER, bNewMode ); } + + void KillEditView(); + void ResetEditView(); + void SetEditEngine( ScSplitPos eWhich, + ScEditEngineDefaulter* pNewEngine, + Window* pWin, SCCOL nNewX, SCROW nNewY ); + void GetEditView( ScSplitPos eWhich, EditView*& rViewPtr, SCCOL& rCol, SCROW& rRow ); + sal_Bool HasEditView( ScSplitPos eWhich ) const + { return pEditView[eWhich] && bEditActive[eWhich]; } + EditView* GetEditView( ScSplitPos eWhich ) const + { return pEditView[eWhich]; } + + void EditGrowX(); + void EditGrowY( sal_Bool bInitial = false ); + + ScSplitPos GetEditActivePart() const { return eEditActivePart; } + SCCOL GetEditViewCol() const { return nEditCol; } + SCROW GetEditViewRow() const { return nEditRow; } + SCCOL GetEditStartCol() const { return nEditStartCol; } + SCROW GetEditStartRow() const { return nEditRow; } // never editing above the cell + SCCOL GetEditEndCol() const { return nEditEndCol; } + SCROW GetEditEndRow() const { return nEditEndRow; } + + Rectangle GetEditArea( ScSplitPos eWhich, SCCOL nPosX, SCROW nPosY, Window* pWin, + const ScPatternAttr* pPattern, sal_Bool bForceToTop ); + + void SetTabNo( SCTAB nNewTab ); + void SetActivePart( ScSplitPos eNewActive ); + + Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScSplitPos eWhich, + sal_Bool bAllowNeg = false ) const; + Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScHSplitPos eWhich ) const; + Point GetScrPos( SCCOL nWhereX, SCROW nWhereY, ScVSplitPos eWhich ) const; + + SCCOL CellsAtX( SCsCOL nPosX, SCsCOL nDir, ScHSplitPos eWhichX, sal_uInt16 nScrSizeY = SC_SIZE_NONE ) const; + SCROW CellsAtY( SCsROW nPosY, SCsROW nDir, ScVSplitPos eWhichY, sal_uInt16 nScrSizeX = SC_SIZE_NONE ) const; + + SCCOL VisibleCellsX( ScHSplitPos eWhichX ) const; // angezeigte komplette Zellen + SCROW VisibleCellsY( ScVSplitPos eWhichY ) const; + SCCOL PrevCellsX( ScHSplitPos eWhichX ) const; // Zellen auf der vorgehenden Seite + SCROW PrevCellsY( ScVSplitPos eWhichY ) const; + + sal_Bool IsOle(); + void SetScreen( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ); + void SetScreen( const Rectangle& rVisArea ); + void SetScreenPos( const Point& rVisAreaStart ); + + void UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY ); + + Size GetScrSize() const { return aScrSize; } + + void RecalcPixPos(); + Point GetPixPos( ScSplitPos eWhich ) const + { return Point( pThisTab->nPixPosX[WhichH(eWhich)], + pThisTab->nPixPosY[WhichV(eWhich)] ); } + void SetSpellingView( EditView* pSpView) { pSpellingView = pSpView; } + EditView* GetSpellingView() const { return pSpellingView; } + + void UpdateOutlinerFlags( Outliner& rOutl ) const; + + Point GetMousePosPixel(); + + sal_Bool UpdateFixX(SCTAB nTab = MAXTAB+1); + sal_Bool UpdateFixY(SCTAB nTab = MAXTAB+1); + + SCCOL GetTabStartCol() const { return nTabStartCol; } + void SetTabStartCol(SCCOL nNew) { nTabStartCol = nNew; } + + ScAddress GetCurPos() const; + + const Size& GetScenButSize() const { return aScenButSize; } + void SetScenButSize(const Size& rNew) { aScenButSize = rNew; } + + sal_Bool IsSelCtrlMouseClick() { return bSelCtrlMouseClick; } + + static inline long ToPixel( sal_uInt16 nTwips, double nFactor ); + + /** while (rScrY <= nEndPixels && rPosY <= nEndRow) add pixels of row + heights converted with nPPTY to rScrY, optimized for row height + segments. Upon return rPosY is the last row evaluated <= nEndRow, rScrY + may be > nEndPixels! + */ + static void AddPixelsWhile( long & rScrY, long nEndPixels, + SCROW & rPosY, SCROW nEndRow, double nPPTY, + const ScDocument * pDoc, SCTAB nTabNo ); + + /** while (rScrY <= nEndPixels && rPosY >= nStartRow) add pixels of row + heights converted with nPPTY to rScrY, optimized for row height + segments. Upon return rPosY is the last row evaluated >= nStartRow, + rScrY may be > nEndPixels! + */ + static void AddPixelsWhileBackward( long & rScrY, long nEndPixels, + SCROW & rPosY, SCROW nStartRow, double nPPTY, + const ScDocument * pDoc, SCTAB nTabNo ); +}; + + +// --------------------------------------------------------------------------- + +inline long ScViewData::ToPixel( sal_uInt16 nTwips, double nFactor ) +{ + long nRet = (long)( nTwips * nFactor ); + if ( !nRet && nTwips ) + nRet = 1; + return nRet; +} + +inline void ScViewData::GetMoveCursor( SCCOL& rCurX, SCROW& rCurY ) +{ + if ( bIsRefMode ) + { + rCurX = nRefEndX; + rCurY = nRefEndY; + } + else + { + rCurX = GetCurX(); + rCurY = GetCurY(); + } +} + +inline ScHSplitPos WhichH( ScSplitPos ePos ) +{ + return (ePos==SC_SPLIT_TOPLEFT || ePos==SC_SPLIT_BOTTOMLEFT) ? + SC_SPLIT_LEFT : SC_SPLIT_RIGHT; +} + +inline ScVSplitPos WhichV( ScSplitPos ePos ) +{ + return (ePos==SC_SPLIT_TOPLEFT || ePos==SC_SPLIT_TOPRIGHT) ? + SC_SPLIT_TOP : SC_SPLIT_BOTTOM; +} + +inline ScSplitPos Which( ScHSplitPos eHPos ) +{ + return (eHPos==SC_SPLIT_LEFT) ? + SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT; +} + +inline ScSplitPos Which( ScVSplitPos eVPos ) +{ + return (eVPos==SC_SPLIT_TOP) ? + SC_SPLIT_TOPLEFT : SC_SPLIT_BOTTOMLEFT; +} + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx new file mode 100644 index 000000000000..785b730d6945 --- /dev/null +++ b/sc/source/ui/inc/viewfunc.hxx @@ -0,0 +1,378 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_VIEWFUNC_HXX +#define SC_VIEWFUNC_HXX + +#include "tabview.hxx" + +#include "tabbgcolor.hxx" + +#ifndef _SVSTDARR_STRINGS + +#define _SVSTDARR_STRINGS +#include <svl/svstdarr.hxx> + +#endif +#include <com/sun/star/embed/XEmbeddedObject.hpp> +#include <com/sun/star/embed/Aspects.hpp> +#include <vector> + +class ScPatternAttr; +class ScAutoFormatData; +class SvxSearchItem; +class SfxItemSet; +class SvxBoxItem; +class SvxBoxInfoItem; +class SfxStyleSheetBase; +class SfxStyleSheet; +class SfxPoolItem; +class EditTextObject; +struct ScSolveParam; +struct ScTabOpParam; +class ScPostIt; +class ScConditionalFormat; +class ScValidationData; +class ScConversionParam; +class SdrModel; +class Graphic; +class Exchange; +class ScRangeList; +class SvxHyperlinkItem; +class ScTransferObj; +class ScTableProtection; + +namespace editeng { class SvxBorderLine; } + +namespace com { namespace sun { namespace star { namespace datatransfer { class XTransferable; } } } } + +//================================================================== + +class ScViewFunc : public ScTabView +{ +private: + ScAddress aFormatSource; // fuer automatisches Erweitern von Formatierung + ScRange aFormatArea; + sal_Bool bFormatValid; + +public: + ScViewFunc( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ); + ~ScViewFunc(); + + const ScPatternAttr* GetSelectionPattern (); + void GetSelectionFrame ( SvxBoxItem& rLineOuter, + SvxBoxInfoItem& rLineInner ); + + sal_uInt8 GetSelectionScriptType(); + + sal_Bool GetAutoSumArea(ScRangeList& rRangeList); + void EnterAutoSum(const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr); + bool AutoSum( const ScRange& rRange, bool bSubTotal, bool bSetCursor, bool bContinue ); + String GetAutoSumFormula( const ScRangeList& rRangeList, bool bSubTotal, const ScAddress& rAddr ); + + void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, + sal_Bool bRecord = sal_True, const EditTextObject* pData = NULL ); + void EnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rValue ); + void EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const EditTextObject* pData, + sal_Bool bRecord = sal_True, sal_Bool bTestSimple = false ); + + void EnterMatrix( const String& rString ); + void EnterBlock( const String& rString, const EditTextObject* pData ); + + void EnterDataAtCursor( const String& rString ); //! nicht benutzt ? + + SC_DLLPUBLIC void CutToClip( ScDocument* pClipDoc = NULL, sal_Bool bIncludeObjects = false ); + SC_DLLPUBLIC sal_Bool CopyToClip( ScDocument* pClipDoc = NULL, sal_Bool bCut = false, sal_Bool bApi = false, + sal_Bool bIncludeObjects = false, sal_Bool bStopEdit = true ); + SC_DLLPUBLIC sal_Bool CopyToClip( ScDocument* pClipDoc, const ScRange& rRange, sal_Bool bCut = false, + sal_Bool bApi = false, sal_Bool bIncludeObjects = false, sal_Bool bStopEdit = true ); + ScTransferObj* CopyToTransferable(); + SC_DLLPUBLIC sal_Bool PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, + sal_uInt16 nFunction = PASTE_NOFUNC, sal_Bool bSkipEmpty = false, + sal_Bool bTranspose = false, sal_Bool bAsLink = false, + InsCellCmd eMoveMode = INS_NONE, + sal_uInt16 nUndoExtraFlags = IDF_NONE, + sal_Bool bAllowDialogs = false ); + + void FillTab( sal_uInt16 nFlags, sal_uInt16 nFunction, sal_Bool bSkipEmpty, sal_Bool bAsLink ); + + SC_DLLPUBLIC void PasteFromSystem(); + SC_DLLPUBLIC sal_Bool PasteFromSystem( sal_uLong nFormatId, sal_Bool bApi = false ); + void PasteFromTransferable( const ::com::sun::star::uno::Reference< + ::com::sun::star::datatransfer::XTransferable >& rxTransferable ); + + void PasteDraw(); + void PasteDraw( const Point& rLogicPos, SdrModel* pModel, + sal_Bool bGroup = false, sal_Bool bSameDocClipboard = false ); + + sal_Bool PasteOnDrawObject( const ::com::sun::star::uno::Reference< + ::com::sun::star::datatransfer::XTransferable >& rxTransferable, + SdrObject* pHitObj, sal_Bool bLink ); + + sal_Bool PasteDataFormat( sal_uLong nFormatId, + const ::com::sun::star::uno::Reference< + ::com::sun::star::datatransfer::XTransferable >& rxTransferable, + SCCOL nPosX, SCROW nPosY, Point* pLogicPos = NULL, + sal_Bool bLink = false, sal_Bool bAllowDialogs = false ); + + sal_Bool PasteFile( const Point&, const String&, sal_Bool bLink=false ); + sal_Bool PasteObject( const Point&, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >&, const Size* = NULL, const Graphic* = NULL, const ::rtl::OUString& = ::rtl::OUString(), sal_Int64 nAspect = ::com::sun::star::embed::Aspects::MSOLE_CONTENT ); + sal_Bool PasteBitmap( const Point&, const Bitmap& ); + sal_Bool PasteMetaFile( const Point&, const GDIMetaFile& ); + sal_Bool PasteGraphic( const Point& rPos, const Graphic& rGraphic, + const String& rFile, const String& rFilter ); + sal_Bool PasteBookmark( sal_uLong nFormatId, + const ::com::sun::star::uno::Reference< + ::com::sun::star::datatransfer::XTransferable >& rxTransferable, + SCCOL nPosX, SCROW nPosY ); + sal_Bool PasteDDE( const ::com::sun::star::uno::Reference< + ::com::sun::star::datatransfer::XTransferable >& rxTransferable ); + + sal_Bool ApplyGraphicToObject( SdrObject* pObject, const Graphic& rGraphic ); + + void InsertBookmark( const String& rDescription, const String& rURL, + SCCOL nPosX, SCROW nPosY, const String* pTarget = NULL, + sal_Bool bTryReplace = false ); + sal_Bool HasBookmarkAtCursor( SvxHyperlinkItem* pContent ); + + long DropRequestHdl( Exchange* pExchange ); + sal_Bool MoveBlockTo( const ScRange& rSource, const ScAddress& rDestPos, + sal_Bool bCut, sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi ); + + sal_Bool LinkBlock( const ScRange& rSource, const ScAddress& rDestPos, sal_Bool bApi ); + + void CreateNames( sal_uInt16 nFlags ); + sal_uInt16 GetCreateNameFlags(); + void InsertNameList(); + sal_Bool InsertName( const String& rName, const String& rSymbol, + const String& rType ); + + void ApplyAttributes( const SfxItemSet* pDialogSet, const SfxItemSet* pOldSet, + sal_Bool bRecord = sal_True ); + void ApplyAttr( const SfxPoolItem& rAttrItem ); + void ApplySelectionPattern( const ScPatternAttr& rAttr, + sal_Bool bRecord = sal_True, + sal_Bool bCursorOnly = false ); + void ApplyPatternLines( const ScPatternAttr& rAttr, + const SvxBoxItem* pNewOuter, + const SvxBoxInfoItem* pNewInner, sal_Bool bRecord = sal_True ); + + void ApplyUserItemSet( const SfxItemSet& rItemSet ); + + const SfxStyleSheet* GetStyleSheetFromMarked(); + void SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, + sal_Bool bRecord = sal_True ); + void RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ); + void UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ); + + void SetNumberFormat( short nFormatType, sal_uLong nAdd = 0 ); + void SetNumFmtByStr( const String& rCode ); + void ChangeNumFmtDecimals( sal_Bool bIncrement ); + + void SetConditionalFormat( const ScConditionalFormat& rNew ); + void SetValidation( const ScValidationData& rNew ); + + void ChangeIndent( sal_Bool bIncrement ); + + void ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect ); + + void Protect( SCTAB nTab, const String& rPassword ); + sal_Bool Unprotect( SCTAB nTab, const String& rPassword ); + + void DeleteCells( DelCellCmd eCmd, sal_Bool bRecord = sal_True ); + sal_Bool InsertCells( InsCellCmd eCmd, sal_Bool bRecord = sal_True, sal_Bool bPartOfPaste = false ); + void DeleteMulti( sal_Bool bRows, sal_Bool bRecord = sal_True ); + + void DeleteContents( sal_uInt16 nFlags, sal_Bool bRecord = sal_True ); + + void SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges, + ScSizeMode eMode, sal_uInt16 nSizeTwips, + sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True, + ScMarkData* pMarkData = NULL ); + void SetMarkedWidthOrHeight( sal_Bool bWidth, ScSizeMode eMode, sal_uInt16 nSizeTwips, + sal_Bool bRecord = sal_True, sal_Bool bPaint = sal_True ); + void ShowMarkedColumns( sal_Bool bShow, sal_Bool bRecord = sal_True ); + void ShowMarkedRows( sal_Bool bShow, sal_Bool bRecord = sal_True ); + + sal_Bool AdjustBlockHeight( sal_Bool bPaint = sal_True, ScMarkData* pMarkData = NULL ); + sal_Bool AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, sal_Bool bPaint = sal_True ); + + void ModifyCellSize( ScDirection eDir, sal_Bool bOptimal ); + + SC_DLLPUBLIC void InsertPageBreak( sal_Bool bColumn, sal_Bool bRecord = sal_True, + const ScAddress* pPos = NULL, + sal_Bool bSetModified = sal_True ); + SC_DLLPUBLIC void DeletePageBreak( sal_Bool bColumn, sal_Bool bRecord = sal_True, + const ScAddress* pPos = NULL, + sal_Bool bSetModified = sal_True ); + + void RemoveManualBreaks(); + + void SetPrintZoom(sal_uInt16 nScale, sal_uInt16 nPages); + void AdjustPrintZoom(); + + sal_Bool TestMergeCells(); + sal_Bool TestRemoveMerge(); + + sal_Bool MergeCells( sal_Bool bApi, sal_Bool& rDoContents, sal_Bool bRecord = true, sal_Bool bCenter = false ); + sal_Bool RemoveMerge( sal_Bool bRecord = true ); + + void FillSimple( FillDir eDir, sal_Bool bRecord = sal_True ); + void FillSeries( FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, + double fStart, double fStep, double fMax, sal_Bool bRecord = sal_True ); + void FillAuto( FillDir eDir, SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, sal_uLong nCount, sal_Bool bRecord = sal_True ); + void FillCrossDblClick(); + + void TransliterateText( sal_Int32 nType ); + + ScAutoFormatData* CreateAutoFormatData(); + void AutoFormat( sal_uInt16 nFormatNo, sal_Bool bRecord = sal_True ); + + void SearchAndReplace( const SvxSearchItem* pSearchItem, + sal_Bool bAddUndo, sal_Bool bIsApi ); + + void Solve( const ScSolveParam& rParam ); + void TabOp( const ScTabOpParam& rParam, sal_Bool bRecord = sal_True ); + + sal_Bool InsertTable( const String& rName, SCTAB nTabNr, sal_Bool bRecord = sal_True ); + sal_Bool InsertTables(SvStrings *pNames, SCTAB nTab, SCTAB nCount, sal_Bool bRecord = sal_True); + + + sal_Bool AppendTable( const String& rName, sal_Bool bRecord = sal_True ); + + sal_Bool DeleteTable( SCTAB nTabNr, sal_Bool bRecord = true ); + sal_Bool DeleteTables(const std::vector<SCTAB>& TheTabs, sal_Bool bRecord = true ); + + sal_Bool RenameTable( const String& rName, SCTAB nTabNr ); + void MoveTable( sal_uInt16 nDestDocNo, SCTAB nDestTab, sal_Bool bCopy, const String* pNewTabName = NULL ); + void ImportTables( ScDocShell* pSrcShell, + SCTAB nCount, const SCTAB* pSrcTabs, + sal_Bool bLink,SCTAB nTab); + + bool SetTabBgColor( const Color& rColor, SCTAB nTabNr ); + bool SetTabBgColor( ScUndoTabColorInfo::List& rUndoSetTabBgColorInfoList ); + + void InsertTableLink( const String& rFile, + const String& rFilter, const String& rOptions, + const String& rTabName ); + void InsertAreaLink( const String& rFile, + const String& rFilter, const String& rOptions, + const String& rSource, sal_uLong nRefresh ); + + void ShowTable( const String& rName ); + void HideTable( SCTAB nTabNr ); + + void MakeScenario( const String& rName, const String& rComment, + const Color& rColor, sal_uInt16 nFlags ); + void ExtendScenario(); + void UseScenario( const String& rName ); + + void InsertSpecialChar( const String& rStr, const Font& rFont ); + + void InsertDummyObject(); + void InsertOleObject(); + + void InsertDraw(); + + void SetSelectionFrameLines( const ::editeng::SvxBorderLine* pLine, + sal_Bool bColorOnly ); + + void SetNoteText( const ScAddress& rPos, const String& rNoteText ); + void ReplaceNote( const ScAddress& rPos, const String& rNoteText, const String* pAuthor, const String* pDate ); + void DoRefConversion( sal_Bool bRecord = sal_True ); + + void DoHangulHanjaConversion( sal_Bool bRecord = true ); + void DoThesaurus( sal_Bool bRecord = true ); + + /** Generic implementation of sheet conversion functions. */ + void DoSheetConversion( const ScConversionParam& rParam, sal_Bool bRecord = sal_True ); + + void SetPrintRanges( sal_Bool bEntireSheet, + const String* pPrint, + const String* pRepCol, const String* pRepRow, + sal_Bool bAddPrint ); + + void DetectiveAddPred(); + void DetectiveDelPred(); + void DetectiveAddSucc(); + void DetectiveDelSucc(); + void DetectiveAddError(); + void DetectiveMarkInvalid(); + void DetectiveDelAll(); + void DetectiveRefresh(); + void DetectiveMarkPred(); + void DetectiveMarkSucc(); + + void InsertCurrentTime(short nCellFmt, const ::rtl::OUString& rUndoStr); + + void ShowNote( bool bShow = true ); + inline void HideNote() { ShowNote( false ); } + void EditNote(); + + void ForgetFormatArea() { bFormatValid = false; } + sal_Bool SelectionEditable( sal_Bool* pOnlyNotBecauseOfMatrix = NULL ); + + // Amelia Wang + SC_DLLPUBLIC void DataFormPutData( SCROW nCurrentRow , + SCROW nStartRow , SCCOL nStartCol , + SCROW nEndRow , SCCOL nEndCol , + Edit** pEdits , + sal_uInt16 aColLength ); + + // interne Hilfsfunktionen +protected: + void UpdateLineAttrs( ::editeng::SvxBorderLine& rLine, + const ::editeng::SvxBorderLine* pDestLine, + const ::editeng::SvxBorderLine* pSrcLine, + sal_Bool bColor ); + + +private: + void PasteRTF( SCCOL nCol, SCROW nStartRow, + const ::com::sun::star::uno::Reference< + ::com::sun::star::datatransfer::XTransferable >& rxTransferable ); + bool PasteMultiRangesFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, sal_uInt16 nFunction, + bool bSkipEmpty, bool bTranspos, bool bAsLink, bool bAllowDialogs, + InsCellCmd eMoveMode, sal_uInt16 nCondFlags, sal_uInt16 nUndoFlags ); + void PostPasteFromClip(const ScRange& rPasteRange, const ScMarkData& rMark); + + sal_uInt16 GetOptimalColWidth( SCCOL nCol, SCTAB nTab, sal_Bool bFormula ); + + void StartFormatArea(); + sal_Bool TestFormatArea( SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bAttrChanged ); + void DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab, + sal_Bool bAttrChanged, sal_Bool bAddUndo ); + + void MarkAndJumpToRanges(const ScRangeList& rRanges); +}; + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx new file mode 100644 index 000000000000..d01faeae35ff --- /dev/null +++ b/sc/source/ui/inc/viewutil.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef SC_VIEWUTIL_HXX +#define SC_VIEWUTIL_HXX + +#include "address.hxx" +#include <tools/solar.h> +#include <sal/types.h> + +class String; +class SfxItemSet; +class SfxBindings; +class SvxFontItem; +class SfxViewShell; +class SfxViewFrame; + +class ScChangeAction; +class ScChangeViewSettings; +class ScDocument; +class ScAddress; +class ScRange; +class ScMarkData; + +enum ScUpdateMode { SC_UPDATE_ALL, SC_UPDATE_CHANGED, SC_UPDATE_MARKS }; + +// --------------------------------------------------------------------------- + +class ScViewUtil // static Methoden +{ +public: + static sal_Bool ExecuteCharMap( const SvxFontItem& rOldFont, + SfxViewFrame& rFrame, + SvxFontItem& rNewFont, + String& rString ); + + static sal_Bool IsActionShown( const ScChangeAction& rAction, + const ScChangeViewSettings& rSettings, + ScDocument& rDocument ); + + static void PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSet, + sal_uInt16 nWhichId, sal_uInt16 nScript ); + + static sal_uInt16 GetEffLanguage( ScDocument* pDoc, const ScAddress& rPos ); + + static sal_Int32 GetTransliterationType( sal_uInt16 nSlotID ); + + static bool HasFiltered( const ScRange& rRange, ScDocument* pDoc ); + /** Fit a range to cover nRows number of unfiltered rows. + @return <TRUE/> if the resulting range covers nRows unfiltered rows. */ + static bool FitToUnfilteredRows( ScRange & rRange, ScDocument * pDoc, size_t nRows ); + static void UnmarkFiltered( ScMarkData& rMark, ScDocument* pDoc ); + + static void HideDisabledSlot( SfxItemSet& rSet, SfxBindings& rBindings, sal_uInt16 nSlotId ); + + /** Returns true, if the passed view shell is in full screen mode. */ + static bool IsFullScreen( SfxViewShell& rViewShell ); + /** Enters or leaves full screen mode at the passed view shell. */ + static void SetFullScreen( SfxViewShell& rViewShell, bool bSet ); +}; + +// --------------------------------------------------------------------------- + +class ScUpdateRect +{ +private: + SCCOL nOldStartX; + SCROW nOldStartY; + SCCOL nOldEndX; + SCROW nOldEndY; + SCCOL nNewStartX; + SCROW nNewStartY; + SCCOL nNewEndX; + SCROW nNewEndY; + SCCOL nContX1; + SCROW nContY1; + SCCOL nContX2; + SCROW nContY2; +public: + ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ); + void SetNew( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ); + sal_Bool GetDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ); +}; + + + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/warnbox.hxx b/sc/source/ui/inc/warnbox.hxx new file mode 100644 index 000000000000..e8f548f606fe --- /dev/null +++ b/sc/source/ui/inc/warnbox.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_WARNBOX_HXX +#define SC_WARNBOX_HXX + +#include <vcl/msgbox.hxx> + + +// ============================================================================ + +/** Message box with warning image and "Do not show again" checkbox. */ +class ScCbWarningBox : public WarningBox +{ +public: + /** @param rMsgStr Resource ID for the message text. + @param bDefYes true = "Yes" focused, false = "No" focused. */ + ScCbWarningBox( Window* pParent, const String& rMsgStr, bool bDefYes = true ); + + /** Opens dialog if IsDialogEnabled() returns true. + @descr If after executing the dialog the checkbox "Do not show again" is set, + the method DisableDialog() will be called. */ + virtual sal_Int16 Execute(); + + /** Called before executing the dialog. If this method returns false, the dialog will not be opened. */ + virtual bool IsDialogEnabled(); + /** Called, when dialog is exited and the option "Do not show again" is set. */ + virtual void DisableDialog(); +}; + + +// ---------------------------------------------------------------------------- + +/** Warning box for "Replace cell contents?". */ +class ScReplaceWarnBox : public ScCbWarningBox +{ +public: + ScReplaceWarnBox( Window* pParent ); + + /** Reads the configuration key "ReplaceCellsWarning". */ + virtual bool IsDialogEnabled(); + /** Sets the configuration key "ReplaceCellsWarning" to false. */ + virtual void DisableDialog(); +}; + + +// ============================================================================ + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |