1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_RSC_INC_RSCFLAG_HXX
20 #define INCLUDED_RSC_INC_RSCFLAG_HXX
24 #include <rschash.hxx>
25 #include <rscconst.hxx>
27 /******************* R s c F l a g ***************************************/
28 class RscFlag
: public RscConst
33 sal_uInt32 nDfltFlags
;
35 RSCINST
CreateBasic( RSCINST
* pInst
);
37 RscFlag( Atom nId
, sal_uInt32 nTypId
);
38 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, bool ) SAL_OVERRIDE
;
39 RSCINST
CreateClient( RSCINST
* pInst
, const RSCINST
& rDflt
,
40 bool bOwnClass
, Atom nConsId
);
41 sal_uInt32
Size() SAL_OVERRIDE
;
43 virtual void SetToDefault( const RSCINST
& rInst
) SAL_OVERRIDE
;
44 bool IsDefault( const RSCINST
& rInst
) SAL_OVERRIDE
;
45 bool IsDefault( const RSCINST
& rInst
, Atom nConstId
);
47 // Ist das Flag gesetzt
48 bool IsSet( const RSCINST
& rInst
, Atom nConstId
);
51 bool IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
) SAL_OVERRIDE
;
52 bool IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
,
55 ERRTYPE
SetConst( const RSCINST
& rInst
, Atom nValueId
,
56 sal_Int32 nValue
) SAL_OVERRIDE
;
57 ERRTYPE
SetNotConst( const RSCINST
& rInst
, Atom nConstId
) SAL_OVERRIDE
;
58 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
59 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * ) SAL_OVERRIDE
;
60 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
61 RscTypCont
* pTC
, sal_uInt32
, bool bExtra
) SAL_OVERRIDE
;
64 /******************* R s c C l i e n t ***********************************/
65 class RscClient
: public RscTop
67 RscFlag
* pRefClass
; //Klasse die als Server benutzt wird
68 Atom nConstId
; //Id des zu setzenden Wertes
70 RscClient( Atom nId
, sal_uInt32 nTypId
, RscFlag
* pClass
,
72 virtual RSCCLASS_TYPE
GetClassType() const SAL_OVERRIDE
;
73 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, bool ) SAL_OVERRIDE
;
74 sal_uInt32
Size() SAL_OVERRIDE
{ return pRefClass
->Size(); }
76 // Eine Zuweisung an eine Variable
77 bool IsDefault( const RSCINST
& rInst
) SAL_OVERRIDE
{
78 return pRefClass
->IsDefault( rInst
, nConstId
);
81 bool IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
) SAL_OVERRIDE
83 return pRefClass
->IsValueDefault( rInst
,
86 ERRTYPE
SetBool( const RSCINST
& rInst
, bool bValue
) SAL_OVERRIDE
89 return pRefClass
->SetConst( rInst
, nConstId
, sal_Int32(bValue
) );
91 return pRefClass
->SetNotConst( rInst
, nConstId
);
93 ERRTYPE
GetBool( const RSCINST
& rInst
, bool * pB
) SAL_OVERRIDE
95 *pB
= pRefClass
->IsSet( rInst
, nConstId
);
98 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
99 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * ) SAL_OVERRIDE
;
102 #endif // INCLUDED_RSC_INC_RSCFLAG_HXX
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */