diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2009-09-09 10:57:16 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2009-09-09 10:57:16 -0400 |
commit | f371fca09ddff5d5d32a0dcec05931be04b1b8c9 (patch) | |
tree | 4d144cec484c37fc76793e626087c495699e7690 /sc/source/core/inc/doubleref.hxx | |
parent | 3db13d25ca7c79cbc53ecba722453571451b96e9 (diff) |
#i102750# initial refactoring in an effort to support external references in DSUM, DGET etc. Not finished yet.
Diffstat (limited to 'sc/source/core/inc/doubleref.hxx')
-rw-r--r-- | sc/source/core/inc/doubleref.hxx | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/sc/source/core/inc/doubleref.hxx b/sc/source/core/inc/doubleref.hxx new file mode 100644 index 000000000000..d61dd35fcc6d --- /dev/null +++ b/sc/source/core/inc/doubleref.hxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * 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 + * + * $RCSfile: interpre.hxx,v $ + * $Revision: 1.35.44.2 $ + * + * 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_DOUBLEREF_HXX +#define SC_DOUBLEREF_HXX + +#include "address.hxx" + +class ScDocument; +class ScBaseCell; +class ScQueryParam; + +// ============================================================================ + +class ScDoubleRefBase +{ +public: + enum RefType { INTERNAL, EXTERNAL }; + + virtual ~ScDoubleRefBase() = 0; + + RefType getType() const; + + virtual SCCOL getFirstFieldColumn() = 0; + virtual SCCOL findFieldColumn(SCCOL nColIndex) = 0; + virtual SCCOL findFieldColumn(const ::rtl::OUString& rStr, sal_uInt16& rErr) = 0; + virtual void initQueryParam(ScQueryParam& rParam) const = 0; + virtual bool isRangeEqual(const ScRange& rRange) const = 0; + +protected: + ScDoubleRefBase(ScDocument* pDoc, RefType eType); + ScDocument* getDoc(); + +private: + ScDoubleRefBase(); // disabled + + ScDocument* mpDoc; + RefType meType; +}; + +// ============================================================================ + +class ScInternalDoubleRef : public ScDoubleRefBase +{ +public: + explicit ScInternalDoubleRef(ScDocument* pDoc, const ScRange& rRange); + virtual ~ScInternalDoubleRef(); + + const ScRange& getRange() const; + + virtual SCCOL getFirstFieldColumn(); + virtual SCCOL findFieldColumn(SCCOL nColIndex); + virtual SCCOL findFieldColumn(const ::rtl::OUString& rStr, sal_uInt16& rErr); + virtual void initQueryParam(ScQueryParam& rParam) const; + virtual bool isRangeEqual(const ScRange& rRange) const; + +private: + sal_uInt16 getCellString(String& rStr, ScBaseCell* pCell); + +private: + ScRange maRange; +}; + +// ============================================================================ + +class ScExternalDoubleRef : public ScDoubleRefBase +{ +public: + explicit ScExternalDoubleRef(ScDocument* pDoc); + virtual ~ScExternalDoubleRef(); + + virtual SCCOL getFirstFieldColumn(); + virtual SCCOL findFieldColumn(SCCOL nColIndex); + virtual SCCOL findFieldColumn(const ::rtl::OUString& rStr, sal_uInt16& rErr); + virtual void initQueryParam(ScQueryParam& rParam) const; + virtual bool isRangeEqual(const ScRange& rRange) const; +}; + +#endif |