Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef COLUMNSETTINGS_HXX
21 : #define COLUMNSETTINGS_HXX
22 :
23 : #include <com/sun/star/beans/XPropertySet.hpp>
24 :
25 : namespace dbaccess
26 : {
27 :
28 : // TODO: move the following to comphelper/propertycontainerhelper.hxx
29 1684 : class IPropertyContainer
30 : {
31 : public:
32 : virtual void registerProperty(
33 : const OUString& _rName,
34 : sal_Int32 _nHandle,
35 : sal_Int32 _nAttributes,
36 : void* _pPointerToMember,
37 : const ::com::sun::star::uno::Type& _rMemberType
38 : ) = 0;
39 :
40 : virtual void registerMayBeVoidProperty(
41 : const OUString& _rName,
42 : sal_Int32 _nHandle,
43 : sal_Int32 _nAttributes,
44 : ::com::sun::star::uno::Any* _pPointerToMember,
45 : const ::com::sun::star::uno::Type& _rExpectedType
46 : ) = 0;
47 :
48 : virtual void registerPropertyNoMember(
49 : const OUString& _rName,
50 : sal_Int32 _nHandle,
51 : sal_Int32 _nAttributes,
52 : const ::com::sun::star::uno::Type& _rType,
53 : const void* _pInitialValue
54 : ) = 0;
55 :
56 : protected:
57 1684 : ~IPropertyContainer() {}
58 : };
59 :
60 : //====================================================================
61 : //= OColumnSettings
62 : //====================================================================
63 : class OColumnSettings
64 : {
65 : // <properties>
66 : ::com::sun::star::uno::Any m_aWidth; // sal_Int32 or void
67 : ::com::sun::star::uno::Any m_aFormatKey; // sal_Int32 or void
68 : ::com::sun::star::uno::Any m_aRelativePosition; // sal_Int32 or void
69 : ::com::sun::star::uno::Any m_aAlignment; // sal_Int32 (::com::sun::star::awt::TextAlign) or void
70 : ::com::sun::star::uno::Any m_aHelpText; // the description of the column which is visible in the helptext of the column
71 : ::com::sun::star::uno::Any m_aControlDefault; // the default value which should be displayed as by a control when moving to a new row
72 : ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
73 : m_xControlModel;
74 : sal_Bool m_bHidden;
75 : // </properties>
76 :
77 : protected:
78 : virtual ~OColumnSettings();
79 :
80 : public:
81 : OColumnSettings();
82 :
83 : protected:
84 : void registerProperties( IPropertyContainer& _rPropertyContainer );
85 :
86 : /** determines whether the property with the given handle is handled by the class
87 : */
88 : static bool isColumnSettingProperty( const sal_Int32 _nPropertyHandle );
89 : static bool isDefaulted( const sal_Int32 _nPropertyHandle, const ::com::sun::star::uno::Any& _rPropertyValue );
90 :
91 : public:
92 : /** check if the persistent settings have their default value
93 : */
94 : static bool hasDefaultSettings( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn );
95 : };
96 :
97 : } // namespace dbaccess
98 :
99 : #endif // COLUMNSETTINGS_HXX
100 :
101 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|