1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_sheet_DataPilotFieldReferenceType_idl__
25#define __com_sun_star_sheet_DataPilotFieldReferenceType_idl__
26
27//=============================================================================
28
29module com {  module sun {  module star {  module sheet {
30
31//=============================================================================
32
33/** These constants select different types of References to calculate
34    the data fields.
35 */
36constants DataPilotFieldReferenceType
37{
38	//-------------------------------------------------------------------------
39
40	/** This type means, that the results in the data fields are displayed like they are.
41	 */
42	const long NONE = 0;
43
44	//-------------------------------------------------------------------------
45
46	/** From each result, its reference value (see below) is subtracted, and the difference is shown.
47	    Totals outside of the base field are shown as empty results.
48
49	<p><b>Named Item</b></p>
50
51	<p>If a base item name is specified, the reference value for a combination of field items is the
52	   result where the item in the base field is replaced by the specified base item.</p>
53
54	<p>If the reference value isn't shown in the DataPilot table because of hidden details for a
55	   parent field, the difference isn't calculated and an error value is shown.</p>
56
57	<p>If the result for an item combination is empty, the value 0 is used for the difference, even
58	   if the summary function is undefined without values, like average or variance. The difference
59	   is shown in the result table even if the original result was empty.</p>
60
61	<p>The difference for item combinations containing the base item is shown as empty result.</p>
62
63	<p><b>Previous or Next</b></p>
64
65	<p>If "previous" or "next" is specified as the base item, the reference value is the result for
66	   the next visible member of the base field, in the base field's sort order. If details for one
67	   item in the base field are hidden, that item is skipped. The difference for the item with
68	   hidden details isn't calculated, not even for the item's summary, to have a consistent order
69	   of previous and next items.</p>
70
71	<p>Empty results are handled as for named items (see above).<p>
72
73	<p>The difference for the first (for <TYPE>com::sun::star::sheet::DataPilotFieldReferenceItemType::PREVIOUS</TYPE>)
74	   or last (for <TYPE>com::sun::star::sheet::DataPilotFieldReferenceItemType::NEXT</TYPE>) item of the base field is
75	   shown as empty result.</p>
76	*/
77
78	const long ITEM_DIFFERENCE = 1;
79
80	//-------------------------------------------------------------------------
81
82	/** Each result is divided by its reference value. The reference value is determined in the
83	    same way as for <const scope="::com::sun::star::sheet">DataPilotFieldReferenceType::ITEM_DIFFERENCE</const>.
84	    Totals outside of the base field are shown as empty results.
85
86        <p>Division by zero results in an error. Otherwise, empty results are shown as 0. Results for
87           the base item, first (for <TYPE>com::sun::star::sheet::DataPilotFieldReferenceItemType::PREVIOUS</TYPE>)
88           or last (for <TYPE>com::sun::star::sheet::DataPilotFieldReferenceItemType::NEXT</TYPE>) item of the base field are shown
89           as 1 if not empty.</p>
90	*/
91
92    	const long ITEM_PERCENTAGE = 2;
93
94	//-------------------------------------------------------------------------
95
96	/** From each result, its reference value is subtracted, and the difference divided by the
97	    reference value. The reference value is determined in the same way as for
98	    <const scope="::com::sun::star::sheet">DataPilotFieldReferenceType::ITEM_DIFFERENCE</const>.
99	    Totals outside of the base field are shown as empty results.
100
101	<p>Division by zero results in an error. Otherwise, the rules for <const scope="::com::sun::star::sheet">DataPilotFieldReferenceType::ITEM_DIFFERENCE</const> apply.</p>
102	*/
103
104    	const long ITEM_PERCENTAGE_DIFFERENCE = 3;
105
106	//-------------------------------------------------------------------------
107
108	/** Each result is added to the sum of the results for preceding items in the base field,
109	    in the base field's sort order, and the total sum is shown.
110
111	<p>If details for one item in the base field are hidden, that item isn't included in
112	calculating the sum, and results for that item are shown as error, to ensure consistency
113	between details and subtotals for the following items.</p>
114
115	<p>Results are always summed, even if a different summary function was used to get each result.</p>
116
117	<p>Totals outside of the base field are shown as empty results.</p>
118	*/
119
120    	const long RUNNING_TOTAL = 4;
121
122	//-------------------------------------------------------------------------
123
124	/** Each result is divided by the total result for its row in the DataPilot table.
125
126	    <p>If there are several data fields, the total for the result's data field is used.</p>
127
128	    <p>If there are subtotals with manually selected summary functions, still the total with
129	    the data field's summary function is used.</p>
130
131	    <p>Division by zero results in an error.</p>
132
133	    <p>Otherwise, empty results remain empty.</p>
134	*/
135
136    	const long ROW_PERCENTAGE = 5;
137
138	//-------------------------------------------------------------------------
139
140	/** Same as <const scope="::com::sun::star::sheet">DataPilotFieldReferenceType::ROW_PERCENTAGE</const>, but the total for the result's column is used.
141	*/
142
143    	const long COLUMN_PERCENTAGE = 6;
144
145	//-------------------------------------------------------------------------
146
147	/** Same as <const scope="::com::sun::star::sheet">DataPilotFieldReferenceType::ROW_PERCENTAGE</const>, but the grand total for the result's data field is used.
148	*/
149
150    	const long TOTAL_PERCENTAGE = 7;
151
152	//-------------------------------------------------------------------------
153
154	/** The row and column totals and the grand total, following the same rules as above, are used to calculate the following expression.
155
156	<p>( original result * grand total ) / ( row total * column total )</p>
157
158	<p>Division by zero results in an error. Otherwise, empty results remain empty.</p>
159	*/
160
161    	const long INDEX = 8;
162
163
164};
165
166//=============================================================================
167
168}; }; }; };
169
170#endif
171
172