1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _CHART2_TP_3D_SCENE_GEOMETRY_HXX
28 #define _CHART2_TP_3D_SCENE_GEOMETRY_HXX
29 
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 #include <basegfx/matrix/b3dhommatrix.hxx>
32 
33 // header for class TabPage
34 #include <vcl/tabpage.hxx>
35 // header for class FixedLine
36 #include <vcl/fixed.hxx>
37 // header for class MetricField
38 #include <vcl/field.hxx>
39 // header for class OKButton
40 #ifndef _SV_BUTTON_HXX
41 #include <vcl/button.hxx>
42 #endif
43 
44 #include "ControllerLockGuard.hxx"
45 
46 //.............................................................................
47 namespace chart
48 {
49 //.............................................................................
50 
51 class ThreeD_SceneGeometry_TabPage : public TabPage
52 {
53 public:
54     ThreeD_SceneGeometry_TabPage( Window* pWindow,
55                                   const ::com::sun::star::uno::Reference<
56                                       ::com::sun::star::beans::XPropertySet > & xSceneProperties,
57                                   ControllerLockHelper & rControllerLockHelper );
58 	virtual ~ThreeD_SceneGeometry_TabPage();
59 
60     // has to be called in case the dialog was closed with OK
61     void commitPendingChanges();
62 
63     // is called by timer to apply changes to model
64     DECL_LINK( AngleChanged, void* );
65     // is called immediately when a field changes
66     DECL_LINK( AngleEdited, void* );
67 
68     // is called by timer to apply changes to model
69     DECL_LINK( PerspectiveChanged, void* );
70     // is called immediately when a field changes
71     DECL_LINK( PerspectiveEdited, void* );
72     DECL_LINK( PerspectiveToggled, void* );
73     DECL_LINK( RightAngledAxesToggled, void* );
74 
75 private:
76     void fillDialogAnglesFromModel() const;
77     void applyAnglesToModel();
78     void applyPerspectiveToModel();
79 
80     ::com::sun::star::uno::Reference<
81             ::com::sun::star::beans::XPropertySet > m_xSceneProperties;
82 
83     CheckBox		m_aCbxRightAngledAxes;
84 
85     FixedText		m_aFtXRotation;
86 	MetricField		m_aMFXRotation;
87 
88 	FixedText		m_aFtYRotation;
89 	MetricField		m_aMFYRotation;
90 
91     FixedText		m_aFtZRotation;
92     MetricField		m_aMFZRotation;
93 
94     CheckBox		m_aCbxPerspective;
95     MetricField		m_aMFPerspective;
96 
97     //to keep old values when switching to right angled axes
98     sal_Int64       m_nXRotation;
99     sal_Int64       m_nYRotation;
100     sal_Int64       m_nZRotation;
101 
102     bool            m_bAngleChangePending;
103     bool            m_bPerspectiveChangePending;
104 
105     ControllerLockHelper & m_rControllerLockHelper;
106 };
107 
108 //.............................................................................
109 } //namespace chart
110 //.............................................................................
111 
112 #endif
113