xref: /aoo4110/main/svtools/inc/svtools/ehdl.hxx (revision b1cdbd2c)
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 _EHDL_HXX
25 #define _EHDL_HXX
26 
27 #ifndef __RSC
28 
29 #include "svtools/svtdllapi.h"
30 
31 #ifndef _EINF_HXX
32 #include <tools/errinf.hxx>
33 #endif
34 
35 class Window;
36 class ResMgr;
37 
38 class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext
39 {
40 public:
41 	SfxErrorContext(
42 			sal_uInt16 nCtxIdP, Window *pWin=0,
43 			sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
44 	SfxErrorContext(
45 			sal_uInt16 nCtxIdP, const String &aArg1, Window *pWin=0,
46 			sal_uInt16 nResIdP=USHRT_MAX, ResMgr *pMgrP=0);
47 	virtual sal_Bool GetString(sal_uLong nErrId, String &rStr);
48 
49 private:
50 	sal_uInt16 nCtxId;
51 	sal_uInt16 nResId;
52 	ResMgr *pMgr;
53 	String aArg1;
54 };
55 
56 class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
57 {
58 public:
59 	SfxErrorHandler(sal_uInt16 nId, sal_uLong lStart, sal_uLong lEnd, ResMgr *pMgr=0);
60 	~SfxErrorHandler();
61 
62 protected:
63 	virtual sal_Bool     GetErrorString(sal_uLong lErrId, String &, sal_uInt16&) const;
64 	virtual sal_Bool     GetMessageString(sal_uLong lErrId, String &, sal_uInt16&) const;
65 
66 private:
67 
68 	sal_uLong            lStart;
69 	sal_uLong            lEnd;
70 	sal_uInt16           nId;
71 	ResMgr          *pMgr;
72     ResMgr          *pFreeMgr;
73 
74 //#if 0 // _SOLAR__PRIVATE
75 	SVT_DLLPRIVATE sal_Bool             GetClassString(sal_uLong lErrId, String &) const;
76 //#endif
77 	virtual sal_Bool     CreateString(
78 						 const ErrorInfo *, String &, sal_uInt16 &) const;
79 };
80 
81 #endif
82 
83 #endif
84 
85