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 RPT_REPORTCONTROLMODEL_HXX
21 : #define RPT_REPORTCONTROLMODEL_HXX
22 :
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>
32 :
33 :
34 : namespace reportdesign
35 : {
36 : bool operator==( const ::com::sun::star::awt::FontDescriptor& _lhs, const ::com::sun::star::awt::FontDescriptor& _rhs );
37 :
38 0 : inline bool operator!=( const ::com::sun::star::awt::FontDescriptor& _lhs, const ::com::sun::star::awt::FontDescriptor& _rhs )
39 : {
40 0 : return !( _lhs == _rhs );
41 : }
42 :
43 0 : struct OFormatProperties
44 : {
45 : ::sal_Int16 nAlign;
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 : ::rtl::OUString sCharCombinePrefix;
59 : ::rtl::OUString sCharCombineSuffix;
60 : ::rtl::OUString sHyperLinkURL;
61 : ::rtl::OUString sHyperLinkTarget;
62 : ::rtl::OUString sHyperLinkName;
63 : ::rtl::OUString sVisitedCharStyleName;
64 : ::rtl::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 : ::sal_Bool m_bBackgroundTransparent;
71 : ::sal_Bool bCharFlash;
72 : ::sal_Bool bCharAutoKerning;
73 : ::sal_Bool bCharCombineIsOn;
74 : ::sal_Bool bCharHidden;
75 : ::sal_Bool bCharShadowed;
76 : ::sal_Bool bCharContoured;
77 : OFormatProperties();
78 : };
79 0 : class OReportControlModel
80 : {
81 : void checkIndex(sal_Int32 _nIndex);
82 : OReportControlModel(OReportControlModel&);
83 : void operator =(OReportControlModel&);
84 : public:
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> >
90 : m_aFormatConditions;
91 : osl::Mutex& m_rMutex;
92 : ::rtl::OUString aDataField;
93 : ::rtl::OUString aConditionalPrintExpression;
94 : sal_Bool bPrintWhenGroupChange;
95 :
96 0 : 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)
101 : ,m_pOwner(_pOwner)
102 : ,m_rMutex(_rMutex)
103 0 : ,bPrintWhenGroupChange(sal_False)
104 0 : {}
105 :
106 : // XContainer
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);
109 :
110 : // XElementAccess
111 : ::sal_Bool hasElements( ) throw (::com::sun::star::uno::RuntimeException);
112 :
113 : // XIndexReplace
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);
115 :
116 : // XIndexContainer
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);
119 :
120 : // XIndexAccess
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);
123 :
124 : static bool isInterfaceForbidden(const ::com::sun::star::uno::Type& _rType);
125 : };
126 : }
127 : #endif // RPT_REPORTCONTROLMODEL_HXX
128 :
129 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|