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