2000-09-18 11:07:07 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: dpsave.hxx,v $
|
|
|
|
*
|
2004-08-03 06:33:42 -05:00
|
|
|
* $Revision: 1.6 $
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2004-08-03 06:33:42 -05:00
|
|
|
* last change: $Author: hr $ $Date: 2004-08-03 12:33:42 $
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (the "License"); You may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of the
|
|
|
|
* License at http://www.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef SC_DPSAVE_HXX
|
|
|
|
#define SC_DPSAVE_HXX
|
|
|
|
|
|
|
|
#ifndef _STRING_HXX //autogen
|
|
|
|
#include <tools/string.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _LIST_HXX //autogen wg. List
|
|
|
|
#include <tools/list.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_SHEET_XDIMENSIONSSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/sheet/XDimensionsSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
2004-06-04 07:55:09 -05:00
|
|
|
namespace com { namespace sun { namespace star { namespace sheet {
|
|
|
|
struct DataPilotFieldReference;
|
|
|
|
struct DataPilotFieldSortInfo;
|
|
|
|
struct DataPilotFieldAutoShowInfo;
|
|
|
|
struct DataPilotFieldLayoutInfo;
|
|
|
|
} } } }
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
class SvStream;
|
2004-08-03 06:33:42 -05:00
|
|
|
class ScDPDimensionSaveData;
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// classes to save Data Pilot settings
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
class ScDPSaveMember
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
String aName;
|
|
|
|
USHORT nVisibleMode;
|
|
|
|
USHORT nShowDetailsMode;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ScDPSaveMember(const String& rName);
|
|
|
|
ScDPSaveMember(const ScDPSaveMember& r);
|
|
|
|
ScDPSaveMember(SvStream& rStream);
|
|
|
|
~ScDPSaveMember();
|
|
|
|
|
|
|
|
BOOL operator== ( const ScDPSaveMember& r ) const;
|
|
|
|
|
2004-06-04 07:55:09 -05:00
|
|
|
const String& GetName() const { return aName; }
|
|
|
|
BOOL HasIsVisible() const;
|
2000-09-18 11:07:07 -05:00
|
|
|
void SetIsVisible(BOOL bSet);
|
2004-06-04 07:55:09 -05:00
|
|
|
BOOL GetIsVisible() const { return BOOL(nVisibleMode); }
|
|
|
|
BOOL HasShowDetails() const;
|
2000-09-18 11:07:07 -05:00
|
|
|
void SetShowDetails(BOOL bSet);
|
2004-06-04 07:55:09 -05:00
|
|
|
BOOL GetShowDetails() const { return BOOL(nShowDetailsMode); }
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-08-03 06:33:42 -05:00
|
|
|
void SetName( const String& rNew ); // used if the source member was renamed (groups)
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
void WriteToSource( const com::sun::star::uno::Reference<
|
|
|
|
com::sun::star::uno::XInterface>& xMember );
|
|
|
|
|
|
|
|
void Store( SvStream& rStream ) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ScDPSaveDimension
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
String aName;
|
|
|
|
String* pLayoutName; // alternative name for layout, not used (yet)
|
2004-04-13 06:22:28 -05:00
|
|
|
String* pSelectedPage;
|
2000-09-18 11:07:07 -05:00
|
|
|
BOOL bIsDataLayout;
|
|
|
|
BOOL bDupFlag;
|
|
|
|
USHORT nOrientation;
|
|
|
|
USHORT nFunction; // enum GeneralFunction, for data dimensions
|
|
|
|
long nUsedHierarchy;
|
|
|
|
USHORT nShowEmptyMode; //! at level
|
|
|
|
BOOL bSubTotalDefault; //! at level
|
|
|
|
long nSubTotalCount;
|
|
|
|
USHORT* pSubTotalFuncs; // enum GeneralFunction
|
2004-06-04 07:55:09 -05:00
|
|
|
::com::sun::star::sheet::DataPilotFieldReference* pReferenceValue;
|
|
|
|
::com::sun::star::sheet::DataPilotFieldSortInfo* pSortInfo; // (level)
|
|
|
|
::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pAutoShowInfo; // (level)
|
|
|
|
::com::sun::star::sheet::DataPilotFieldLayoutInfo* pLayoutInfo; // (level)
|
2000-09-18 11:07:07 -05:00
|
|
|
List aMemberList;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ScDPSaveDimension(const String& rName, BOOL bDataLayout);
|
|
|
|
ScDPSaveDimension(const ScDPSaveDimension& r);
|
|
|
|
ScDPSaveDimension(SvStream& rStream);
|
|
|
|
~ScDPSaveDimension();
|
|
|
|
|
|
|
|
BOOL operator== ( const ScDPSaveDimension& r ) const;
|
|
|
|
|
2004-06-04 07:55:09 -05:00
|
|
|
const List& GetMembers() const { return aMemberList; }
|
2000-09-18 11:07:07 -05:00
|
|
|
void AddMember(ScDPSaveMember* pMember) { aMemberList.Insert(pMember, LIST_APPEND); };
|
|
|
|
|
|
|
|
void SetDupFlag(BOOL bSet) { bDupFlag = bSet; }
|
|
|
|
BOOL GetDupFlag() const { return bDupFlag; }
|
|
|
|
|
|
|
|
const String& GetName() const { return aName; }
|
|
|
|
BOOL IsDataLayout() const { return bIsDataLayout; }
|
|
|
|
|
2004-08-03 06:33:42 -05:00
|
|
|
void SetName( const String& rNew ); // used if the source dim was renamed (groups)
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
void SetOrientation(USHORT nNew);
|
|
|
|
void SetSubTotals(BOOL bSet); // to be removed!
|
|
|
|
void SetSubTotals(long nCount, const USHORT* pFuncs);
|
2004-06-04 07:55:09 -05:00
|
|
|
long GetSubTotalsCount() const { return nSubTotalCount; }
|
|
|
|
USHORT GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; }
|
2000-09-18 11:07:07 -05:00
|
|
|
void SetShowEmpty(BOOL bSet);
|
2004-06-04 07:55:09 -05:00
|
|
|
BOOL GetShowEmpty() const { return BOOL(nShowEmptyMode); }
|
2000-09-18 11:07:07 -05:00
|
|
|
void SetFunction(USHORT nNew); // enum GeneralFunction
|
2004-06-04 07:55:09 -05:00
|
|
|
USHORT GetFunction() const { return nFunction; }
|
2000-09-18 11:07:07 -05:00
|
|
|
void SetUsedHierarchy(long nNew);
|
2004-06-04 07:55:09 -05:00
|
|
|
long GetUsedHierarchy() const { return nUsedHierarchy; }
|
2000-09-18 11:07:07 -05:00
|
|
|
void SetLayoutName(const String* pName);
|
|
|
|
const String& GetLayoutName() const;
|
2001-01-17 11:27:02 -06:00
|
|
|
BOOL HasLayoutName() const;
|
|
|
|
void ResetLayoutName();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2004-06-04 07:55:09 -05:00
|
|
|
const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const { return pReferenceValue; }
|
|
|
|
void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew);
|
|
|
|
|
|
|
|
const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const { return pSortInfo; }
|
|
|
|
void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew);
|
|
|
|
const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const { return pAutoShowInfo; }
|
|
|
|
void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew);
|
|
|
|
const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const { return pLayoutInfo; }
|
|
|
|
void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew);
|
|
|
|
|
2004-04-13 06:22:28 -05:00
|
|
|
void SetCurrentPage( const String* pPage ); // NULL = no selection (all)
|
|
|
|
BOOL HasCurrentPage() const;
|
|
|
|
const String& GetCurrentPage() const;
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
USHORT GetOrientation() const { return nOrientation; }
|
|
|
|
|
2004-04-13 06:22:28 -05:00
|
|
|
ScDPSaveMember* GetExistingMemberByName(const String& rName);
|
2000-09-18 11:07:07 -05:00
|
|
|
ScDPSaveMember* GetMemberByName(const String& rName);
|
|
|
|
|
|
|
|
void WriteToSource( const com::sun::star::uno::Reference<
|
|
|
|
com::sun::star::uno::XInterface>& xDim );
|
|
|
|
|
|
|
|
void Store( SvStream& rStream ) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ScDPSaveData
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
List aDimList;
|
2004-08-03 06:33:42 -05:00
|
|
|
ScDPDimensionSaveData* pDimensionData; // settings that create new dimensions
|
2000-09-18 11:07:07 -05:00
|
|
|
USHORT nColumnGrandMode;
|
|
|
|
USHORT nRowGrandMode;
|
|
|
|
USHORT nIgnoreEmptyMode;
|
|
|
|
USHORT nRepeatEmptyMode;
|
2004-07-23 06:51:46 -05:00
|
|
|
BOOL bFilterButton; // not passed to DataPilotSource
|
|
|
|
BOOL bDrillDown; // not passed to DataPilotSource
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
ScDPSaveData();
|
|
|
|
ScDPSaveData(const ScDPSaveData& r);
|
|
|
|
~ScDPSaveData();
|
|
|
|
|
|
|
|
ScDPSaveData& operator= ( const ScDPSaveData& r );
|
|
|
|
|
|
|
|
BOOL operator== ( const ScDPSaveData& r ) const;
|
|
|
|
|
|
|
|
const List& GetDimensions() const { return aDimList; }
|
|
|
|
void AddDimension(ScDPSaveDimension* pDim) { aDimList.Insert(pDim, LIST_APPEND); }
|
|
|
|
|
|
|
|
ScDPSaveDimension* GetDimensionByName(const String& rName);
|
|
|
|
ScDPSaveDimension* GetDataLayoutDimension();
|
|
|
|
|
|
|
|
ScDPSaveDimension* DuplicateDimension(const String& rName);
|
2004-06-04 07:55:09 -05:00
|
|
|
ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim);
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
ScDPSaveDimension* GetExistingDimensionByName(const String& rName);
|
|
|
|
ScDPSaveDimension* GetNewDimensionByName(const String& rName);
|
|
|
|
|
2004-08-03 06:33:42 -05:00
|
|
|
void RemoveDimensionByName(const String& rName);
|
|
|
|
|
2004-07-23 06:51:46 -05:00
|
|
|
ScDPSaveDimension* GetInnermostDimension(USHORT nOrientation);
|
|
|
|
long GetDataDimensionCount() const;
|
|
|
|
|
2004-08-03 06:33:42 -05:00
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
void SetPosition( ScDPSaveDimension* pDim, long nNew );
|
|
|
|
void SetColumnGrand( BOOL bSet );
|
|
|
|
BOOL GetColumnGrand() const { return BOOL(nColumnGrandMode); }
|
|
|
|
void SetRowGrand( BOOL bSet );
|
|
|
|
BOOL GetRowGrand() const { return BOOL(nRowGrandMode); }
|
|
|
|
void SetIgnoreEmptyRows( BOOL bSet );
|
|
|
|
BOOL GetIgnoreEmptyRows() const { return BOOL(nIgnoreEmptyMode); }
|
|
|
|
void SetRepeatIfEmpty( BOOL bSet );
|
|
|
|
BOOL GetRepeatIfEmpty() const { return BOOL(nRepeatEmptyMode); }
|
|
|
|
|
2004-07-23 06:51:46 -05:00
|
|
|
void SetFilterButton( BOOL bSet );
|
|
|
|
BOOL GetFilterButton() const { return bFilterButton; }
|
|
|
|
void SetDrillDown( BOOL bSet );
|
|
|
|
BOOL GetDrillDown() const { return bDrillDown; }
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
void WriteToSource( const com::sun::star::uno::Reference<
|
|
|
|
com::sun::star::sheet::XDimensionsSupplier>& xSource );
|
|
|
|
|
|
|
|
void Store( SvStream& rStream ) const;
|
|
|
|
void Load( SvStream& rStream );
|
|
|
|
|
|
|
|
BOOL IsEmpty() const;
|
2004-08-03 06:33:42 -05:00
|
|
|
|
|
|
|
const ScDPDimensionSaveData* GetExistingDimensionData() const { return pDimensionData; }
|
|
|
|
ScDPDimensionSaveData* GetDimensionData(); // create if not there
|
|
|
|
void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied
|
2000-09-18 11:07:07 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|