merge the formfield patch from ooo-build
[ooovba.git] / sfx2 / inc / srchdlg.hxx
blobe5ad04080302333c504118527726c05dd48b22fb
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: srchdlg.hxx,v $
10 * $Revision: 1.5 $
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 ************************************************************************/
30 #ifndef _SFX_SRCHDLG_HXX_
31 #define _SFX_SRCHDLG_HXX_
33 #ifndef _VCL_BUTTON_HXX
34 #include <vcl/button.hxx>
35 #endif
36 #include <vcl/combobox.hxx>
37 #ifndef _VCL_EDIT_HXX
38 #include <vcl/edit.hxx>
39 #endif
40 #ifndef _VCL_FIXED_HXX
41 #include <vcl/fixed.hxx>
42 #endif
43 #include <sfx2/basedlgs.hxx>
45 // ============================================================================
47 namespace sfx2 {
49 // ============================================================================
50 // SearchDialog
51 // ============================================================================
53 class SearchDialog : public ModelessDialog
55 private:
56 FixedText m_aSearchLabel;
57 ComboBox m_aSearchEdit;
58 CheckBox m_aWholeWordsBox;
59 CheckBox m_aMatchCaseBox;
60 CheckBox m_aWrapAroundBox;
61 CheckBox m_aBackwardsBox;
62 PushButton m_aFindBtn;
63 CancelButton m_aCancelBtn;
65 Link m_aFindHdl;
66 Link m_aCloseHdl;
68 String m_sToggleText;
69 ::rtl::OUString m_sConfigName;
70 ByteString m_sWinState;
72 bool m_bIsConstructed;
74 void LoadConfig();
75 void SaveConfig();
77 DECL_LINK( FindHdl, PushButton* );
78 DECL_LINK( ToggleHdl, CheckBox* );
80 public:
81 SearchDialog( Window* pWindow, const ::rtl::OUString& rConfigName );
82 ~SearchDialog();
84 inline void SetFindHdl( const Link& rLink ) { m_aFindHdl = rLink; }
85 inline void SetCloseHdl( const Link& rLink ) { m_aCloseHdl = rLink; }
87 inline String GetSearchText() const { return m_aSearchEdit.GetText(); }
88 inline void SetSearchText( const String& _rText ) { m_aSearchEdit.SetText( _rText ); }
89 inline bool IsOnlyWholeWords() const { return ( m_aWholeWordsBox.IsChecked() != FALSE ); }
90 inline bool IsMarchCase() const { return ( m_aMatchCaseBox.IsChecked() != FALSE ); }
91 inline bool IsWrapAround() const { return ( m_aWrapAroundBox.IsChecked() != FALSE ); }
92 inline bool IsSearchBackwards() const { return ( m_aBackwardsBox.IsChecked() != FALSE ); }
94 void SetFocusOnEdit();
96 virtual BOOL Close();
97 virtual void Move();
98 virtual void StateChanged( StateChangedType nStateChange );
101 // ============================================================================
103 } // namespace sfx2
105 // ============================================================================
107 #endif // _SFX_SRCHDLG_HXX_