Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sfx2/inc/srchdlg.hxx
Line
Count
Source
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/ComboBox.hxx>
23
#include <vcl/weld/DialogController.hxx>
24
#include <vcl/weld/weld.hxx>
25
26
namespace sfx2 {
27
28
29
// SearchDialog
30
31
32
class SearchDialog final : public weld::GenericDialogController
33
{
34
private:
35
    Link<SearchDialog&,void>   m_aFindHdl;
36
    Link<LinkParamNone*,void>  m_aCloseHdl;
37
38
    OUString            m_sConfigName;
39
40
    std::unique_ptr<weld::ComboBox> m_xSearchEdit;
41
    std::unique_ptr<weld::CheckButton> m_xWholeWordsBox;
42
    std::unique_ptr<weld::CheckButton> m_xMatchCaseBox;
43
    std::unique_ptr<weld::CheckButton> m_xWrapAroundBox;
44
    std::unique_ptr<weld::CheckButton> m_xBackwardsBox;
45
    std::unique_ptr<weld::Button> m_xFindBtn;
46
47
    void                LoadConfig();
48
    void                SaveConfig();
49
50
    DECL_LINK(FindHdl, weld::Button&, void);
51
52
public:
53
    SearchDialog(weld::Window* pWindow, OUString aConfigName);
54
    static void runAsync(const std::shared_ptr<SearchDialog>& rController);
55
    virtual ~SearchDialog() override;
56
57
0
    void         SetFindHdl( const Link<SearchDialog&,void>& rLink ) { m_aFindHdl = rLink; }
58
0
    void         SetCloseHdl( const Link<LinkParamNone*,void>& rLink ) { m_aCloseHdl = rLink; }
59
60
0
    OUString     GetSearchText() const { return m_xSearchEdit->get_active_text(); }
61
0
    void         SetSearchText( const OUString& _rText ) { m_xSearchEdit->set_entry_text( _rText ); }
62
0
    bool         IsOnlyWholeWords() const { return m_xWholeWordsBox->get_active(); }
63
0
    bool         IsMarchCase() const { return m_xMatchCaseBox->get_active(); }
64
0
    bool         IsWrapAround() const { return m_xWrapAroundBox->get_active(); }
65
0
    bool         IsSearchBackwards() const { return m_xBackwardsBox->get_active(); }
66
67
    void         SetFocusOnEdit();
68
};
69
70
} // namespace sfx2
71
72
73
#endif // INCLUDED_SFX2_INC_SRCHDLG_HXX
74
75
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */