Coverage Report

Created: 2026-07-10 11:04

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