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 "FieldDescControl.hxx"
22 #include "TypeInfo.hxx"
23 #include <com/sun/star/uno/XComponentContext.hpp>
24 #include <com/sun/star/util/XNumberFormatter.hpp>
25 #include <vcl/InterimItemWindow.hxx>
29 // OColumnControlWindow
30 class OColumnControlWindow
: public OFieldDescControl
32 css::lang::Locale m_aLocale
;
33 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
34 css::uno::Reference
< css::sdbc::XConnection
> m_xConnection
;
35 mutable css::uno::Reference
< css::util::XNumberFormatter
> m_xFormatter
; // a number formatter working with the connection's NumberFormatsSupplier
37 OTypeInfoMap m_aDestTypeInfo
;
38 std::vector
<OTypeInfoMap::iterator
> m_aDestTypeInfoIndex
;
40 mutable TOTypeInfoSP m_pTypeInfo
; // default type
41 OUString m_sTypeNames
; // these type names are the ones out of the resource file
42 OUString m_sAutoIncrementValue
;
43 bool m_bAutoIncrementEnabled
;
45 virtual void ActivateAggregate( EControlType eType
) override
;
46 virtual void DeactivateAggregate( EControlType eType
) override
;
48 virtual css::lang::Locale
GetLocale() const override
;
49 virtual css::uno::Reference
< css::util::XNumberFormatter
> GetFormatter() const override
;
50 virtual TOTypeInfoSP
getTypeInfo(sal_Int32 _nPos
) override
;
51 virtual bool isAutoIncrementValueEnabled() const override
;
52 virtual OUString
getAutoIncrementValue() const override
;
53 virtual void CellModified(sal_Int32 nRow
, sal_uInt16 nColId
) override
;
56 OColumnControlWindow(weld::Container
* pParent
,
57 const css::uno::Reference
< css::uno::XComponentContext
>& _rxContext
);
59 void setConnection(const css::uno::Reference
< css::sdbc::XConnection
>& _xCon
);
61 virtual css::uno::Reference
< css::sdbc::XDatabaseMetaData
> getMetaData() override
;
62 virtual css::uno::Reference
< css::sdbc::XConnection
> getConnection() override
;
63 virtual const OTypeInfoMap
* getTypeInfo() const override
;
64 TOTypeInfoSP
const & getDefaultTyp() const;
67 class OColumnControlTopLevel final
: public InterimItemWindow
69 std::unique_ptr
<OColumnControlWindow
> m_xControl
;
71 OColumnControlTopLevel(vcl::Window
* pParent
,
72 const css::uno::Reference
< css::uno::XComponentContext
>& _rxContext
);
73 virtual void dispose() override
;
75 OColumnControlWindow
& GetControl() { return *m_xControl
; }
77 virtual void GetFocus() override
;
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */