2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-15 17:28:16 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-10-23 19:14:56 +02:00
|
|
|
#ifndef INCLUDED_SVTOOLS_FILECTRL_HXX
|
|
|
|
#define INCLUDED_SVTOOLS_FILECTRL_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2013-11-09 15:40:46 -06:00
|
|
|
#include <svtools/svtdllapi.h>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <vcl/window.hxx>
|
|
|
|
#include <vcl/edit.hxx>
|
|
|
|
#include <vcl/button.hxx>
|
|
|
|
|
|
|
|
// Flags for internal use of FileControl
|
2015-04-17 13:53:28 +02:00
|
|
|
enum class FileControlMode_Internal
|
|
|
|
{
|
|
|
|
INRESIZE = 0x0001,
|
|
|
|
ORIGINALBUTTONTEXT = 0x0002,
|
|
|
|
};
|
2017-06-11 20:56:30 +01:00
|
|
|
|
2015-04-17 13:53:28 +02:00
|
|
|
namespace o3tl
|
|
|
|
{
|
|
|
|
template<> struct typed_flags<FileControlMode_Internal> : is_typed_flags<FileControlMode_Internal, 0x03> {};
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
2017-10-24 08:06:22 +02:00
|
|
|
class SVT_DLLPUBLIC FileControl final : public vcl::Window
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-01-12 15:16:05 +02:00
|
|
|
VclPtr<Edit> maEdit;
|
|
|
|
VclPtr<PushButton> maButton;
|
2017-10-24 08:06:22 +02:00
|
|
|
OUString maButtonText;
|
2000-09-18 16:07:07 +00:00
|
|
|
FileControlMode_Internal mnInternalFlags;
|
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
SVT_DLLPRIVATE void Resize() override;
|
|
|
|
SVT_DLLPRIVATE void GetFocus() override;
|
|
|
|
SVT_DLLPRIVATE void StateChanged( StateChangedType nType ) override;
|
2005-11-11 08:16:42 +00:00
|
|
|
SVT_DLLPRIVATE WinBits ImplInitStyle( WinBits nStyle );
|
2016-10-05 07:56:12 +02:00
|
|
|
DECL_DLLPRIVATE_LINK( ButtonHdl, Button*, void );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
public:
|
2016-04-01 15:43:18 +02:00
|
|
|
FileControl( vcl::Window* pParent, WinBits nStyle );
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~FileControl() override;
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void dispose() override;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-01-12 15:16:05 +02:00
|
|
|
Edit& GetEdit() { return *maEdit.get(); }
|
|
|
|
PushButton& GetButton() { return *maButton.get(); }
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawFlags nFlags ) override;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-10-12 16:04:04 +02:00
|
|
|
void SetText( const OUString& rStr ) override;
|
|
|
|
OUString GetText() const override;
|
2015-05-09 14:14:14 +01:00
|
|
|
|
2015-10-15 08:13:49 +02:00
|
|
|
void SetEditModifyHdl( const Link<Edit&,void>& rLink );
|
2000-09-18 16:07:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|