bump product version to 4.1.6.2
[LibreOffice.git] / forms / source / component / Grid.hxx
bloba5b963394571ad065afe364b5fc0c8a6d4ecb398
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include "errorbroadcaster.hxx"
21 #include "FormComponent.hxx"
22 #include "formcontrolfont.hxx"
23 #include "InterfaceContainer.hxx"
25 #include <com/sun/star/form/XGridColumnFactory.hpp>
26 #include <com/sun/star/form/XLoadable.hpp>
27 #include <com/sun/star/sdb/XRowSetSupplier.hpp>
28 #include <com/sun/star/sdb/XRowSetChangeBroadcaster.hpp>
29 #include <com/sun/star/view/XSelectionSupplier.hpp>
31 #include <comphelper/proparrhlp.hxx>
32 #include <cppuhelper/implbase7.hxx>
34 //.........................................................................
35 namespace frm
37 //.........................................................................
39 class OGridColumn;
41 //==================================================================
42 // ColumnDescription
43 //==================================================================
45 struct ColumnDescription : public ElementDescription
47 public:
48 OGridColumn* pColumn; // not owned by this instance! only to prevent duplicate XUnoTunnel usage
51 //==================================================================
52 // OGridControlModel
53 //==================================================================
54 typedef ::cppu::ImplHelper7 < ::com::sun::star::awt::XControlModel
55 , ::com::sun::star::form::XGridColumnFactory
56 , ::com::sun::star::form::XReset
57 , ::com::sun::star::view::XSelectionSupplier
58 , ::com::sun::star::sdb::XSQLErrorListener
59 , ::com::sun::star::sdb::XRowSetSupplier
60 , ::com::sun::star::sdb::XRowSetChangeBroadcaster
61 > OGridControlModel_BASE;
63 class OGridControlModel :public OControlModel
64 ,public OInterfaceContainer
65 ,public OErrorBroadcaster
66 ,public FontControlModel
67 ,public OGridControlModel_BASE
69 ::cppu::OInterfaceContainerHelper m_aSelectListeners,
70 m_aResetListeners,
71 m_aRowSetChangeListeners;
73 // [properties]
74 ::com::sun::star::uno::Any m_aRowHeight; // Zeilenhoehe
75 ::com::sun::star::uno::Any m_aTabStop;
76 ::com::sun::star::uno::Any m_aBackgroundColor;
77 ::com::sun::star::uno::Any m_aCursorColor; // transient
78 ::com::sun::star::uno::Any m_aBorderColor;
79 OUString m_aDefaultControl;
80 OUString m_sHelpText;
81 // [properties]
83 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xSelection;
85 // [properties]
86 OUString m_sHelpURL; // URL
87 sal_Int16 m_nBorder;
88 sal_Int16 m_nWritingMode;
89 sal_Int16 m_nContextWritingMode;
90 sal_Bool m_bEnableVisible : 1;
91 sal_Bool m_bEnable : 1;
92 sal_Bool m_bNavigation : 1;
93 sal_Bool m_bRecordMarker : 1;
94 sal_Bool m_bPrintable : 1;
95 sal_Bool m_bAlwaysShowCursor : 1; // transient
96 sal_Bool m_bDisplaySynchron : 1; // transient
97 // [properties]
99 protected:
100 void _reset();
102 public:
103 DECLARE_DEFAULT_LEAF_XTOR( OGridControlModel );
105 // UNO Anbindung
106 DECLARE_UNO3_AGG_DEFAULTS(OGridControlModel, OControlModel);
107 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException);
109 // XChild
110 virtual void SAL_CALL setParent(const InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
112 // XServiceInfo
113 IMPLEMENTATION_NAME(OGridControlModel);
114 virtual StringSequence SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
116 // XTypeProvider
117 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
119 // OComponentHelper
120 virtual void SAL_CALL disposing();
122 // XEventListener
123 virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException);
125 // XReset
126 virtual void SAL_CALL reset() throw ( ::com::sun::star::uno::RuntimeException);
127 virtual void SAL_CALL addResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException);
128 virtual void SAL_CALL removeResetListener(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XResetListener>& _rxListener) throw ( ::com::sun::star::uno::RuntimeException);
130 // XSelectionSupplier
131 virtual sal_Bool SAL_CALL select(const ::com::sun::star::uno::Any& aElement) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
132 virtual ::com::sun::star::uno::Any SAL_CALL getSelection() throw(::com::sun::star::uno::RuntimeException);
133 virtual void SAL_CALL addSelectionChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener) throw(::com::sun::star::uno::RuntimeException);
134 virtual void SAL_CALL removeSelectionChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::view::XSelectionChangeListener >& xListener) throw(::com::sun::star::uno::RuntimeException);
136 // XGridColumnFactory
137 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> SAL_CALL createColumn(const OUString& ColumnType) throw ( :: com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
138 virtual StringSequence SAL_CALL getColumnTypes() throw ( ::com::sun::star::uno::RuntimeException);
140 // XPersistObject
141 virtual OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException);
142 virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
143 virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
145 // XPropertySet
146 virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
147 virtual sal_Bool SAL_CALL convertFastPropertyValue(::com::sun::star::uno::Any& rConvertedValue, ::com::sun::star::uno::Any& rOldValue,
148 sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
149 throw(::com::sun::star::lang::IllegalArgumentException);
150 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue) throw ( ::com::sun::star::uno::Exception);
152 // XPropertyState
153 virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle( sal_Int32 nHandle ) const;
155 // XSQLErrorListener
156 virtual void SAL_CALL errorOccured( const ::com::sun::star::sdb::SQLErrorEvent& _rEvent ) throw (::com::sun::star::uno::RuntimeException);
158 // XRowSetSupplier
159 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > SAL_CALL getRowSet( ) throw (::com::sun::star::uno::RuntimeException);
160 virtual void SAL_CALL setRowSet( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xDataSource ) throw (::com::sun::star::uno::RuntimeException);
162 // XRowSetChangeBroadcaster
163 virtual void SAL_CALL addRowSetChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetChangeListener >& i_Listener ) throw (::com::sun::star::uno::RuntimeException);
164 virtual void SAL_CALL removeRowSetChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XRowSetChangeListener >& i_Listener ) throw (::com::sun::star::uno::RuntimeException);
166 // OControlModel's property handling
167 virtual void describeFixedProperties(
168 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
169 ) const;
171 // prevent method hiding
172 using OControlModel::disposing;
173 using OControlModel::getFastPropertyValue;
175 protected:
176 DECLARE_XCLONEABLE();
178 protected:
179 virtual void approveNewElement(
180 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject,
181 ElementDescription* _pElement
184 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> createColumn(sal_Int32 nTypeId) const;
186 OGridColumn* getColumnImplementation(const InterfaceRef& _rxIFace) const;
188 virtual ElementDescription* createElementMetaData( );
190 protected:
191 virtual void implRemoved(const InterfaceRef& _rxObject);
192 virtual void implInserted( const ElementDescription* _pElement );
193 virtual void impl_replacedElement(
194 const ::com::sun::star::container::ContainerEvent& _rEvent,
195 ::osl::ClearableMutexGuard& _rInstanceLock
198 void gotColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxColumn);
199 void lostColumn(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxColumn);
201 void cloneColumns( const OGridControlModel* _pOriginalContainer );
204 //.........................................................................
205 } // namespace frm
206 //.........................................................................
209 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */