LibreOffice Module forms (master) 1
limitedformats.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#pragma once
21
22#include <osl/mutex.hxx>
23#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
24#include <com/sun/star/uno/XComponentContext.hpp>
25#include <com/sun/star/beans/XFastPropertySet.hpp>
26
27
28namespace frm
29{
30
31
32 //= OLimitedFormats
33
39 {
40 private:
41 static sal_Int32 s_nInstanceCount;
42 static ::osl::Mutex s_aMutex;
43 static css::uno::Reference< css::util::XNumberFormatsSupplier >
45
47 const sal_Int16 m_nTableId;
48 css::uno::Reference< css::beans::XFastPropertySet >
50
51 protected:
57 const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
58 const sal_Int16 _nClassId
59 );
61
62 protected:
63 void setAggregateSet(
64 const css::uno::Reference< css::beans::XFastPropertySet >& _rxAggregate,
65 sal_Int32 _nOriginalPropertyHandle
66 );
67
68 protected:
69 void getFormatKeyPropertyValue( css::uno::Any& _rValue ) const;
71 css::uno::Any& _rConvertedValue,
72 css::uno::Any& _rOldValue,
73 const css::uno::Any& _rNewValue
74 );
75 void setFormatKeyPropertyValue( const css::uno::Any& _rNewValue );
76 // setFormatKeyPropertyValue should only be called with a value got from convertFormatKeyPropertyValue!
77
78 const css::uno::Reference< css::util::XNumberFormatsSupplier >&
80
81 private:
82 void acquireSupplier(const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
83 void releaseSupplier();
84
85 static void ensureTableInitialized(const sal_Int16 _nTableId);
86 static void clearTable(const sal_Int16 _nTableId);
87 };
88
89
90} // namespace frm
91
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
maintains translation tables format key <-> enum value
css::uno::Reference< css::beans::XFastPropertySet > m_xAggregate
static void clearTable(const sal_Int16 _nTableId)
static sal_Int32 s_nInstanceCount
sal_Int32 m_nFormatEnumPropertyHandle
const css::uno::Reference< css::util::XNumberFormatsSupplier > & getFormatsSupplier() const
void setAggregateSet(const css::uno::Reference< css::beans::XFastPropertySet > &_rxAggregate, sal_Int32 _nOriginalPropertyHandle)
void getFormatKeyPropertyValue(css::uno::Any &_rValue) const
void setFormatKeyPropertyValue(const css::uno::Any &_rNewValue)
OLimitedFormats(const css::uno::Reference< css::uno::XComponentContext > &_rxContext, const sal_Int16 _nClassId)
ctor
bool convertFormatKeyPropertyValue(css::uno::Any &_rConvertedValue, css::uno::Any &_rOldValue, const css::uno::Any &_rNewValue)
static css::uno::Reference< css::util::XNumberFormatsSupplier > s_xStandardFormats
void acquireSupplier(const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
const sal_Int16 m_nTableId
static void ensureTableInitialized(const sal_Int16 _nTableId)
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25