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 .
20 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTCONTROLMODEL_HXX
21 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTCONTROLMODEL_HXX
23 #include "ReportComponent.hxx"
24 #include <com/sun/star/style/VerticalAlignment.hpp>
25 #include <com/sun/star/awt/FontDescriptor.hpp>
26 #include <com/sun/star/report/XFormatCondition.hpp>
27 #include <com/sun/star/container/XContainer.hpp>
28 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
29 #include <com/sun/star/lang/Locale.hpp>
30 #include <comphelper/uno3.hxx>
31 #include <cppuhelper/interfacecontainer.h>
34 namespace reportdesign
36 bool operator==( const ::com::sun::star::awt::FontDescriptor
& _lhs
, const ::com::sun::star::awt::FontDescriptor
& _rhs
);
38 inline bool operator!=( const ::com::sun::star::awt::FontDescriptor
& _lhs
, const ::com::sun::star::awt::FontDescriptor
& _rhs
)
40 return !( _lhs
== _rhs
);
43 struct OFormatProperties
46 ::com::sun::star::awt::FontDescriptor aFontDescriptor
;
47 ::com::sun::star::awt::FontDescriptor aAsianFontDescriptor
;
48 ::com::sun::star::awt::FontDescriptor aComplexFontDescriptor
;
49 ::com::sun::star::lang::Locale aCharLocale
;
50 ::com::sun::star::lang::Locale aCharLocaleAsian
;
51 ::com::sun::star::lang::Locale aCharLocaleComplex
;
52 ::sal_Int16 nFontEmphasisMark
;
53 ::sal_Int16 nFontRelief
;
54 ::sal_Int32 nTextColor
;
55 ::sal_Int32 nTextLineColor
;
56 ::sal_Int32 nCharUnderlineColor
;
57 ::sal_Int32 nBackgroundColor
;
58 OUString sCharCombinePrefix
;
59 OUString sCharCombineSuffix
;
60 OUString sHyperLinkURL
;
61 OUString sHyperLinkTarget
;
62 OUString sHyperLinkName
;
63 OUString sVisitedCharStyleName
;
64 OUString sUnvisitedCharStyleName
;
65 com::sun::star::style::VerticalAlignment aVerticalAlignment
;
66 ::sal_Int16 nCharEscapement
;
67 ::sal_Int16 nCharCaseMap
;
68 ::sal_Int16 nCharKerning
;
69 ::sal_Int8 nCharEscapementHeight
;
70 bool m_bBackgroundTransparent
;
72 bool bCharAutoKerning
;
73 bool bCharCombineIsOn
;
79 class OReportControlModel
81 void checkIndex(sal_Int32 _nIndex
);
82 OReportControlModel(OReportControlModel
&) SAL_DELETED_FUNCTION
;
83 void operator =(OReportControlModel
&) SAL_DELETED_FUNCTION
;
85 ::cppu::OInterfaceContainerHelper aContainerListeners
;
86 OReportComponentProperties aComponent
;
87 OFormatProperties aFormatProperties
;
88 ::com::sun::star::container::XContainer
* m_pOwner
;
89 ::std::vector
< ::com::sun::star::uno::Reference
< ::com::sun::star::report::XFormatCondition
> >
93 OUString aConditionalPrintExpression
;
94 bool bPrintWhenGroupChange
;
96 OReportControlModel(osl::Mutex
& _rMutex
97 ,::com::sun::star::container::XContainer
* _pOwner
98 ,::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & _xContext
)
99 :aContainerListeners(_rMutex
)
100 ,aComponent(_xContext
)
103 ,bPrintWhenGroupChange(true)
107 void addContainerListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
108 void removeContainerListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
111 bool hasElements( ) throw (::com::sun::star::uno::RuntimeException
);
114 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
);
117 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
);
118 void removeByIndex( ::sal_Int32 Index
) throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
121 ::sal_Int32
getCount( ) throw (::com::sun::star::uno::RuntimeException
);
122 ::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
);
124 static bool isInterfaceForbidden(const ::com::sun::star::uno::Type
& _rType
);
127 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTCONTROLMODEL_HXX
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */