xref: /trunk/main/sc/source/ui/inc/ScDevChart.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir #ifndef INCLUDED_DEVCHARTCONFIG_HXX
24cdf0e10cSrcweir #define INCLUDED_DEVCHARTCONFIG_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <unotools/configitem.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir namespace ScDevChart
29cdf0e10cSrcweir {
30cdf0e10cSrcweir 
31cdf0e10cSrcweir class DevChartConfigItem : public ::utl::ConfigItem
32cdf0e10cSrcweir {
33cdf0e10cSrcweir public:
DevChartConfigItem()34cdf0e10cSrcweir     DevChartConfigItem() :
35cdf0e10cSrcweir             ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Internal" )),
36cdf0e10cSrcweir                         CONFIG_MODE_IMMEDIATE_UPDATE )
37cdf0e10cSrcweir     {}
38cdf0e10cSrcweir 
39cdf0e10cSrcweir     bool UseDevelopmentChart();
40cdf0e10cSrcweir };
41cdf0e10cSrcweir 
UseDevelopmentChart()42cdf0e10cSrcweir bool DevChartConfigItem::UseDevelopmentChart()
43cdf0e10cSrcweir {
44cdf0e10cSrcweir     bool bResult = false;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames( 1 );
47cdf0e10cSrcweir     aNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DevelopmentChart" ));
48cdf0e10cSrcweir 
49cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aResult( GetProperties( aNames ));
50cdf0e10cSrcweir 
51cdf0e10cSrcweir     OSL_ASSERT( aResult.getLength());
52cdf0e10cSrcweir     aResult[0] >>= bResult;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     return bResult;
55cdf0e10cSrcweir }
56cdf0e10cSrcweir 
57cdf0e10cSrcweir /** States whether the new chart implementation or the old one should be used.
58cdf0e10cSrcweir     If <TRUE/> is returned the newly developed chart (chart2) should be used.
59cdf0e10cSrcweir     If <FALSE/> is returned, the old chart (sch) should be used.
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     Config-Item: Office.Common/Internal:DevelopmentChart
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     This function (the complete header) is only for a transitional period.  It
64cdf0e10cSrcweir     will be deprecated after the new chart is definitely integrated into the
65cdf0e10cSrcweir     product.
66cdf0e10cSrcweir  */
UseDevChart()67cdf0e10cSrcweir bool UseDevChart()
68cdf0e10cSrcweir {
69cdf0e10cSrcweir //     static DevChartConfigItem aCfgItem;
70cdf0e10cSrcweir //     return aCfgItem.UseDevelopmentChart();
71cdf0e10cSrcweir 
72cdf0e10cSrcweir     // ignore configuration
73cdf0e10cSrcweir     //@todo: get rid of this class
74cdf0e10cSrcweir     return true;
75cdf0e10cSrcweir }
76cdf0e10cSrcweir 
77cdf0e10cSrcweir } // namespace ScDevChart
78cdf0e10cSrcweir 
79cdf0e10cSrcweir // INCLUDED_DEVCHARTCONFIG_HXX
80cdf0e10cSrcweir #endif
81