#ifndef FileInputType_h
#define FileInputType_h
#include "BaseClickableWithKeyInputType.h"
#include "FileChooser.h"
#include "FileIconLoader.h"
#include <wtf/RefPtr.h>
namespace WebCore {
class DragData;
class FileList;
class Icon;
class FileInputType final : public BaseClickableWithKeyInputType, private FileChooserClient, private FileIconLoaderClient {
public:
explicit FileInputType(HTMLInputElement&);
virtual ~FileInputType();
static Vector<FileChooserFileInfo> filesFromFormControlState(const FormControlState&);
private:
const AtomicString& formControlType() const override;
FormControlState saveFormControlState() const override;
void restoreFormControlState(const FormControlState&) override;
bool appendFormData(FormDataList&, bool) const override;
bool valueMissing(const String&) const override;
String valueMissingText() const override;
void handleDOMActivateEvent(Event*) override;
RenderPtr<RenderElement> createInputRenderer(RenderStyle&&) override;
bool canSetStringValue() const override;
bool canChangeFromAnotherType() const override;
FileList* files() override;
void setFiles(PassRefPtr<FileList>) override;
#if PLATFORM(IOS)
String displayString() const override;
#endif
bool canSetValue(const String&) override;
bool getTypeSpecificValue(String&) override; void setValue(const String&, bool valueChanged, TextFieldEventBehavior) override;
#if ENABLE(DRAG_SUPPORT)
bool receiveDroppedFiles(const DragData&) override;
#endif
Icon* icon() const override;
bool isFileUpload() const override;
void createShadowSubtree() override;
void disabledAttributeChanged() override;
void multipleAttributeChanged() override;
String defaultToolTip() const override;
void filesChosen(const Vector<FileChooserFileInfo>&) override;
#if PLATFORM(IOS)
void filesChosen(const Vector<FileChooserFileInfo>&, const String& displayString, Icon*) override;
#endif
void updateRendering(PassRefPtr<Icon>) override;
PassRefPtr<FileList> createFileList(const Vector<FileChooserFileInfo>& files) const;
void requestIcon(const Vector<String>&);
void applyFileChooserSettings(const FileChooserSettings&);
RefPtr<FileChooser> m_fileChooser;
#if !PLATFORM(IOS)
std::unique_ptr<FileIconLoader> m_fileIconLoader;
#endif
RefPtr<FileList> m_fileList;
RefPtr<Icon> m_icon;
#if PLATFORM(IOS)
String m_displayString;
#endif
};
}
#endif // FileInputType_h