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