1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dpsave.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #ifndef _STRING_HXX //autogen
35 #include <tools/string.hxx>
38 #ifndef _LIST_HXX //autogen wg. List
39 #include <tools/list.hxx>
42 #ifndef _COM_SUN_STAR_SHEET_XDIMENSIONSSUPPLIER_HPP_
43 #include <com/sun/star/sheet/XDimensionsSupplier.hpp>
48 // --------------------------------------------------------------------
50 // classes to save Data Pilot settings
60 USHORT nShowDetailsMode
;
63 ScDPSaveMember(const String
& rName
);
64 ScDPSaveMember(const ScDPSaveMember
& r
);
65 ScDPSaveMember(SvStream
& rStream
);
68 BOOL
operator== ( const ScDPSaveMember
& r
) const;
70 const String
& GetName() { return aName
; }
71 void SetIsVisible(BOOL bSet
);
72 BOOL
GetIsVisible() { return BOOL(nVisibleMode
); }
73 void SetShowDetails(BOOL bSet
);
74 BOOL
GetShowDetails() { return BOOL(nShowDetailsMode
); }
76 void WriteToSource( const ::com::sun::star::uno::Reference
<
77 ::com::sun::star::uno::XInterface
>& xMember
);
79 void Store( SvStream
& rStream
) const;
83 class ScDPSaveDimension
87 String
* pLayoutName
; // alternative name for layout, not used (yet)
91 USHORT nFunction
; // enum GeneralFunction, for data dimensions
93 USHORT nShowEmptyMode
; //! at level
94 BOOL bSubTotalDefault
; //! at level
96 USHORT
* pSubTotalFuncs
; // enum GeneralFunction
100 ScDPSaveDimension(const String
& rName
, BOOL bDataLayout
);
101 ScDPSaveDimension(const ScDPSaveDimension
& r
);
102 ScDPSaveDimension(SvStream
& rStream
);
103 ~ScDPSaveDimension();
105 BOOL
operator== ( const ScDPSaveDimension
& r
) const;
107 const List
& GetMembers() { return aMemberList
; }
108 void AddMember(ScDPSaveMember
* pMember
) { aMemberList
.Insert(pMember
, LIST_APPEND
); };
110 void SetDupFlag(BOOL bSet
) { bDupFlag
= bSet
; }
111 BOOL
GetDupFlag() const { return bDupFlag
; }
113 const String
& GetName() const { return aName
; }
114 BOOL
IsDataLayout() const { return bIsDataLayout
; }
116 void SetOrientation(USHORT nNew
);
117 void SetSubTotals(long nCount
, const USHORT
* pFuncs
);
118 long GetSubTotalsCount() { return nSubTotalCount
; }
119 USHORT
GetSubTotalFunc(long nIndex
) { return pSubTotalFuncs
[nIndex
]; }
120 void SetShowEmpty(BOOL bSet
);
121 BOOL
GetShowEmpty() { return BOOL(nShowEmptyMode
); }
122 void SetFunction(USHORT nNew
); // enum GeneralFunction
123 USHORT
GetFunction() { return nFunction
; }
124 void SetUsedHierarchy(long nNew
);
125 long GetUsedHierarchy() { return nUsedHierarchy
; }
126 void SetLayoutName(const String
* pName
);
127 const String
& GetLayoutName() const;
128 BOOL
HasLayoutName() const;
129 void ResetLayoutName();
131 USHORT
GetOrientation() const { return nOrientation
; }
134 void WriteToSource( const ::com::sun::star::uno::Reference
<
135 ::com::sun::star::uno::XInterface
>& xDim
);
137 void Store( SvStream
& rStream
) const;
145 USHORT nColumnGrandMode
;
146 USHORT nRowGrandMode
;
147 USHORT nIgnoreEmptyMode
;
148 USHORT nRepeatEmptyMode
;
152 ScDPSaveData(const ScDPSaveData
& r
);
155 ScDPSaveData
& operator= ( const ScDPSaveData
& r
);
157 BOOL
operator== ( const ScDPSaveData
& r
) const;
159 const List
& GetDimensions() const { return aDimList
; }
160 void AddDimension(ScDPSaveDimension
* pDim
) { aDimList
.Insert(pDim
, LIST_APPEND
); }
162 ScDPSaveDimension
* GetDimensionByName(const String
& rName
);
163 ScDPSaveDimension
* GetDataLayoutDimension();
165 ScDPSaveDimension
* DuplicateDimension(const String
& rName
);
167 ScDPSaveDimension
* GetExistingDimensionByName(const String
& rName
);
169 void SetColumnGrand( BOOL bSet
);
170 BOOL
GetColumnGrand() const { return BOOL(nColumnGrandMode
); }
171 void SetRowGrand( BOOL bSet
);
172 BOOL
GetRowGrand() const { return BOOL(nRowGrandMode
); }
173 void SetIgnoreEmptyRows( BOOL bSet
);
174 BOOL
GetIgnoreEmptyRows() const { return BOOL(nIgnoreEmptyMode
); }
175 void SetRepeatIfEmpty( BOOL bSet
);
176 BOOL
GetRepeatIfEmpty() const { return BOOL(nRepeatEmptyMode
); }
178 void WriteToSource( const ::com::sun::star::uno::Reference
<
179 ::com::sun::star::sheet::XDimensionsSupplier
>& xSource
);
181 void Store( SvStream
& rStream
) const;
182 void Load( SvStream
& rStream
);
187 } //namespace binfilter