sync master with lastest vba changes
[ooovba.git] / reportdesign / source / core / inc / ReportControlModel.hxx
blobf0b0ff16bf9425f6ecd6b5969389791b38ad4c43
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ReportControlModel.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef RPT_REPORTCONTROLMODEL_HXX
32 #define RPT_REPORTCONTROLMODEL_HXX
34 #include "ReportComponent.hxx"
35 #include "com/sun/star/style/VerticalAlignment.hpp"
36 #include "com/sun/star/awt/FontDescriptor.hpp"
37 #include "com/sun/star/report/XFormatCondition.hpp"
38 #include "com/sun/star/container/XContainer.hpp"
39 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
40 #include <com/sun/star/lang/Locale.hpp>
41 #include <tools/color.hxx>
42 #include <comphelper/uno3.hxx>
43 #include <cppuhelper/interfacecontainer.h>
46 namespace reportdesign
48 bool operator==( const ::com::sun::star::awt::FontDescriptor& _lhs, const ::com::sun::star::awt::FontDescriptor& _rhs );
50 inline bool operator!=( const ::com::sun::star::awt::FontDescriptor& _lhs, const ::com::sun::star::awt::FontDescriptor& _rhs )
52 return !( _lhs == _rhs );
55 struct OFormatProperties
57 ::sal_Int16 nAlign;
58 ::com::sun::star::awt::FontDescriptor aFontDescriptor;
59 ::com::sun::star::awt::FontDescriptor aAsianFontDescriptor;
60 ::com::sun::star::awt::FontDescriptor aComplexFontDescriptor;
61 ::com::sun::star::lang::Locale aCharLocale;
62 ::com::sun::star::lang::Locale aCharLocaleAsian;
63 ::com::sun::star::lang::Locale aCharLocaleComplex;
64 ::sal_Int16 nFontEmphasisMark;
65 ::sal_Int16 nFontRelief;
66 ::sal_Int32 nTextColor;
67 ::sal_Int32 nTextLineColor;
68 ::sal_Int32 nCharUnderlineColor;
69 ::sal_Int32 nBackgroundColor;
70 ::rtl::OUString sCharCombinePrefix;
71 ::rtl::OUString sCharCombineSuffix;
72 ::rtl::OUString sHyperLinkURL;
73 ::rtl::OUString sHyperLinkTarget;
74 ::rtl::OUString sHyperLinkName;
75 ::rtl::OUString sVisitedCharStyleName;
76 ::rtl::OUString sUnvisitedCharStyleName;
77 short aVerticalAlignment;
78 ::sal_Int16 nCharEscapement;
79 ::sal_Int16 nCharCaseMap;
80 ::sal_Int16 nCharKerning;
81 ::sal_Int8 nCharEscapementHeight;
82 ::sal_Bool m_bBackgroundTransparent;
83 ::sal_Bool bCharFlash;
84 ::sal_Bool bCharAutoKerning;
85 ::sal_Bool bCharCombineIsOn;
86 ::sal_Bool bCharHidden;
87 ::sal_Bool bCharShadowed;
88 ::sal_Bool bCharContoured;
89 OFormatProperties();
91 class OReportControlModel
93 void checkIndex(sal_Int32 _nIndex);
94 OReportControlModel(OReportControlModel&);
95 void operator =(OReportControlModel&);
96 public:
97 ::cppu::OInterfaceContainerHelper aContainerListeners;
98 OReportComponentProperties aComponent;
99 OFormatProperties aFormatProperties;
100 ::com::sun::star::container::XContainer* m_pOwner;
101 ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::report::XFormatCondition> >
102 m_aFormatConditions;
103 osl::Mutex& m_rMutex;
104 ::rtl::OUString aDataField;
105 ::rtl::OUString aConditionalPrintExpression;
106 sal_Bool bPrintWhenGroupChange;
108 OReportControlModel(osl::Mutex& _rMutex
109 ,::com::sun::star::container::XContainer* _pOwner
110 ,::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext)
111 :aContainerListeners(_rMutex)
112 ,aComponent(_xContext)
113 ,m_pOwner(_pOwner)
114 ,m_rMutex(_rMutex)
115 ,bPrintWhenGroupChange(sal_False)
118 void dispose();
120 // XContainer
121 void addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
122 void removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
124 // XElementAccess
125 ::sal_Bool hasElements( ) throw (::com::sun::star::uno::RuntimeException);
127 // XIndexReplace
128 void replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
130 // XIndexContainer
131 void insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
132 void removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
134 // XIndexAccess
135 ::sal_Int32 getCount( ) throw (::com::sun::star::uno::RuntimeException);
136 ::com::sun::star::uno::Any getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
138 static bool isInterfaceForbidden(const ::com::sun::star::uno::Type& _rType);
141 #endif // RPT_REPORTCONTROLMODEL_HXX