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 SW_TRACER_HXX 25 #define SW_TRACER_HXX 26 27 #include <rtl/ustring.hxx> //rtl::OUString 28 29 class MSFilterTracer; 30 class SfxMedium; 31 32 namespace sw 33 { 34 namespace log 35 { 36 37 enum Problem 38 { 39 ePrinterMetrics = 1, 40 eExtraLeading, 41 eTabStopDistance, 42 eDontUseHTMLAutoSpacing, 43 eAutoWidthFrame, 44 eRowCanSplit, 45 eSpacingBetweenCells, 46 eTabInNumbering, 47 eNegativeVertPlacement, 48 eAutoColorBg, 49 eTooWideAsChar, 50 eAnimatedText, 51 eDontAddSpaceForEqualStyles, 52 eBorderDistOutside, 53 eContainsVisualBasic, 54 eContainsWordBasic 55 }; 56 57 enum Environment 58 { 59 eDocumentProperties, 60 eMacros, 61 eMainText, 62 eSubDoc, 63 eTable 64 }; 65 66 class Tracer 67 { 68 private: 69 MSFilterTracer *mpTrace; 70 rtl::OUString GetContext(Environment eContext) const; 71 rtl::OUString GetDetails(Environment eContext) const; 72 public: 73 Tracer(const SfxMedium &rMedium); GetTrace() const74 MSFilterTracer *GetTrace() const { return mpTrace; } 75 void EnterEnvironment(Environment eContext); 76 void EnterEnvironment(Environment eContext, 77 const rtl::OUString &rDetails); 78 void Log(Problem eProblem); 79 void LeaveEnvironment(Environment eContext); 80 ~Tracer(); 81 }; 82 } 83 } 84 #endif 85 86 /* vim: set noet sw=4 ts=4: */ 87