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: FieldDescriptions.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 ************************************************************************/
30 #ifndef DBAUI_FIELDDESCRIPTIONS_HXX
31 #define DBAUI_FIELDDESCRIPTIONS_HXX
33 #ifndef DBAUI_ENUMTYPES_HXX
34 #include "QEnumTypes.hxx"
36 #ifndef _SVX_SVXENUM_HXX
37 #include <svx/svxenum.hxx>
39 #ifndef DBAUI_TYPEINFO_HXX
40 #include "TypeInfo.hxx"
42 #ifndef _OSL_DIAGNOSE_H_
43 #include <osl/diagnose.h>
45 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
46 #include <com/sun/star/beans/XPropertySet.hpp>
48 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
49 #include <com/sun/star/beans/XPropertySetInfo.hpp>
54 class OFieldDescription
57 ::com::sun::star::uno::Any m_aDefaultValue
; // the default value from the database
58 ::com::sun::star::uno::Any m_aControlDefault
; // the value which the control inserts as default
59 ::com::sun::star::uno::Any m_aWidth
; // sal_Int32 or void
60 ::com::sun::star::uno::Any m_aRelativePosition
; // sal_Int32 or void
64 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> m_xDest
;
65 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> m_xDestInfo
;
67 ::rtl::OUString m_sName
;
68 ::rtl::OUString m_sTypeName
;
69 ::rtl::OUString m_sDescription
;
71 ::rtl::OUString m_sAutoIncrementValue
;
72 sal_Int32 m_nType
; // only used when m_pType is null
73 sal_Int32 m_nPrecision
;
75 sal_Int32 m_nIsNullable
;
76 sal_Int32 m_nFormatKey
;
77 SvxCellHorJustify m_eHorJustify
;
78 sal_Bool m_bIsAutoIncrement
;
79 sal_Bool m_bIsPrimaryKey
;
80 sal_Bool m_bIsCurrency
;
85 OFieldDescription( const OFieldDescription
& rDescr
);
86 OFieldDescription(const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _xAffectedCol
87 ,sal_Bool _bUseAsDest
= sal_False
);
90 void SetName(const ::rtl::OUString
& _rName
);
91 void SetDescription(const ::rtl::OUString
& _rDescription
);
92 void SetDefaultValue(const ::com::sun::star::uno::Any
& _rDefaultValue
);
93 void SetControlDefault(const ::com::sun::star::uno::Any
& _rControlDefault
);
94 void SetAutoIncrementValue(const ::rtl::OUString
& _sAutoIncValue
);
95 void SetType(TOTypeInfoSP _pType
);
96 void SetTypeValue(sal_Int32 _nType
);
97 void SetTypeName(const ::rtl::OUString
& _sTypeName
);
98 void SetPrecision(const sal_Int32
& _rPrecision
);
99 void SetScale(const sal_Int32
& _rScale
);
100 void SetIsNullable(const sal_Int32
& _rIsNullable
);
101 void SetFormatKey(const sal_Int32
& _rFormatKey
);
102 void SetHorJustify(const SvxCellHorJustify
& _rHorJustify
);
103 void SetAutoIncrement(sal_Bool _bAuto
);
104 void SetPrimaryKey(sal_Bool _bPKey
);
105 void SetCurrency(sal_Bool _bIsCurrency
);
107 /** copies the content of the field eescription into the column
108 @param _rxColumn the dest
110 void copyColumnSettingsTo(const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& _rxColumn
);
112 void FillFromTypeInfo(const TOTypeInfoSP
& _pType
,sal_Bool _bForce
,sal_Bool _bReset
);
114 ::rtl::OUString
GetName() const;
115 ::rtl::OUString
GetDescription() const;
116 ::com::sun::star::uno::Any
GetControlDefault() const;
117 ::rtl::OUString
GetAutoIncrementValue() const;
118 sal_Int32
GetType() const;
119 ::rtl::OUString
GetTypeName() const;
120 sal_Int32
GetPrecision() const;
121 sal_Int32
GetScale() const;
122 sal_Int32
GetIsNullable() const;
123 sal_Int32
GetFormatKey() const;
124 SvxCellHorJustify
GetHorJustify() const;
125 TOTypeInfoSP
getTypeInfo() const;
126 TOTypeInfoSP
getSpecialTypeInfo() const;
127 sal_Bool
IsAutoIncrement() const;
128 sal_Bool
IsPrimaryKey() const;
129 sal_Bool
IsCurrency() const;
130 sal_Bool
IsNullable() const;
133 #endif // DBAUI_FIELDDESCRIPTIONS_HXX