xref: /aoo42x/main/rsc/inc/rscstr.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 _RSCSTR_HXX
28 #define _RSCSTR_HXX
29 
30 #include <rscall.h>
31 #include <rscerror.h>
32 #include <rschash.hxx>
33 #include <rsctop.hxx>
34 
35 /******************* R s c S t r i n g ***********************************/
36 class RscString : public RscTop
37 {
38     RscTop * pRefClass;
39     struct RscStringInst {
40         char *  pStr;   // Zeiger auf String
41         sal_Bool    bDflt;  // Ist Default
42         RscId   aRefId; // ReferenzName
43     };
44 	sal_uInt32	nSize;
45 public:
46                     RscString( Atom nId, sal_uInt32 nTypId );
47 	virtual RSCCLASS_TYPE   GetClassType() const;
48 
49     void            SetRefClass( RscTop * pClass )
50 	{
51                         pRefClass = pClass;
52                     };
53     RSCINST         Create( RSCINST * pInst, const RSCINST & rDfltInst, sal_Bool );
54                     // Der zulaessige Bereich wird gesetzt
55     void            Destroy( const RSCINST & rInst );
56     sal_uInt32          Size(){ return nSize; }
57 	void			SetToDefault( const RSCINST & rInst )
58 					{
59 						((RscStringInst*)rInst.pData)->bDflt = sal_True;
60 					}
61     sal_Bool            IsDefault( const RSCINST & rInst)
62 					{
63                         return( ((RscStringInst*)rInst.pData)->bDflt );
64                     };
65                     // Als Default setzen
66     sal_Bool            IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
67     ERRTYPE         SetString( const RSCINST &, const char * pStr );
68     ERRTYPE         GetString( const RSCINST &, char ** ppStr );
69     ERRTYPE         GetRef( const RSCINST & rInst, RscId * );
70     ERRTYPE         SetRef( const RSCINST & rInst, const RscId & rRefId );
71     void            WriteSrc( const RSCINST &, FILE * fOutput,
72                               RscTypCont * pTC, sal_uInt32 nTab, const char * );
73     ERRTYPE         WriteRc( const RSCINST &, RscWriteRc & aMem,
74                              RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
75 	virtual void	WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
76 									const char * );
77 };
78 
79 #endif // _RSCSTR_HXX
80