Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / toolkit / inc / controls / filectrl.hxx
blob1330d0ce7cb577b2471c97e70b5285d95e98813d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <vcl/window.hxx>
23 #include <vcl/toolkit/button.hxx>
25 class Edit;
27 // Flags for internal use of FileControl
28 enum class FileControlMode_Internal
30 INRESIZE = 0x0001,
31 ORIGINALBUTTONTEXT = 0x0002,
34 namespace o3tl
36 template<> struct typed_flags<FileControlMode_Internal> : is_typed_flags<FileControlMode_Internal, 0x03> {};
40 class FileControl final : public vcl::Window
42 VclPtr<Edit> maEdit;
43 VclPtr<PushButton> maButton;
44 OUString maButtonText;
45 FileControlMode_Internal mnInternalFlags;
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 );
53 public:
54 FileControl( vcl::Window* pParent, WinBits nStyle );
55 virtual ~FileControl() override;
56 virtual void dispose() override;
58 Edit& GetEdit() { return *maEdit; }
59 PushButton& GetButton() { return *maButton; }
61 void Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
63 void SetText( const OUString& rStr ) override;
64 OUString GetText() const override;
66 void SetEditModifyHdl( const Link<Edit&,void>& rLink );
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */