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 #ifndef SVX_QUERYDESIGNCONTEXT_HXX 24 #define SVX_QUERYDESIGNCONTEXT_HXX 25 26 #include "svx/svxdllapi.h" 27 #include <connectivity/IParseContext.hxx> 28 #include <tools/string.hxx> 29 #include <unotools/localedatawrapper.hxx> 30 31 32 #include <vector> 33 34 namespace svxform 35 { 36 //========================================================================== 37 //= OSystemParseContext 38 //========================================================================== 39 class SVX_DLLPUBLIC OSystemParseContext : public ::connectivity::IParseContext 40 { 41 private: 42 43 ::std::vector< String > m_aLocalizedKeywords; 44 45 public: 46 OSystemParseContext(); 47 48 virtual ~OSystemParseContext(); 49 // retrieves language specific error messages 50 virtual ::rtl::OUString getErrorMessage(ErrorCode _eCodes) const; 51 52 // retrieves language specific keyword strings (only ASCII allowed) 53 virtual ::rtl::OString getIntlKeywordAscii(InternationalKeyCode _eKey) const; 54 55 // finds out, if we have an international keyword (only ASCII allowed) 56 virtual InternationalKeyCode getIntlKeyCode(const ::rtl::OString& rToken) const; 57 58 /** get's a locale instance which should be used when parsing in the context specified by this instance 59 <p>if this is not overridden by derived classes, it returns the static default locale.</p> 60 */ 61 virtual ::com::sun::star::lang::Locale getPreferredLocale( ) const; 62 63 public: 64 // helper methods to ease access to some of the characteristics of the locale 65 sal_Unicode getNumDecimalSep( ) const; 66 sal_Unicode getNumThousandSep( ) const; 67 }; 68 69 //========================================================================== 70 //= OParseContextClient 71 //========================================================================== 72 /** helper class which needs access to a (shared and ref-counted) OSystemParseContext 73 instance. 74 */ 75 class SVX_DLLPUBLIC OParseContextClient 76 { 77 protected: 78 OParseContextClient(); 79 virtual ~OParseContextClient(); 80 81 const OSystemParseContext* getParseContext() const; 82 }; 83 } 84 #endif // SVX_QUERYDESIGNCONTEXT_HXX 85 86 87 88