1*184e05d2SAndrew Rist# ************************************************************* 2*184e05d2SAndrew Rist# 3*184e05d2SAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 4*184e05d2SAndrew Rist# or more contributor license agreements. See the NOTICE file 5*184e05d2SAndrew Rist# distributed with this work for additional information 6*184e05d2SAndrew Rist# regarding copyright ownership. The ASF licenses this file 7*184e05d2SAndrew Rist# to you under the Apache License, Version 2.0 (the 8*184e05d2SAndrew Rist# "License"); you may not use this file except in compliance 9*184e05d2SAndrew Rist# with the License. You may obtain a copy of the License at 10*184e05d2SAndrew Rist# 11*184e05d2SAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 12*184e05d2SAndrew Rist# 13*184e05d2SAndrew Rist# Unless required by applicable law or agreed to in writing, 14*184e05d2SAndrew Rist# software distributed under the License is distributed on an 15*184e05d2SAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*184e05d2SAndrew Rist# KIND, either express or implied. See the License for the 17*184e05d2SAndrew Rist# specific language governing permissions and limitations 18*184e05d2SAndrew Rist# under the License. 19*184e05d2SAndrew Rist# 20*184e05d2SAndrew Rist# ************************************************************* 21*184e05d2SAndrew Rist 22cdf0e10cSrcweir** MetricField: 23cdf0e10cSrcweir + in vcl: 24cdf0e10cSrcweirclass VCL_DLLPUBLIC CurrencyField : public SpinField, public CurrencyFormatter 25cdf0e10cSrcweirclass VCL_DLLPUBLIC CurrencyFormatter : public NumericFormatter 26cdf0e10cSrcweirclass VCL_DLLPUBLIC MetricFormatter : public NumericFormatter 27cdf0e10cSrcweirclass VCL_DLLPUBLIC NumericFormatter : public FormatterBase 28cdf0e10cSrcweir 29cdf0e10cSrcweirMetricFormatter - very simple sal_Int64 wrapping ... 30cdf0e10cSrcweir + no doubles ... 31cdf0e10cSrcweir + *Could* replicate this with the same interface: 32cdf0e10cSrcweir + prolly easier / better to add an XMetricField interface. 33cdf0e10cSrcweir 34cdf0e10cSrcweirvcl's MetricField - itself does a load of (double) casting ... 35cdf0e10cSrcweir + to get the value it wants :-) 36cdf0e10cSrcweir + Urgh ! ... 37cdf0e10cSrcweir 38cdf0e10cSrcweir** Can we just twist VCLXCurrencyField to this purpose ? 39cdf0e10cSrcweir + what differences would we want ? 40cdf0e10cSrcweir + LongCurrencyFormatter -> 'MetricFormatter' ... 41cdf0e10cSrcweir 42cdf0e10cSrcweir** Interesting ! 43cdf0e10cSrcweir + VCLXCurrencyField is based on 'LongCurrencyField' not CurrencyField ... 44cdf0e10cSrcweir + this is really based on 'BigInt' [ curious ] - so even more precision loss. 45cdf0e10cSrcweir 46cdf0e10cSrcweir + So ... cut/paste VCLXCurencyField -> VCLXMetricField 47cdf0e10cSrcweir 48cdf0e10cSrcweir + Look at 'VCLXNumericField' interface ... 49cdf0e10cSrcweir + Use 'XNumericField' instead (?) 50cdf0e10cSrcweir + why does this just not "just work" ? 51cdf0e10cSrcweir 52cdf0e10cSrcweir + The 'MetricField' (is also a MetricFormatter) 53cdf0e10cSrcweir + MetricFormatter [ unusually ] has 'Unit' support 54cdf0e10cSrcweir + API grep shows: 55cdf0e10cSrcweir + a) requires 'fieldunit' 56cdf0e10cSrcweir + b) has "UserValue" 57cdf0e10cSrcweir + c) => new IDL interface required ... 58cdf0e10cSrcweir + sub-set / expand NumericField ? 59cdf0e10cSrcweir 60cdf0e10cSrcweir + add 'CustomConvert' ? 61cdf0e10cSrcweir + add '[SG]etFirst'/Last 62cdf0e10cSrcweir + Properties: 63cdf0e10cSrcweir + 'Unit' 64cdf0e10cSrcweir + 'CustomUnitText' 65cdf0e10cSrcweir + 'spin-size' -> 'value-step' 66cdf0e10cSrcweir + 'BaseValue' ... 67cdf0e10cSrcweir + sal_Int64 ... [!?] ... 68cdf0e10cSrcweir + CorrectedValue 69cdf0e10cSrcweir + Want properties for the UI designer (?) 70cdf0e10cSrcweir + move that stuff out into there ? 71cdf0e10cSrcweir + FIXME: 72cdf0e10cSrcweir + rationalise the 'Modify' event crud ... 73cdf0e10cSrcweir + share the code in a base-class ... 74cdf0e10cSrcweir 75cdf0e10cSrcweir + Wrapper: 76cdf0e10cSrcweir + need to have static methods 'ConvertDoubleValue' etc. 77cdf0e10cSrcweir + also 'ConvertValue' etc. 78cdf0e10cSrcweir + GetCorrectedValue - never used ... 79