LibreOffice Module vcl (master)  1
FilterConfigItem.hxx
Go to the documentation of this file.
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 
21 #ifndef INCLUDED_VCL_FILTERCONFIGITEM_HXX
22 #define INCLUDED_VCL_FILTERCONFIGITEM_HXX
23 
24 #include <vcl/dllapi.h>
25 
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/beans/PropertyValue.hpp>
28 #include <com/sun/star/uno/Reference.h>
29 #include <com/sun/star/uno/Sequence.hxx>
30 
31 namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } }
32 namespace com { namespace sun { namespace star { namespace task { class XStatusIndicator; } } } }
33 namespace com { namespace sun { namespace star { namespace uno { class Any; } } } }
34 namespace com { namespace sun { namespace star { namespace uno { class XInterface; } } } }
35 
37 {
38  css::uno::Reference< css::uno::XInterface > xUpdatableView;
39  css::uno::Reference< css::beans::XPropertySet > xPropSet;
40  css::uno::Sequence< css::beans::PropertyValue > aFilterData;
41 
42  bool bModified;
43 
44  static bool ImplGetPropertyValue( css::uno::Any& rAny,
45  const css::uno::Reference< css::beans::XPropertySet >& rXPropSet,
46  const OUString& rPropName );
47 
48  void ImpInitTree( const OUString& rTree );
49 
50 
51  static css::beans::PropertyValue* GetPropertyValue(
52  css::uno::Sequence< css::beans::PropertyValue >& rPropSeq,
53  const OUString& rName );
54  static bool WritePropertyValue(
55  css::uno::Sequence< css::beans::PropertyValue >& rPropSeq,
56  const css::beans::PropertyValue& rPropValue );
57 
58 public:
59 
60  FilterConfigItem( const OUString& rSubTree );
61  FilterConfigItem( css::uno::Sequence< css::beans::PropertyValue > const * pFilterData );
62  FilterConfigItem( const OUString& rSubTree, css::uno::Sequence< css::beans::PropertyValue > const * pFilterData );
66  void WriteModifiedConfig();
67 
68  // all read methods are trying to return values in following order:
69  // 1. FilterData PropertySequence
70  // 2. configuration
71  // 3. given default
72  bool ReadBool( const OUString& rKey, bool bDefault );
73  sal_Int32 ReadInt32( const OUString& rKey, sal_Int32 nDefault );
74  OUString
75  ReadString( const OUString& rKey, const OUString& rDefault );
76 
77  // try to store to configuration
78  // and always stores into the FilterData sequence
79  void WriteBool( const OUString& rKey, bool bValue );
80  void WriteInt32( const OUString& rKey, sal_Int32 nValue );
81 
82  const css::uno::Sequence< css::beans::PropertyValue >& GetFilterData() const { return aFilterData;}
83 
84  // GetStatusIndicator is returning the "StatusIndicator" property of the FilterData sequence
85  css::uno::Reference< css::task::XStatusIndicator > GetStatusIndicator() const;
86 };
87 
88 #endif // INCLUDED_VCL_FILTERCONFIGITEM_HXX
89 
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::uno::XInterface > xUpdatableView
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
css::uno::Sequence< css::beans::PropertyValue > aFilterData
css::uno::Reference< css::beans::XPropertySet > xPropSet
class SAL_NO_VTABLE XPropertySet
const css::uno::Sequence< css::beans::PropertyValue > & GetFilterData() const
css::uno::Any GetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName)