2023-01-18 17:12:13 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Cameron Youell <cameronyouell@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-05-31 04:44:16 +03:00
|
|
|
#include "AutoComplete.h"
|
|
|
|
#include <AK/OwnPtr.h>
|
2023-01-18 17:12:13 +03:00
|
|
|
#include <QLineEdit>
|
|
|
|
|
2023-08-02 20:52:59 +03:00
|
|
|
namespace Ladybird {
|
|
|
|
|
2023-01-18 17:12:13 +03:00
|
|
|
class LocationEdit final : public QLineEdit {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-01-23 06:11:01 +03:00
|
|
|
explicit LocationEdit(QWidget*);
|
|
|
|
|
2024-06-10 12:33:35 +03:00
|
|
|
URL::URL url() const { return m_url; }
|
|
|
|
void set_url(URL::URL const&);
|
|
|
|
|
|
|
|
bool url_is_hidden() const { return m_url_is_hidden; }
|
|
|
|
void set_url_is_hidden(bool url_is_hidden) { m_url_is_hidden = url_is_hidden; }
|
|
|
|
|
2023-01-23 06:11:01 +03:00
|
|
|
private:
|
|
|
|
virtual void focusInEvent(QFocusEvent* event) override;
|
|
|
|
virtual void focusOutEvent(QFocusEvent* event) override;
|
|
|
|
|
|
|
|
void highlight_location();
|
2023-05-31 04:44:16 +03:00
|
|
|
AK::OwnPtr<AutoComplete> m_autocomplete;
|
2024-06-10 12:33:35 +03:00
|
|
|
|
|
|
|
URL::URL m_url;
|
|
|
|
bool m_url_is_hidden { false };
|
2023-01-18 17:12:13 +03:00
|
|
|
};
|
2023-08-02 20:52:59 +03:00
|
|
|
|
|
|
|
}
|