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