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 .
21 #include <editeng/svxenum.hxx>
22 #include "TypeInfo.hxx"
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/beans/XPropertySetInfo.hpp>
28 class OFieldDescription
31 css::uno::Any m_aControlDefault
; // the value which the control inserts as default
32 css::uno::Any m_aWidth
; // sal_Int32 or void
33 css::uno::Any m_aRelativePosition
; // sal_Int32 or void
37 css::uno::Reference
< css::beans::XPropertySet
> m_xDest
;
38 css::uno::Reference
< css::beans::XPropertySetInfo
> m_xDestInfo
;
42 OUString m_sDescription
;
45 OUString m_sAutoIncrementValue
;
46 sal_Int32 m_nType
; // only used when m_pType is null
47 sal_Int32 m_nPrecision
;
49 sal_Int32 m_nIsNullable
;
50 sal_Int32 m_nFormatKey
;
51 SvxCellHorJustify m_eHorJustify
;
52 bool m_bIsAutoIncrement
;
59 OFieldDescription( const OFieldDescription
& rDescr
);
60 OFieldDescription(const css::uno::Reference
< css::beans::XPropertySet
>& _xAffectedCol
61 ,bool _bUseAsDest
= false);
64 void SetName(const OUString
& _rName
);
65 void SetDescription(const OUString
& _rDescription
);
66 void SetHelpText(const OUString
& _sHelptext
);
67 void SetDefaultValue(const css::uno::Any
& _rDefaultValue
);
68 void SetControlDefault(const css::uno::Any
& _rControlDefault
);
69 void SetAutoIncrementValue(const OUString
& _sAutoIncValue
);
70 void SetType(const TOTypeInfoSP
& _pType
);
71 void SetTypeValue(sal_Int32 _nType
);
72 void SetTypeName(const OUString
& _sTypeName
);
73 void SetPrecision(sal_Int32 _rPrecision
);
74 void SetScale(sal_Int32 _rScale
);
75 void SetIsNullable(sal_Int32 _rIsNullable
);
76 void SetFormatKey(sal_Int32 _rFormatKey
);
77 void SetHorJustify(const SvxCellHorJustify
& _rHorJustify
);
78 void SetAutoIncrement(bool _bAuto
);
79 void SetPrimaryKey(bool _bPKey
);
80 void SetCurrency(bool _bIsCurrency
);
82 /** copies the content of the field description into the column
83 @param _rxColumn the dest
85 void copyColumnSettingsTo(const css::uno::Reference
< css::beans::XPropertySet
>& _rxColumn
);
87 void FillFromTypeInfo(const TOTypeInfoSP
& _pType
,bool _bForce
,bool _bReset
);
89 OUString
GetName() const;
90 OUString
GetDescription() const;
91 OUString
GetHelpText() const;
92 css::uno::Any
GetControlDefault() const;
93 OUString
GetAutoIncrementValue() const;
94 sal_Int32
GetType() const;
95 OUString
GetTypeName() const;
96 sal_Int32
GetPrecision() const;
97 sal_Int32
GetScale() const;
98 sal_Int32
GetIsNullable() const;
99 sal_Int32
GetFormatKey() const;
100 SvxCellHorJustify
GetHorJustify() const;
101 const TOTypeInfoSP
& getTypeInfo() const { return m_pType
;}
102 TOTypeInfoSP
getSpecialTypeInfo() const;
103 bool IsAutoIncrement() const;
104 bool IsPrimaryKey() const { return m_bIsPrimaryKey
;}
105 bool IsCurrency() const { return m_bIsCurrency
;}
106 bool IsNullable() const;
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */