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: sbxdec.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 ************************************************************************/
32 #ifndef __SBX_SBX_DEC_HXX
33 #define __SBX_SBX_DEC_HXX
39 #include <tools/prewin.h>
40 } // close extern "C" {
47 extern "C" { // reopen extern "C" {
48 #include <tools/postwin.h>
52 #include <basic/sbx.hxx>
54 #include <com/sun/star/bridge/oleautomation/Decimal.hpp>
58 // Implementation only for windows
62 friend void releaseDecimalPtr( SbxDecimal
*& rpDecimal
);
71 SbxDecimal( const SbxDecimal
& rDec
);
72 SbxDecimal( const com::sun::star::bridge::oleautomation::Decimal
& rAutomationDec
);
79 void fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal
& rAutomationDec
);
81 void setChar( sal_Unicode val
);
82 void setByte( BYTE val
);
83 void setShort( INT16 val
);
84 void setLong( INT32 val
);
85 void setUShort( UINT16 val
);
86 void setULong( UINT32 val
);
87 bool setSingle( float val
);
88 bool setDouble( double val
);
89 void setInt( int val
);
90 void setUInt( unsigned int val
);
91 bool setString( String
* pString
);
92 void setDecimal( SbxDecimal
* pDecimal
)
96 maDec
= pDecimal
->maDec
;
102 bool getChar( sal_Unicode
& rVal
);
103 bool getByte( BYTE
& rVal
);
104 bool getShort( INT16
& rVal
);
105 bool getLong( INT32
& rVal
);
106 bool getUShort( UINT16
& rVal
);
107 bool getULong( UINT32
& rVal
);
108 bool getSingle( float& rVal
);
109 bool getDouble( double& rVal
);
110 bool getInt( int& rVal
);
111 bool getUInt( unsigned int& rVal
);
112 bool getString( String
& rString
);
114 bool operator -= ( const SbxDecimal
&r
);
115 bool operator += ( const SbxDecimal
&r
);
116 bool operator /= ( const SbxDecimal
&r
);
117 bool operator *= ( const SbxDecimal
&r
);
122 enum CmpResult
{ LT
, EQ
, GT
};
123 friend CmpResult
compare( const SbxDecimal
&rLeft
, const SbxDecimal
&rRight
);