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 
28 #ifndef _SD_CUSTOMANIMATIONDIALOG_HXX
29 #define _SD_CUSTOMANIMATIONDIALOG_HXX
30 
31 #include "CustomAnimationEffect.hxx"
32 #include "CustomAnimationPreset.hxx"
33 #include <vcl/tabdlg.hxx>
34 #include <vcl/lstbox.hxx>
35 
36 class TabControl;
37 class OKButton;
38 class CancelButton;
39 class HelpButton;
40 namespace sd {
41 
42 
43 // --------------------------------------------------------------------
44 
45 // property handles
46 const sal_Int32 nHandleSound = 0;
47 const sal_Int32 nHandleHasAfterEffect = 1;
48 const sal_Int32 nHandleIterateType = 2;
49 const sal_Int32 nHandleIterateInterval = 3;
50 const sal_Int32 nHandleStart = 4;
51 const sal_Int32 nHandleBegin = 5;
52 const sal_Int32 nHandleDuration = 6;
53 const sal_Int32 nHandleRepeat = 7;
54 const sal_Int32 nHandleRewind = 8;
55 const sal_Int32 nHandleEnd = 9;
56 const sal_Int32 nHandleAfterEffectOnNextEffect = 10;
57 const sal_Int32 nHandleDimColor = 11;
58 const sal_Int32 nHandleMaxParaDepth = 12;
59 const sal_Int32 nHandlePresetId = 13;
60 const sal_Int32 nHandleProperty1Type = 14;
61 const sal_Int32 nHandleProperty1Value = 15;
62 const sal_Int32 nHandleProperty2Type = 16;
63 const sal_Int32 nHandleProperty2Value = 17;
64 
65 const sal_Int32 nHandleAccelerate = 18;
66 const sal_Int32 nHandleDecelerate = 19;
67 const sal_Int32 nHandleAutoReverse = 20;
68 const sal_Int32 nHandleTrigger = 21;
69 
70 const sal_Int32 nHandleHasText = 22;
71 const sal_Int32 nHandleTextGrouping = 23;
72 const sal_Int32 nHandleAnimateForm = 24;
73 const sal_Int32 nHandleTextGroupingAuto = 25;
74 const sal_Int32 nHandleTextReverse = 26;
75 
76 const sal_Int32 nHandleCurrentPage = 27;
77 const sal_Int32 nHandleSoundURL = 28;
78 const sal_Int32 nHandleSoundVolumne = 29;
79 const sal_Int32 nHandleSoundEndAfterSlide = 30;
80 
81 const sal_Int32 nHandleCommand = 31;
82 
83 const sal_Int32 nHandleHasVisibleShape = 32;
84 
85 const sal_Int32 nPropertyTypeNone = 0;
86 const sal_Int32 nPropertyTypeDirection = 1;
87 const sal_Int32 nPropertyTypeSpokes = 2;
88 const sal_Int32 nPropertyTypeFirstColor = 3;
89 const sal_Int32 nPropertyTypeSecondColor = 4;
90 const sal_Int32 nPropertyTypeZoom = 5;
91 const sal_Int32 nPropertyTypeFillColor = 6;
92 const sal_Int32 nPropertyTypeColorStyle = 7;
93 const sal_Int32 nPropertyTypeFont = 8;
94 const sal_Int32 nPropertyTypeCharHeight = 9;
95 const sal_Int32 nPropertyTypeCharColor = 10;
96 const sal_Int32 nPropertyTypeCharHeightStyle = 11;
97 const sal_Int32 nPropertyTypeCharDecoration = 12;
98 const sal_Int32 nPropertyTypeLineColor = 13;
99 const sal_Int32 nPropertyTypeRotate = 14;
100 const sal_Int32 nPropertyTypeColor = 15;
101 const sal_Int32 nPropertyTypeAccelerate = 16;
102 const sal_Int32 nPropertyTypeDecelerate = 17;
103 const sal_Int32 nPropertyTypeAutoReverse = 18;
104 const sal_Int32 nPropertyTypeTransparency = 19;
105 const sal_Int32 nPropertyTypeFontStyle = 20;
106 const sal_Int32 nPropertyTypeScale = 21;
107 
108 // --------------------------------------------------------------------
109 
110 class PropertySubControl
111 {
112 public:
113 	PropertySubControl( sal_Int32 nType ) : mnType( nType ) {}
114 	virtual	~PropertySubControl();
115 
116 	virtual				::com::sun::star::uno::Any getValue() = 0;
117 	virtual				void setValue( const ::com::sun::star::uno::Any& rValue, const rtl::OUString& rPresetId ) = 0;
118 
119 	virtual Control*	getControl() = 0;
120 
121 	static PropertySubControl*
122 						create(	sal_Int32 nType,
123 								::Window* pParent,
124 								const ::com::sun::star::uno::Any& rValue,
125 								const rtl::OUString& rPresetId,
126 								const Link& rModifyHdl );
127 
128 	sal_Int32 getControlType() const { return mnType; }
129 
130 protected:
131 	sal_Int32			mnType;
132 };
133 
134 // --------------------------------------------------------------------
135 
136 class PropertyControl : public ListBox
137 {
138 public:
139 	PropertyControl( Window* pParent, const ResId& rResId );
140 	~PropertyControl();
141 
142 	void setSubControl( PropertySubControl* pSubControl );
143 	PropertySubControl* getSubControl() const { return mpSubControl; }
144 
145     virtual void Resize();
146 
147 private:
148 	PropertySubControl* mpSubControl;
149 };
150 
151 // --------------------------------------------------------------------
152 
153 class CustomAnimationDurationTabPage;
154 class CustomAnimationEffectTabPage;
155 class CustomAnimationTextAnimTabPage;
156 class STLPropertySet;
157 
158 class CustomAnimationDialog : public TabDialog
159 {
160 public:
161 	CustomAnimationDialog( Window* pParent, STLPropertySet* pSet, sal_uInt16 nPage = 0 );
162 	~CustomAnimationDialog();
163 
164 	STLPropertySet* getDefaultSet() { return mpSet; }
165 	STLPropertySet* getResultSet();
166 
167 	static STLPropertySet* createDefaultSet();
168 
169 private:
170 	STLPropertySet* mpSet;
171 	STLPropertySet* mpResultSet;
172 
173 	CustomAnimationEffectPtr mpEffect;
174 	TabControl* mpTabControl;
175 	OKButton* mpOKButton;
176 	CancelButton* mpCancelButton;
177 	HelpButton* mpHelpButton;
178 
179 	CustomAnimationDurationTabPage* mpDurationTabPage;
180 	CustomAnimationEffectTabPage* mpEffectTabPage;
181 	CustomAnimationTextAnimTabPage* mpTextAnimTabPage;
182 };
183 
184 }
185 
186 #endif // _SD_CUSTOMANIMATIONDIALOG_HXX
187