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_DLG_OBJECTPROPERTIES_HXX
24 #define _CHART2_DLG_OBJECTPROPERTIES_HXX
25 
26 #include "ObjectIdentifier.hxx"
27 #include <sfx2/tabdlg.hxx>
28 // header for typedef ChangeType
29 #include <svx/tabarea.hxx>
30 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
31 
32 //.............................................................................
33 namespace chart
34 {
35 //.............................................................................
36 
37 class ObjectPropertiesDialogParameter
38 {
39 public:
40     ObjectPropertiesDialogParameter( const rtl::OUString& rObjectCID );
41     virtual ~ObjectPropertiesDialogParameter();
42 
43 	void	    	init( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
44 	ObjectType	    getObjectType() const;
45     rtl::OUString   getLocalizedName() const;
46 
47 	bool HasGeometryProperties() const;
48 	bool HasStatisticProperties() const;
49 	bool ProvidesSecondaryYAxis() const;
50     bool ProvidesOverlapAndGapWidth() const;
51     bool ProvidesBarConnectors() const;
52 	bool HasAreaProperties() const;
53 	bool HasSymbolProperties() const;
54     bool HasNumberProperties() const;
55     bool ProvidesStartingAngle() const;
56     bool ProvidesMissingValueTreatments() const;
57 
58     bool HasScaleProperties() const;
59     bool CanAxisLabelsBeStaggered() const;
60     bool IsSupportingAxisPositioning() const;
61     bool ShowAxisOrigin() const;
62     bool IsCrossingAxisIsCategoryAxis() const;
63     const ::com::sun::star::uno::Sequence< rtl::OUString >& GetCategories() const;
64 
65     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
66         getDocument() const;
67 
68     bool IsComplexCategoriesAxis() const;
69 
70 private:
71 	rtl::OUString	m_aObjectCID;
72 	ObjectType		m_eObjectType;
73     bool m_bAffectsMultipleObjects;//is true if more than one object of the given type will be changed (e.g. all axes or all titles)
74 
75     rtl::OUString	m_aLocalizedName;
76 
77 	bool m_bHasGeometryProperties;
78 	bool m_bHasStatisticProperties;
79     bool m_bProvidesSecondaryYAxis;
80     bool m_bProvidesOverlapAndGapWidth;
81     bool m_bProvidesBarConnectors;
82 	bool m_bHasAreaProperties;
83 	bool m_bHasSymbolProperties;
84     bool m_bHasNumberProperties;
85     bool m_bProvidesStartingAngle;
86     bool m_bProvidesMissingValueTreatments;
87 
88     bool m_bHasScaleProperties;
89     bool m_bCanAxisLabelsBeStaggered;
90 
91     bool m_bSupportingAxisPositioning;
92     bool m_bShowAxisOrigin;
93     bool m_bIsCrossingAxisIsCategoryAxis;
94     ::com::sun::star::uno::Sequence< rtl::OUString > m_aCategories;
95 
96     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument > m_xChartDocument;
97 
98     bool m_bComplexCategoriesAxis;
99 };
100 
101 /*************************************************************************
102 |*
103 |* dialog for properties of different chart object
104 |*
105 \************************************************************************/
106 
107 class ViewElementListProvider;
108 
109 class SchAttribTabDlg : public SfxTabDialog
110 {
111 private:
112     ObjectType               eObjectType;
113     bool                     bAffectsMultipleObjects;//is true if more than one object of the given type will be changed (e.g. all axes or all titles)
114     sal_uInt16		  	         nDlgType;
115     sal_uInt16		  	         nPageType;
116 
117     const ObjectPropertiesDialogParameter * const        m_pParameter;
118     const ViewElementListProvider* const				 m_pViewElementListProvider;
119     SvNumberFormatter* m_pNumberFormatter;
120 
121     SfxItemSet*     m_pSymbolShapeProperties;
122     Graphic*		m_pAutoSymbolGraphic;
123 
124     double          m_fAxisMinorStepWidthForErrorBarDecimals;
125     bool            m_bOKPressed;
126 
127     virtual void PageCreated(sal_uInt16 nId, SfxTabPage& rPage);
128 
129     Link m_aOriginalOKClickHdl;
130     DECL_LINK( OKPressed, void * );
131 
132 public:
133 	SchAttribTabDlg(Window* pParent, const SfxItemSet* pAttr,
134 					const ObjectPropertiesDialogParameter* pDialogParameter,
135 					const ViewElementListProvider* pViewElementListProvider,
136                     const ::com::sun::star::uno::Reference<
137                             ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
138 	virtual ~SchAttribTabDlg();
139 
140     //pSymbolShapeProperties: Properties to be set on the symbollist shapes
141     //pAutoSymbolGraphic: Graphic to be shown if AutoSymbol gets selected
142     //this class takes ownership over both parameter
143     void setSymbolInformation( SfxItemSet* pSymbolShapeProperties, Graphic* pAutoSymbolGraphic );
144 
145     void SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth );
146 
147     bool DialogWasClosedWithOK() const;
148 };
149 
150 //.............................................................................
151 } //namespace chart
152 //.............................................................................
153 
154 #endif
155 
156