1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "ColumnModel.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <stringconstants.hxx>
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_dbu_OColumnControlModel_get_implementation(
css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const& )
{
return cppu::acquire(new ::dbaui::OColumnControlModel());
}
namespace dbaui
{
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
OColumnControlModel::OColumnControlModel()
:OPropertyContainer(m_aBHelper)
,OColumnControlModel_BASE(m_aMutex)
,m_sDefaultControl(SERVICE_CONTROLDEFAULT)
,m_bEnable(true)
,m_nBorder(0)
,m_nWidth(50)
{
registerProperties();
}
OColumnControlModel::OColumnControlModel(const OColumnControlModel* _pSource)
:OPropertyContainer(m_aBHelper)
,OColumnControlModel_BASE(m_aMutex)
,m_sDefaultControl(_pSource->m_sDefaultControl)
,m_aTabStop(_pSource->m_aTabStop)
,m_bEnable(_pSource->m_bEnable)
,m_nBorder(_pSource->m_nBorder)
,m_nWidth(50)
{
registerProperties();
}
OColumnControlModel::~OColumnControlModel()
{
if ( !OColumnControlModel_BASE::rBHelper.bDisposed && !OColumnControlModel_BASE::rBHelper.bInDispose )
{
acquire();
dispose();
}
}
void OColumnControlModel::registerProperties()
{
registerProperty( PROPERTY_ACTIVE_CONNECTION, PROPERTY_ID_ACTIVE_CONNECTION, PropertyAttribute::TRANSIENT | PropertyAttribute::BOUND,
&m_xConnection, cppu::UnoType<decltype(m_xConnection)>::get() );
Any a;
a <<= m_xColumn;
registerProperty( PROPERTY_COLUMN, PROPERTY_ID_COLUMN, PropertyAttribute::TRANSIENT | PropertyAttribute::BOUND,
&m_xColumn, cppu::UnoType<decltype(m_xColumn)>::get() );
registerMayBeVoidProperty( PROPERTY_TABSTOP, PROPERTY_ID_TABSTOP, PropertyAttribute::BOUND | PropertyAttribute::MAYBEVOID,
&m_aTabStop, ::cppu::UnoType<sal_Int16>::get() );
registerProperty( PROPERTY_DEFAULTCONTROL, PROPERTY_ID_DEFAULTCONTROL, PropertyAttribute::BOUND,
&m_sDefaultControl, cppu::UnoType<decltype(m_sDefaultControl)>::get() );
registerProperty( PROPERTY_ENABLED, PROPERTY_ID_ENABLED, PropertyAttribute::BOUND,
&m_bEnable, cppu::UnoType<decltype(m_bEnable)>::get() );
registerProperty( PROPERTY_BORDER, PROPERTY_ID_BORDER, PropertyAttribute::BOUND,
&m_nBorder, cppu::UnoType<decltype(m_nBorder)>::get() );
registerProperty( PROPERTY_EDIT_WIDTH, PROPERTY_ID_EDIT_WIDTH, PropertyAttribute::BOUND,
&m_nWidth, cppu::UnoType<decltype(m_nWidth)>::get() );
}
// XCloneable
Reference< XCloneable > SAL_CALL OColumnControlModel::createClone( )
{
return new OColumnControlModel( this );
}
css::uno::Sequence<sal_Int8> OColumnControlModel::getImplementationId()
{
return css::uno::Sequence<sal_Int8>();
}
css::uno::Sequence< css::uno::Type > OColumnControlModel::getTypes()
{
return ::comphelper::concatSequences(
OColumnControlModel_BASE::getTypes( ),
OPropertyContainer::getTypes( )
);
}
IMPLEMENT_PROPERTYCONTAINER_DEFAULTS(OColumnControlModel)
OUString SAL_CALL OColumnControlModel::getImplementationName()
{
return "com.sun.star.comp.dbu.OColumnControlModel";
}
IMPLEMENT_SERVICE_INFO_SUPPORTS(OColumnControlModel)
css::uno::Sequence< OUString > SAL_CALL OColumnControlModel::getSupportedServiceNames()
{
return { "com.sun.star.awt.UnoControlModel","com.sun.star.sdb.ColumnDescriptorControlModel" };
}
IMPLEMENT_FORWARD_REFCOUNT( OColumnControlModel, OColumnControlModel_BASE )
Any SAL_CALL OColumnControlModel::queryInterface( const Type& _rType )
{
return OColumnControlModel_BASE::queryInterface( _rType );
}
// css::XAggregation
Any SAL_CALL OColumnControlModel::queryAggregation( const Type& rType )
{
Any aRet(OColumnControlModel_BASE::queryAggregation(rType));
if (!aRet.hasValue())
aRet = comphelper::OPropertyContainer::queryInterface(rType);
return aRet;
}
OUString SAL_CALL OColumnControlModel::getServiceName()
{
return OUString();
}
void OColumnControlModel::write(const Reference<XObjectOutputStream>& /*_rxOutStream*/)
{
// TODO
}
void OColumnControlModel::read(const Reference<XObjectInputStream>& /*_rxInStream*/)
{
// TODO
}
} // namespace dbaui
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|