xref: /aoo42x/main/rsc/inc/rscmgr.hxx (revision f7c60c9c)
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 _RSCMGR_HXX
24 #define _RSCMGR_HXX
25 
26 #include <rscall.h>
27 #include <rscerror.h>
28 #include <rschash.hxx>
29 #include <rsctop.hxx>
30 #include <rscclass.hxx>
31 
32 /******************* R s c M g r *****************************************/
33 class RscMgr : public RscClass {
34     struct RscMgrInst {
35         RscId   aRefId; // nRefId = Referenz Identifier
36         sal_Bool    bDflt;  // Ist Default
CreateRscMgr::RscMgrInst37         void Create(){ aRefId.Create(); bDflt = sal_True; }
DestroyRscMgr::RscMgrInst38         void Destroy(){ aRefId.Destroy(); }
39     };
40 	ERRTYPE			IsToDeep( const RSCINST & rInst, sal_uInt32 nDeep = 0 );
41 public:
42                     RscMgr( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
43 
44 	void			SetToDefault( const RSCINST & rInst );
45     sal_Bool            IsDefault( const RSCINST & rInst );
46     sal_Bool            IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
47 
48     RSCINST         Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
49     void            Destroy( const RSCINST & rInst );
50     sal_uInt32          Size();
51     void            WriteSrcHeader( const RSCINST & aInst, FILE * fOutput,
52                             RscTypCont * pTC, sal_uInt32 nTab,
53 							const RscId & rId, const char * );
54 
55     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
56                               RscTypCont * pTC, sal_uInt32 nTab, const char * );
57     ERRTYPE         WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
58                                    RscTypCont * pTC, const RscId & rId,
59                                    sal_uInt32, sal_Bool bExtra );
60     ERRTYPE         WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
61                              RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
62     ERRTYPE         WriteHxxHeader( const RSCINST & rInst, FILE * fOutput,
63                                     RscTypCont * pTC, const RscId & rId );
64     ERRTYPE         WriteHxx( const RSCINST & rInst, FILE * fOutput,
65                               RscTypCont * pTC, const RscId & rId );
66     ERRTYPE         WriteCxxHeader( const RSCINST & rInst, FILE * fOutput,
67                                     RscTypCont * pTC, const RscId & rId );
68     ERRTYPE         WriteCxx( const RSCINST & rInst, FILE * fOutput,
69                               RscTypCont * pTC, const RscId & rId );
70     sal_Bool    		IsConsistent( const RSCINST & rInst,
71                                   RscInconsList * pList = NULL );
72     ERRTYPE         GetRef( const RSCINST & rInst, RscId * );
73     ERRTYPE         SetRef( const RSCINST & rInst, const RscId & rRefId );
74 };
75 
76 #endif //_RSCMGR_HXX
77