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 .
21 #ifndef INCLUDED_VCL_FILTERCONFIGITEM_HXX
22 #define INCLUDED_VCL_FILTERCONFIGITEM_HXX
24 #include <vcl/dllapi.h>
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/awt/Size.hpp>
28 #include <com/sun/star/uno/Any.h>
29 #include <com/sun/star/uno/Reference.h>
30 #include <com/sun/star/uno/XInterface.hpp>
31 #include <com/sun/star/beans/XPropertySet.hpp>
32 #include <com/sun/star/beans/XPropertyAccess.hpp>
33 #include <com/sun/star/task/XStatusIndicator.hpp>
35 class VCL_DLLPUBLIC FilterConfigItem
37 css::uno::Reference
< css::uno::XInterface
> xUpdatableView
;
38 css::uno::Reference
< css::beans::XPropertySet
> xPropSet
;
39 css::uno::Sequence
< css::beans::PropertyValue
> aFilterData
;
43 static bool ImplGetPropertyValue( css::uno::Any
& rAny
,
44 const css::uno::Reference
< css::beans::XPropertySet
>& rXPropSet
,
45 const OUString
& rPropName
);
47 void ImpInitTree( const OUString
& rTree
);
50 static css::beans::PropertyValue
* GetPropertyValue(
51 css::uno::Sequence
< css::beans::PropertyValue
>& rPropSeq
,
52 const OUString
& rName
);
53 static bool WritePropertyValue(
54 css::uno::Sequence
< css::beans::PropertyValue
>& rPropSeq
,
55 const css::beans::PropertyValue
& rPropValue
);
59 FilterConfigItem( const OUString
& rSubTree
);
60 FilterConfigItem( css::uno::Sequence
< css::beans::PropertyValue
>* pFilterData
);
61 FilterConfigItem( const OUString
& rSubTree
, css::uno::Sequence
< css::beans::PropertyValue
>* pFilterData
);
62 /// Writes config in destructor
64 /// Writes config and sets unmodified state again.
65 void WriteModifiedConfig();
67 // all read methods are trying to return values in following order:
68 // 1. FilterData PropertySequence
71 bool ReadBool( const OUString
& rKey
, bool bDefault
);
72 sal_Int32
ReadInt32( const OUString
& rKey
, sal_Int32 nDefault
);
74 ReadString( const OUString
& rKey
, const OUString
& rDefault
);
76 // try to store to configuration
77 // and always stores into the FilterData sequence
78 void WriteBool( const OUString
& rKey
, bool bValue
);
79 void WriteInt32( const OUString
& rKey
, sal_Int32 nValue
);
81 const css::uno::Sequence
< css::beans::PropertyValue
>& GetFilterData() const { return aFilterData
;}
83 // GetStatusIndicator is returning the "StatusIndicator" property of the FilterData sequence
84 css::uno::Reference
< css::task::XStatusIndicator
> GetStatusIndicator() const;
87 #endif // INCLUDED_VCL_FILTERCONFIGITEM_HXX
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */