1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FilterConfigItem.hxx,v $
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 ************************************************************************/
32 #ifndef _FILTER_CONFIG_ITEM_HXX_
33 #define _FILTER_CONFIG_ITEM_HXX_
35 #ifndef INCLUDED_SVTDLLAPI_H
36 #include "bf_svtools/svtdllapi.h"
40 #include <tools/string.hxx>
42 #ifndef _COM_SUN_STAR_AWT_SIZE_HPP_
43 #include <com/sun/star/awt/Size.hpp>
46 #ifndef _COM_SUN_STAR_UNO_ANY_H_
47 #include <com/sun/star/uno/Any.h>
49 #ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
50 #include <com/sun/star/uno/Reference.h>
52 #ifndef _COM_SUN_STAR_UNO_XINTERFACE_HPP_
53 #include <com/sun/star/uno/XInterface.hpp>
55 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
56 #include <com/sun/star/beans/XPropertySet.hpp>
58 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_
59 #include <com/sun/star/beans/XPropertyAccess.hpp>
61 #ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
62 #include <com/sun/star/task/XStatusIndicator.hpp>
68 class FilterConfigItem
70 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> xUpdatableView
;
71 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> xPropSet
;
72 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> aFilterData
;
76 sal_Bool
ImplGetPropertyValue( ::com::sun::star::uno::Any
& rAny
,
77 const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& rXPropSet
,
78 const ::rtl::OUString
& rPropName
,
79 sal_Bool bTestPropertyAvailability
);
81 void ImpInitTree( const String
& rTree
);
84 static ::com::sun::star::beans::PropertyValue
* GetPropertyValue(
85 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rPropSeq
,
86 const ::rtl::OUString
& rName
);
87 static sal_Bool
WritePropertyValue(
88 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& rPropSeq
,
89 const ::com::sun::star::beans::PropertyValue
& rPropValue
);
93 FilterConfigItem( const ::rtl::OUString
& rSubTree
);
94 FilterConfigItem( ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>* pFilterData
);
97 // all read methods are trying to return values in following order:
98 // 1. FilterData PropertySequence
101 sal_Bool
ReadBool( const ::rtl::OUString
& rKey
, sal_Bool bDefault
);
102 sal_Int32
ReadInt32( const ::rtl::OUString
& rKey
, sal_Int32 nDefault
);
104 // try to store to configuration
105 // and always stores into the FilterData sequence
106 void WriteInt32( const ::rtl::OUString
& rKey
, sal_Int32 nValue
);
108 // GetStatusIndicator is returning the "StatusIndicator" property of the FilterData sequence
109 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> GetStatusIndicator() const;
114 #endif // _FILTER_CONFIG_ITEM_HXX_