update dev300-m58
[ooovba.git] / sc / source / filter / inc / xltracer.hxx
blob8c12fd84fa76d14b1ec4eab912c87462dfa626c9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xltracer.hxx,v $
10 * $Revision: 1.9.32.1 $
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 ************************************************************************/
31 // ============================================================================
33 #ifndef SC_XLTRACER_HXX
34 #define SC_XLTRACER_HXX
36 #include "global.hxx" // ScAddress
37 #include "xltools.hxx"
39 // As Trace features become implemented, we can safely delete the enum entry as
40 // we use the member mnID to keep track of the actual trace tag ID value.
41 enum XclTracerId
43 eUnKnown , /// unused but allows us to set the correct index
44 eRowLimitExceeded ,
45 eTabLimitExceeded ,
46 ePassword ,
47 ePrintRange ,
48 eShortDate ,
49 eBorderLineStyle ,
50 eFillPattern ,
51 eInvisibleGrid ,
52 eFormattedNote ,
53 eFormulaExtName ,
54 eFormulaMissingArg ,
55 ePivotDataSource ,
56 ePivotChartExists ,
57 eChartUnKnownType ,
58 eChartTrendLines ,
59 eChartErrorBars ,
60 eChartOnlySheet ,
61 eChartRange ,
62 eChartDSName,
63 eChartDataTable,
64 eChartLegendPosition,
65 eChartTextFormatting,
66 eChartEmbeddedObj,
67 eChartAxisAuto,
68 eChartAxisManual,
69 eChartInvalidXY,
70 eUnsupportedObject ,
71 eObjectNotPrintable ,
72 eDVType,
73 eTraceLength /// this *should* always be the final entry
76 struct XclTracerDetails
78 XclTracerId meProblemId; /// Excel Import Trace index.
79 sal_uInt32 mnID; /// actual ID Index trace tag Value
80 const sal_Char* mpContext; /// Context for problem e.g. Limits
81 const sal_Char* mpDetail; /// Context Detail e.g. SheetX
82 const sal_Char* mpProblem; /// Description of problem
86 // ============================================================================
88 class MSFilterTracer;
90 /** This class wraps an MSFilterTracer to create trace logs for import/export filters. */
91 class XclTracer
93 public:
94 explicit XclTracer( const String& rDocUrl, const ::rtl::OUString& rConfigPath );
95 virtual ~XclTracer();
97 /** Returns true, if tracing is enabled. */
98 inline bool IsEnabled() const { return mbEnabled; }
100 /** Adds an attribute to be traced with the next Trace() call. */
101 void AddAttribute( const ::rtl::OUString& rName, const ::rtl::OUString& rValue );
103 /** Creates an element including all attributes set up to this call.
104 @descr Removes all attributes after the element is traced. */
105 void Trace( const ::rtl::OUString& rElementID, const ::rtl::OUString& rMessage );
107 /** Calls Trace() with a known document properties problem. */
108 void TraceLog( XclTracerId eProblem, sal_Int32 nValue = 0 );
110 /** Calls AddAttribute() to create the Context & Detail for known problems. */
111 void Context( XclTracerId eProblem, SCTAB nTab = 0 );
113 /** Ensure that particular traces are logged once per document. */
114 void ProcessTraceOnce(XclTracerId eProblem, SCTAB nTab = 0);
116 void TraceInvalidAddress(const ScAddress& rPos, const ScAddress& rMaxPos);
117 void TraceInvalidRow( SCTAB nTab, sal_uInt32 nRow, sal_uInt32 nMaxrow );
118 void TraceInvalidTab( SCTAB nTab, SCTAB nMaxTab);
119 void TracePrintRange();
120 void TraceDates(sal_uInt16 nNumFmt);
121 void TraceBorderLineStyle(bool bBorderLineStyle);
122 void TraceFillPattern(bool bFillPattern);
123 void TraceFormulaMissingArg();
124 void TracePivotDataSource(bool bExternal);
125 void TracePivotChartExists();
126 void TraceChartUnKnownType();
127 void TraceChartOnlySheet();
128 void TraceChartDataTable();
129 void TraceChartLegendPosition();
130 void TraceChartEmbeddedObj();
131 void TraceUnsupportedObjects();
132 void TraceObjectNotPrintable();
133 void TraceDVType(bool bType);
135 /** Returns the SVX filter tracer for usage in external code (i.e. Escher). */
136 inline MSFilterTracer& GetBaseTracer() { return *mpTracer; }
138 private:
139 typedef ::std::auto_ptr< MSFilterTracer > MSFilterTracerPtr;
140 MSFilterTracerPtr mpTracer;
141 bool mbEnabled;
142 typedef ::std::vector< bool > BoolVec;
143 /** array of flags corresponding to each entry in the XclTracerDetails table. */
144 BoolVec maFirstTimes;
148 // ============================================================================
150 #endif