Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _SFX_SRCHDLG_HXX_
20 : #define _SFX_SRCHDLG_HXX_
21 :
22 : #include <vcl/button.hxx>
23 : #include <vcl/combobox.hxx>
24 : #include <vcl/edit.hxx>
25 : #include <vcl/fixed.hxx>
26 : #include <sfx2/basedlgs.hxx>
27 :
28 : // ============================================================================
29 :
30 : namespace sfx2 {
31 :
32 : // ============================================================================
33 : // SearchDialog
34 : // ============================================================================
35 :
36 : class SearchDialog : public ModelessDialog
37 : {
38 : private:
39 : FixedText m_aSearchLabel;
40 : ComboBox m_aSearchEdit;
41 : CheckBox m_aWholeWordsBox;
42 : CheckBox m_aMatchCaseBox;
43 : CheckBox m_aWrapAroundBox;
44 : CheckBox m_aBackwardsBox;
45 : PushButton m_aFindBtn;
46 : CancelButton m_aCancelBtn;
47 :
48 : Link m_aFindHdl;
49 : Link m_aCloseHdl;
50 :
51 : String m_sToggleText;
52 : OUString m_sConfigName;
53 : OString m_sWinState;
54 :
55 : bool m_bIsConstructed;
56 :
57 : void LoadConfig();
58 : void SaveConfig();
59 :
60 : DECL_LINK(FindHdl, void *);
61 : DECL_LINK(ToggleHdl, void *);
62 :
63 : public:
64 : SearchDialog( Window* pWindow, const OUString& rConfigName );
65 : ~SearchDialog();
66 :
67 0 : inline void SetFindHdl( const Link& rLink ) { m_aFindHdl = rLink; }
68 0 : inline void SetCloseHdl( const Link& rLink ) { m_aCloseHdl = rLink; }
69 :
70 0 : inline String GetSearchText() const { return m_aSearchEdit.GetText(); }
71 0 : inline void SetSearchText( const String& _rText ) { m_aSearchEdit.SetText( _rText ); }
72 0 : inline bool IsOnlyWholeWords() const { return ( m_aWholeWordsBox.IsChecked() != sal_False ); }
73 0 : inline bool IsMarchCase() const { return ( m_aMatchCaseBox.IsChecked() != sal_False ); }
74 0 : inline bool IsWrapAround() const { return ( m_aWrapAroundBox.IsChecked() != sal_False ); }
75 0 : inline bool IsSearchBackwards() const { return ( m_aBackwardsBox.IsChecked() != sal_False ); }
76 :
77 : void SetFocusOnEdit();
78 :
79 : virtual sal_Bool Close();
80 : virtual void Move();
81 : virtual void StateChanged( StateChangedType nStateChange );
82 : };
83 :
84 : // ============================================================================
85 :
86 : } // namespace sfx2
87 :
88 : // ============================================================================
89 :
90 : #endif // _SFX_SRCHDLG_HXX_
91 :
92 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|