Coverage Report

Created: 2026-10-14 09:33

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/toolkit/inc/controls/filectrl.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/window.hxx>
23
#include <vcl/toolkit/button.hxx>
24
25
class Edit;
26
27
// Flags for internal use of FileControl
28
enum class FileControlMode_Internal
29
{
30
    INRESIZE               = 0x0001,
31
    ORIGINALBUTTONTEXT     = 0x0002,
32
};
33
34
namespace o3tl
35
{
36
    template<> struct typed_flags<FileControlMode_Internal> : is_typed_flags<FileControlMode_Internal, 0x03> {};
37
}
38
39
40
class FileControl final : public vcl::Window
41
{
42
    VclPtr<Edit>       maEdit;
43
    VclPtr<PushButton> maButton;
44
    OUString           maButtonText;
45
    FileControlMode_Internal    mnInternalFlags;
46
47
    void     Resize() override;
48
    void     GetFocus() override;
49
    void     StateChanged( StateChangedType nType ) override;
50
    WinBits  ImplInitStyle( WinBits nStyle );
51
    DECL_LINK( ButtonHdl, Button*, void );
52
53
public:
54
                    FileControl( vcl::Window* pParent, WinBits nStyle );
55
    virtual         ~FileControl() override;
56
    virtual void    dispose() override;
57
58
0
    Edit&           GetEdit() { return *maEdit; }
59
0
    PushButton&     GetButton() { return *maButton; }
60
61
    void Draw(OutputDevice& rDev, const Point& rPos, SystemTextColorFlags nFlags) override;
62
63
    void            SetText( const OUString& rStr ) override;
64
    OUString        GetText() const override;
65
66
    void            SetEditModifyHdl( const Link<Edit&,void>& rLink );
67
};
68
69
70
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */