bump product version to 5.0.4.1
[LibreOffice.git] / rsc / inc / rscflag.hxx
blobcb10c496d705da6ad9076b0bdb536a4e810cee99
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
22 #include <rscall.h>
23 #include <rscerror.h>
24 #include <rschash.hxx>
25 #include <rscconst.hxx>
27 /******************* R s c F l a g ***************************************/
28 class RscFlag : public RscConst
30 struct RscFlagInst
32 sal_uInt32 nFlags;
33 sal_uInt32 nDfltFlags;
35 RSCINST CreateBasic( RSCINST * pInst );
36 public:
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 );
50 // Als Default setzen
51 bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) SAL_OVERRIDE;
52 bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef,
53 Atom nConstId );
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
69 public:
70 RscClient( Atom nId, sal_uInt32 nTypId, RscFlag * pClass,
71 Atom nConstantId );
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 );
80 // Als Default setzen
81 bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ) SAL_OVERRIDE
83 return pRefClass->IsValueDefault( rInst,
84 pDef, nConstId );
86 ERRTYPE SetBool( const RSCINST & rInst, bool bValue ) SAL_OVERRIDE
88 if( bValue )
89 return pRefClass->SetConst( rInst, nConstId, sal_Int32(bValue) );
90 else
91 return pRefClass->SetNotConst( rInst, nConstId );
93 ERRTYPE GetBool( const RSCINST & rInst, bool * pB ) SAL_OVERRIDE
95 *pB = pRefClass->IsSet( rInst, nConstId );
96 return ERR_OK;
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: */