Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_RSC_INC_RSCSTR_HXX
20 : #define INCLUDED_RSC_INC_RSCSTR_HXX
21 :
22 : #include <rscall.h>
23 : #include <rscerror.h>
24 : #include <rschash.hxx>
25 : #include <rsctop.hxx>
26 :
27 834 : class RscString : public RscTop
28 : {
29 : RscTop * pRefClass;
30 : struct RscStringInst
31 : {
32 : char * pStr; // Zeiger auf String
33 : bool bDflt; // Ist Default
34 : RscId aRefId; // ReferenzName
35 : };
36 : sal_uInt32 nSize;
37 : public:
38 : RscString( Atom nId, sal_uInt32 nTypId );
39 : virtual RSCCLASS_TYPE GetClassType() const SAL_OVERRIDE;
40 :
41 417 : void SetRefClass( RscTop * pClass ) { pRefClass = pClass; }
42 : RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, bool ) SAL_OVERRIDE;
43 : // Der zulaessige Bereich wird gesetzt
44 : void Destroy( const RSCINST & rInst ) SAL_OVERRIDE;
45 5004 : sal_uInt32 Size() SAL_OVERRIDE { return nSize; }
46 31009 : void SetToDefault( const RSCINST & rInst ) SAL_OVERRIDE
47 : {
48 31009 : reinterpret_cast<RscStringInst*>(rInst.pData)->bDflt = true;
49 31009 : }
50 18517 : bool IsDefault( const RSCINST & rInst) SAL_OVERRIDE
51 : {
52 18517 : return reinterpret_cast<RscStringInst*>(rInst.pData)->bDflt;
53 : }
54 : // Als Default setzen
55 : bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) SAL_OVERRIDE;
56 : ERRTYPE SetString( const RSCINST &, const char * pStr ) SAL_OVERRIDE;
57 : ERRTYPE GetString( const RSCINST &, char ** ppStr ) SAL_OVERRIDE;
58 : ERRTYPE GetRef( const RSCINST & rInst, RscId * ) SAL_OVERRIDE;
59 : ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId ) SAL_OVERRIDE;
60 : void WriteSrc( const RSCINST &, FILE * fOutput,
61 : RscTypCont * pTC, sal_uInt32 nTab, const char * ) SAL_OVERRIDE;
62 : ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
63 : RscTypCont * pTC, sal_uInt32, bool bExtra ) SAL_OVERRIDE;
64 : };
65 :
66 : #endif // INCLUDED_RSC_INC_RSCSTR_HXX
67 :
68 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|