merge the formfield patch from ooo-build
[ooovba.git] / basic / source / app / dialogs.hxx
blobbc7df5ad7697fe64802abff928bfc23da1c7fc94
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dialogs.hxx,v $
10 * $Revision: 1.15 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DIALOGS_HXX
32 #define _DIALOGS_HXX
34 #ifndef _DIALOG_HXX //autogen
35 #include <vcl/dialog.hxx>
36 #endif
37 #ifndef _BUTTON_HXX //autogen
38 #include <vcl/button.hxx>
39 #endif
40 #ifndef _EDIT_HXX //autogen
41 #include <vcl/edit.hxx>
42 #endif
43 #ifndef _FIELD_HXX //autogen
44 #include <vcl/field.hxx>
45 #endif
46 #include <vcl/fixed.hxx>
47 #include <vcl/tabdlg.hxx>
48 #include <vcl/tabctrl.hxx>
49 #include <vcl/tabpage.hxx>
50 #include <tools/config.hxx>
51 #ifndef _TOOLS_LIST_HXX
52 #include <tools/list.hxx>
53 #endif
54 #include <vcl/lstbox.hxx>
55 #include <vcl/floatwin.hxx>
56 #include <vcl/toolbox.hxx>
57 #include <svtools/ctrltool.hxx>
58 #include <svtools/ctrlbox.hxx>
60 class SbxVariable;
62 #ifndef _BASIC_TTRESHLP_HXX
63 #include <basic/ttstrhlp.hxx>
64 #endif
66 class AboutDialog : public ModalDialog {
67 FixedText a1,a4,aVersionString;
68 OKButton aOk;
69 public:
70 AboutDialog (Window*, const ResId&);
73 class FindDialog : public ModalDialog {
74 FixedText aFT1;
75 Edit aFind;
76 OKButton aOk;
77 CancelButton aCancel;
78 String* pFind;
79 DECL_LINK( ButtonClick, Button * );
80 public:
81 FindDialog (Window*, const ResId&, String&);
84 class ReplaceDialog : public ModalDialog {
85 FixedText aFT1;
86 FixedText aFT2;
87 Edit aFind;
88 Edit aReplace;
89 OKButton aOk;
90 CancelButton aCancel;
91 String* pFind;
92 String* pReplace;
93 DECL_LINK( ButtonClick, Button * );
94 public:
95 ReplaceDialog (Window*, const ResId&, String&, String&);
98 ////////////////////////////////////////////////////////////////////
100 class ConfEdit : public PushButton
102 protected:
103 FixedText aText;
104 Edit aEdit;
105 ByteString aKeyName;
107 void Init( Config &aConf );
109 public:
110 ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf );
111 ConfEdit( Window* pParent, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf );
112 void Save( Config &aConf );
113 void Reload( Config &aConf );
114 void Click();
115 String GetValue() { return aEdit.GetText(); };
116 void SetModifyHdl( Link aLink ) { aEdit.SetModifyHdl( aLink ); };
120 class OptConfEdit : public ConfEdit
122 protected:
123 CheckBox aCheck;
124 ConfEdit& rBase;
125 DECL_LINK( ToggleHdl, CheckBox* );
126 public:
127 OptConfEdit( Window* pParent, USHORT nResCheck, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf );
128 void Reload( Config &aConf );
129 DECL_LINK( BaseModifyHdl, Edit* );
133 class OptionsDialog : public TabDialog
135 private:
136 TabControl aTabCtrl;
138 OKButton aOK;
139 CancelButton aCancel;
140 DECL_LINK( OKClick, Button * );
142 Config aConfig;
144 public:
145 OptionsDialog( Window* pParent, const ResId& );
146 ~OptionsDialog();
147 virtual BOOL Close();
150 DECL_LINK( ActivatePageHdl, TabControl * );
153 class ProfileOptions : public TabPage
155 Config &rConf;
157 FixedLine aFlProfile;
158 ComboBox aCbProfile;
159 PushButton aPbNewProfile;
160 PushButton aPbDelProfile;
162 FixedLine aDirs;
163 ConfEdit aLog;
164 ConfEdit aBasis;
165 OptConfEdit aHID;
167 CheckBox aAutoReload;
168 CheckBox aAutoSave;
169 CheckBox aStopOnSyntaxError;
171 void LoadData();
173 DECL_LINK( Select, ComboBox* );
174 DECL_LINK( DelProfile, Button* );
175 DECL_LINK( NewProfile, Button* );
176 DECL_LINK( CheckButtonsHdl, ComboBox* );
178 void ReloadProfile();
179 void Save();
181 public:
182 ProfileOptions( Window*, Config &rConfig );
183 void Save( Config &rConfig );
187 class CrashreportOptions : public TabPage
189 FixedLine aFLCrashreport;
190 CheckBox aCBUseProxy;
191 FixedText aFTCRHost;
192 Edit aEDCRHost;
193 FixedText aFTCRPort;
194 NumericField aNFCRPort;
196 CheckBox aCBAllowContact;
197 FixedText aFTEMail;
198 Edit aEDEMail;
200 DECL_LINK( CheckProxy, void*);
201 DECL_LINK( CheckResponse, void*);
203 public:
204 CrashreportOptions( Window*, Config &aConfig );
205 void Save( Config &aConfig );
208 class MiscOptions : public TabPage
210 FixedLine aFLCommunication;
211 FixedText aFTHost;
212 Edit aEDHost;
213 FixedText aFTTTPort;
214 NumericField aNFTTPort;
215 FixedText aFTUNOPort;
216 NumericField aNFUNOPort;
217 FixedLine aOther;
218 FixedText aTimeoutText;
219 TimeField aServerTimeout;
220 FixedText aFTLRU;
221 NumericField aTFMaxLRU;
222 FixedText aFTProgDir;
223 Edit aEDProgDir;
224 PushButton aPBProgDir;
226 DECL_LINK( Click, void*);
228 public:
229 MiscOptions( Window*, Config &aConfig );
230 void Save( Config &aConfig );
233 class FontOptions : public TabPage
235 FixedText aFTFontName;
236 FontNameBox aFontName;
237 FixedText aFTStyle;
238 FontStyleBox aFontStyle;
239 FixedText aFTSize;
240 FontSizeBox aFontSize;
241 FixedText aFTPreview;
243 FontList aFontList;
245 DECL_LINK( FontNameChanged, void* );
246 DECL_LINK( FontStyleChanged, void* );
247 DECL_LINK( FontSizeChanged, void* );
249 void UpdatePreview();
251 public:
252 FontOptions( Window*, Config &aConfig );
253 void Save( Config &aConfig );
257 DECLARE_LIST( StringList, String * )
258 #define C_KEY_ALLE CByteString("All")
259 #define C_KEY_AKTUELL CByteString("Current")
260 #define C_KEY_TYPE CByteString("Type")
261 #define C_KEY_DELETE CByteString("Deleted Groups")
263 class GenericOptions : public TabPage
265 Config &aConf;
267 FixedLine aFlArea;
268 ComboBox aCbArea;
269 PushButton aPbNewArea;
270 PushButton aPbDelArea;
272 FixedLine aFlValue;
273 ComboBox aCbValue;
274 PushButton aPbSelectPath;
275 PushButton aPbNewValue;
276 PushButton aPbDelValue;
278 int nMoveButtons;
279 BOOL bShowSelectPath;
280 AutoTimer aMoveTimer;
281 DECL_LINK( MoveButtons, AutoTimer* );
283 ByteString aLastGroupName;
285 String ReadKey( const ByteString &aGroup, const ByteString &aKey );
287 StringList* GetAllGroups();
288 void LoadData();
290 void ShowSelectPath( const String aType );
292 DECL_LINK( LoadGroup, ComboBox* );
293 DECL_LINK( DelGroup, Button* );
294 DECL_LINK( NewGroup, Button* );
295 DECL_LINK( SelectPath, Button* );
296 DECL_LINK( DelValue, Button* );
297 DECL_LINK( NewValue, Button* );
298 DECL_LINK( CheckButtonsHdl, ComboBox* );
300 public:
301 GenericOptions( Window*, Config &aConfig );
302 ~GenericOptions();
303 void Save( Config &aConfig );
307 struct WinInfoRec;
308 class SplitWindow;
310 class DisplayHidDlg : public FloatingWindow
312 protected:
313 ToolBox aTbConf;
314 FixedText aFtControls;
315 MultiListBox aMlbControls;
316 FixedText aFtSlots;
317 MultiListBox aMlbSlots;
318 PushButton aPbKopieren;
319 PushButton aPbBenennen;
320 PushButton aPbSelectAll;
321 OKButton aOKClose;
323 DockingWindow* pControls;
324 DockingWindow* pSlots;
325 SplitWindow *pSplit;
327 ULONG nDisplayMode;
329 DECL_LINK( Select, void* );
330 DECL_LINK( SelectAll, PushButton* );
331 DECL_LINK( CopyToClipboard, void* );
333 public:
334 DisplayHidDlg( Window * pParent );
335 virtual ~DisplayHidDlg();
337 virtual void Resize();
339 void AddData( WinInfoRec* pWinInfo );
344 class VarEditDialog : public ModelessDialog
346 protected:
347 FixedText aFixedTextRID_FT_NAME;
348 FixedText aFixedTextRID_FT_CONTENT;
349 FixedText aFixedTextRID_FT_NEW_CONTENT;
350 FixedText aFixedTextRID_FT_NAME_VALUE;
351 FixedText aFixedTextRID_FT_CONTENT_VALUE;
353 RadioButton aRadioButtonRID_RB_NEW_BOOL_T;
354 RadioButton aRadioButtonRID_RB_NEW_BOOL_F;
355 NumericField aNumericFieldRID_NF_NEW_INTEGER;
356 NumericField aNumericFieldRID_NF_NEW_LONG;
357 Edit aEditRID_ED_NEW_STRING;
359 OKButton aOKButtonRID_OK;
360 CancelButton aCancelButtonRID_CANCEL;
362 SbxVariable *pVar;
364 DECL_LINK( OKClick, Button * );
366 // BOOL bCompare = FALSE;
367 // String aCompareString;
369 public:
370 VarEditDialog( Window * pParent, SbxVariable *pPVar );
374 #endif