1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscflag.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
35 #include <rschash.hxx>
36 #include <rscconst.hxx>
38 /******************* R s c F l a g ***************************************/
39 class RscFlag
: public RscConst
{
42 sal_uInt32 nDfltFlags
;
44 RSCINST
CreateBasic( RSCINST
* pInst
);
46 RscFlag( Atom nId
, sal_uInt32 nTypId
);
47 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, BOOL
);
48 RSCINST
CreateClient( RSCINST
* pInst
, const RSCINST
& rDflt
,
49 BOOL bOwnClass
, Atom nConsId
);
52 virtual void SetToDefault( const RSCINST
& rInst
);
53 BOOL
IsDefault( const RSCINST
& rInst
);
54 BOOL
IsDefault( const RSCINST
& rInst
, Atom nConstId
);
56 // Ist das Flag gesetzt
57 BOOL
IsSet( const RSCINST
& rInst
, Atom nConstId
);
60 BOOL
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
61 BOOL
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
,
64 ERRTYPE
SetConst( const RSCINST
& rInst
, Atom nValueId
,
66 ERRTYPE
SetNotConst( const RSCINST
& rInst
, Atom nConstId
);
67 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
68 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
69 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
70 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
73 /******************* R s c C l i e n t ***********************************/
74 class RscClient
: public RscTop
76 RscFlag
* pRefClass
; //Klasse die als Server benutzt wird
77 Atom nConstId
; //Id des zu setzenden Wertes
79 RscClient( Atom nId
, sal_uInt32 nTypId
, RscFlag
* pClass
,
81 virtual RSCCLASS_TYPE
GetClassType() const;
82 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, BOOL
);
83 sal_uInt32
Size(){ return( pRefClass
->Size() ); };
85 // Eine Zuweisung an eine Variable
86 BOOL
IsDefault( const RSCINST
& rInst
){
87 return( pRefClass
->IsDefault( rInst
, nConstId
) );
90 BOOL
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
){
91 return pRefClass
->IsValueDefault( rInst
,
94 ERRTYPE
SetBool( const RSCINST
& rInst
, BOOL bValue
){
96 return( pRefClass
->SetConst( rInst
, nConstId
, bValue
) );
99 SetNotConst( rInst
, nConstId
) );
101 ERRTYPE
GetBool( const RSCINST
& rInst
, BOOL
* pB
){
102 *pB
= pRefClass
->IsSet( rInst
, nConstId
);
105 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
106 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
109 #endif // _RSCFLAG_HXX