fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / rsc / inc / rscflag.hxx
blob981272a9422fe3c3b7df29023675f873b5c5c667
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 _RSCFLAG_HXX
20 #define _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 {
29 struct RscFlagInst{
30 sal_uInt32 nFlags;
31 sal_uInt32 nDfltFlags;
33 RSCINST CreateBasic( RSCINST * pInst );
34 public:
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 );
39 sal_uInt32 Size();
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 );
48 // Als Default setzen
49 sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
50 sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef,
51 Atom nConstId );
53 ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
54 sal_Int32 nValue );
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
67 public:
68 RscClient( Atom nId, sal_uInt32 nTypId, RscFlag * pClass,
69 Atom nConstantId );
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 ) );
78 // Als Default setzen
79 sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){
80 return pRefClass->IsValueDefault( rInst,
81 pDef, nConstId );
83 ERRTYPE SetBool( const RSCINST & rInst, sal_Bool bValue ){
84 if( bValue )
85 return( pRefClass->SetConst( rInst, nConstId, bValue ) );
86 else
87 return( pRefClass->
88 SetNotConst( rInst, nConstId ) );
90 ERRTYPE GetBool( const RSCINST & rInst, sal_Bool * pB ){
91 *pB = pRefClass->IsSet( rInst, nConstId );
92 return( ERR_OK );
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: */