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