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 
23 #ifndef CHART2_RES_DATALABEL_HXX
24 #define CHART2_RES_DATALABEL_HXX
25 
26 #include "res_TextSeparator.hxx"
27 // header for class CheckBox
28 #include <vcl/button.hxx>
29 // header for class SfxItemSet
30 #include <svl/itemset.hxx>
31 #include "TextDirectionListBox.hxx"
32 
33 #include <svx/dialcontrol.hxx>
34 
35 class SvNumberFormatter;
36 
37 //.............................................................................
38 namespace chart
39 {
40 //.............................................................................
41 
42 class DataLabelResources
43 {
44 public:
45     DataLabelResources( Window* pParent, const SfxItemSet& rInAttrs );
46     virtual ~DataLabelResources();
47 
48     sal_Bool FillItemSet(SfxItemSet& rOutAttrs) const;
49     void Reset(const SfxItemSet& rInAttrs);
50 
51     void SetNumberFormatter( SvNumberFormatter* pFormatter );
52 
53 private:
54     CheckBox            m_aCBNumber;
55     PushButton          m_aPB_NumberFormatForValue;
56     CheckBox            m_aCBPercent;
57     PushButton          m_aPB_NumberFormatForPercent;
58     CheckBox            m_aCBCategory;
59     CheckBox            m_aCBSymbol;
60 
61     TextSeparatorResources  m_aSeparatorResources;
62 
63     FixedText           m_aFT_LabelPlacement;
64     ListBox             m_aLB_LabelPlacement;
65 
66     FixedLine           m_aFL_Rotate;
67     svx::DialControl    m_aDC_Dial;
68     FixedText           m_aFT_Degrees;
69     NumericField        m_aNF_Degrees;
70 
71     FixedText               m_aFT_TextDirection;
72     TextDirectionListBox    m_aLB_TextDirection;
73 
74     ::std::map< sal_Int32, sal_uInt16 > m_aPlacementToListBoxMap;
75     ::std::map< sal_uInt16, sal_Int32 > m_aListBoxToPlacementMap;
76 
77     SvNumberFormatter*  m_pNumberFormatter;
78     bool                m_bNumberFormatMixedState;
79     bool                m_bPercentFormatMixedState;
80     sal_uLong               m_nNumberFormatForValue;
81     sal_uLong               m_nNumberFormatForPercent;
82 
83     bool                m_bSourceFormatMixedState;
84     bool                m_bPercentSourceMixedState;
85     bool                m_bSourceFormatForValue;
86     bool                m_bSourceFormatForPercent;
87 
88     Window*             m_pWindow;
89     SfxItemPool*        m_pPool;
90 
91     DECL_LINK(NumberFormatDialogHdl, PushButton * );
92     DECL_LINK(CheckHdl, CheckBox* );
93     void EnableControls();
94 };
95 
96 //.............................................................................
97 } //namespace chart
98 //.............................................................................
99 
100 #endif
101