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 .
24 #include <rschash.hxx>
25 #include <rscconst.hxx>
27 /******************* R s c F l a g ***************************************/
28 class RscFlag
: public RscConst
{
31 sal_uInt32 nDfltFlags
;
33 RSCINST
CreateBasic( RSCINST
* pInst
);
35 RscFlag( Atom nId
, sal_uInt32 nTypId
);
36 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, sal_Bool
);
37 RSCINST
CreateClient( RSCINST
* pInst
, const RSCINST
& rDflt
,
38 sal_Bool bOwnClass
, Atom nConsId
);
41 virtual void SetToDefault( const RSCINST
& rInst
);
42 sal_Bool
IsDefault( const RSCINST
& rInst
);
43 sal_Bool
IsDefault( const RSCINST
& rInst
, Atom nConstId
);
45 // Ist das Flag gesetzt
46 sal_Bool
IsSet( const RSCINST
& rInst
, Atom nConstId
);
49 sal_Bool
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
50 sal_Bool
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
,
53 ERRTYPE
SetConst( const RSCINST
& rInst
, Atom nValueId
,
55 ERRTYPE
SetNotConst( const RSCINST
& rInst
, Atom nConstId
);
56 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
57 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
58 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
59 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
62 /******************* R s c C l i e n t ***********************************/
63 class RscClient
: public RscTop
65 RscFlag
* pRefClass
; //Klasse die als Server benutzt wird
66 Atom nConstId
; //Id des zu setzenden Wertes
68 RscClient( Atom nId
, sal_uInt32 nTypId
, RscFlag
* pClass
,
70 virtual RSCCLASS_TYPE
GetClassType() const;
71 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, sal_Bool
);
72 sal_uInt32
Size(){ return( pRefClass
->Size() ); };
74 // Eine Zuweisung an eine Variable
75 sal_Bool
IsDefault( const RSCINST
& rInst
){
76 return( pRefClass
->IsDefault( rInst
, nConstId
) );
79 sal_Bool
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
){
80 return pRefClass
->IsValueDefault( rInst
,
83 ERRTYPE
SetBool( const RSCINST
& rInst
, sal_Bool bValue
){
85 return( pRefClass
->SetConst( rInst
, nConstId
, bValue
) );
88 SetNotConst( rInst
, nConstId
) );
90 ERRTYPE
GetBool( const RSCINST
& rInst
, sal_Bool
* pB
){
91 *pB
= pRefClass
->IsSet( rInst
, nConstId
);
94 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
95 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
98 #endif // _RSCFLAG_HXX
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */