xref: /aoo41x/main/rsc/inc/rscmgr.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _RSCMGR_HXX
28 #define _RSCMGR_HXX
29 
30 #include <rscall.h>
31 #include <rscerror.h>
32 #include <rschash.hxx>
33 #include <rsctop.hxx>
34 #include <rscclass.hxx>
35 
36 /******************* R s c M g r *****************************************/
37 class RscMgr : public RscClass {
38     struct RscMgrInst {
39         RscId   aRefId; // nRefId = Referenz Identifier
40         sal_Bool    bDflt;  // Ist Default
41         void Create(){ aRefId.Create(); bDflt = sal_True; }
42         void Destroy(){ aRefId.Destroy(); }
43     };
44 	ERRTYPE			IsToDeep( const RSCINST & rInst, sal_uInt32 nDeep = 0 );
45 public:
46                     RscMgr( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
47 
48 	void			SetToDefault( const RSCINST & rInst );
49     sal_Bool            IsDefault( const RSCINST & rInst );
50     sal_Bool            IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
51 
52     RSCINST         Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
53     void            Destroy( const RSCINST & rInst );
54     sal_uInt32          Size();
55     void            WriteSrcHeader( const RSCINST & aInst, FILE * fOutput,
56                             RscTypCont * pTC, sal_uInt32 nTab,
57 							const RscId & rId, const char * );
58 
59     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
60                               RscTypCont * pTC, sal_uInt32 nTab, const char * );
61     ERRTYPE         WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
62                                    RscTypCont * pTC, const RscId & rId,
63                                    sal_uInt32, sal_Bool bExtra );
64     ERRTYPE         WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
65                              RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
66     ERRTYPE         WriteHxxHeader( const RSCINST & rInst, FILE * fOutput,
67                                     RscTypCont * pTC, const RscId & rId );
68     ERRTYPE         WriteHxx( const RSCINST & rInst, FILE * fOutput,
69                               RscTypCont * pTC, const RscId & rId );
70     ERRTYPE         WriteCxxHeader( const RSCINST & rInst, FILE * fOutput,
71                                     RscTypCont * pTC, const RscId & rId );
72     ERRTYPE         WriteCxx( const RSCINST & rInst, FILE * fOutput,
73                               RscTypCont * pTC, const RscId & rId );
74     sal_Bool    		IsConsistent( const RSCINST & rInst,
75                                   RscInconsList * pList = NULL );
76     ERRTYPE         GetRef( const RSCINST & rInst, RscId * );
77     ERRTYPE         SetRef( const RSCINST & rInst, const RscId & rRefId );
78 };
79 
80 #endif //_RSCMGR_HXX
81