LibreOffice Module sfx2 (master) 1
srchdlg.hxx
Go to the documentation of this file.
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 INCLUDED_SFX2_INC_SRCHDLG_HXX
20#define INCLUDED_SFX2_INC_SRCHDLG_HXX
21
22#include <vcl/weld.hxx>
23
24namespace sfx2 {
25
26
27// SearchDialog
28
29
31{
32private:
35
36 OUString m_sConfigName;
37
38 std::unique_ptr<weld::ComboBox> m_xSearchEdit;
39 std::unique_ptr<weld::CheckButton> m_xWholeWordsBox;
40 std::unique_ptr<weld::CheckButton> m_xMatchCaseBox;
41 std::unique_ptr<weld::CheckButton> m_xWrapAroundBox;
42 std::unique_ptr<weld::CheckButton> m_xBackwardsBox;
43 std::unique_ptr<weld::Button> m_xFindBtn;
44
45 void LoadConfig();
46 void SaveConfig();
47
48 DECL_LINK(FindHdl, weld::Button&, void);
49
50public:
51 SearchDialog(weld::Window* pWindow, OUString aConfigName);
52 static void runAsync(const std::shared_ptr<SearchDialog>& rController);
53 virtual ~SearchDialog() override;
54
55 void SetFindHdl( const Link<SearchDialog&,void>& rLink ) { m_aFindHdl = rLink; }
56 void SetCloseHdl( const Link<LinkParamNone*,void>& rLink ) { m_aCloseHdl = rLink; }
57
58 OUString GetSearchText() const { return m_xSearchEdit->get_active_text(); }
59 void SetSearchText( const OUString& _rText ) { m_xSearchEdit->set_entry_text( _rText ); }
60 bool IsOnlyWholeWords() const { return m_xWholeWordsBox->get_active(); }
61 bool IsMarchCase() const { return m_xMatchCaseBox->get_active(); }
62 bool IsWrapAround() const { return m_xWrapAroundBox->get_active(); }
63 bool IsSearchBackwards() const { return m_xBackwardsBox->get_active(); }
64
65 void SetFocusOnEdit();
66};
67
68} // namespace sfx2
69
70
71#endif // INCLUDED_SFX2_INC_SRCHDLG_HXX
72
73/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SearchDialog(weld::Window *pWindow, OUString aConfigName)
Definition: srchdlg.cxx:40
std::unique_ptr< weld::CheckButton > m_xBackwardsBox
Definition: srchdlg.hxx:42
Link< LinkParamNone *, void > m_aCloseHdl
Definition: srchdlg.hxx:34
void SetSearchText(const OUString &_rText)
Definition: srchdlg.hxx:59
bool IsOnlyWholeWords() const
Definition: srchdlg.hxx:60
bool IsWrapAround() const
Definition: srchdlg.hxx:62
OUString GetSearchText() const
Definition: srchdlg.hxx:58
bool IsMarchCase() const
Definition: srchdlg.hxx:61
std::unique_ptr< weld::CheckButton > m_xMatchCaseBox
Definition: srchdlg.hxx:40
Link< SearchDialog &, void > m_aFindHdl
Definition: srchdlg.hxx:33
std::unique_ptr< weld::ComboBox > m_xSearchEdit
Definition: srchdlg.hxx:38
DECL_LINK(FindHdl, weld::Button &, void)
bool IsSearchBackwards() const
Definition: srchdlg.hxx:63
OUString m_sConfigName
Definition: srchdlg.hxx:36
virtual ~SearchDialog() override
Definition: srchdlg.cxx:58
void SetFindHdl(const Link< SearchDialog &, void > &rLink)
Definition: srchdlg.hxx:55
void SetCloseHdl(const Link< LinkParamNone *, void > &rLink)
Definition: srchdlg.hxx:56
void SetFocusOnEdit()
Definition: srchdlg.cxx:122
std::unique_ptr< weld::CheckButton > m_xWrapAroundBox
Definition: srchdlg.hxx:41
static void runAsync(const std::shared_ptr< SearchDialog > &rController)
Definition: srchdlg.cxx:128
std::unique_ptr< weld::Button > m_xFindBtn
Definition: srchdlg.hxx:43
std::unique_ptr< weld::CheckButton > m_xWholeWordsBox
Definition: srchdlg.hxx:39