| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #ifndef RenderFileUploadControl_h | 21 #ifndef RenderFileUploadControl_h |
| 22 #define RenderFileUploadControl_h | 22 #define RenderFileUploadControl_h |
| 23 | 23 |
| 24 #include "FileChooser.h" | 24 #include "FileChooser.h" |
| 25 #include "RenderBlock.h" | 25 #include "RenderBlock.h" |
| 26 | 26 |
| 27 namespace WebCore { | 27 namespace WebCore { |
| 28 | 28 |
| 29 class Chrome; | 29 class Chrome; |
| 30 class HTMLInputElement; | 30 class HTMLInputElement; |
| 31 | 31 |
| 32 // Each RenderFileUploadControl contains a RenderButton (for opening the file ch
ooser), and | 32 // Each RenderFileUploadControl contains a RenderButton (for opening the file ch
ooser), and |
| 33 // sufficient space to draw a file icon and filename. The RenderButton has a sha
dow node | 33 // sufficient space to draw a file icon and filename. The RenderButton has a sha
dow node |
| 34 // associated with it to receive click/hover events. | 34 // associated with it to receive click/hover events. |
| 35 | 35 |
| 36 class RenderFileUploadControl : public RenderBlock, private FileChooserClient { | 36 class RenderFileUploadControl : public RenderBlock, private FileChooserClient { |
| 37 public: | 37 public: |
| 38 RenderFileUploadControl(HTMLInputElement*); | 38 RenderFileUploadControl(HTMLInputElement*); |
| 39 virtual ~RenderFileUploadControl(); | 39 virtual ~RenderFileUploadControl(); |
| 40 | 40 |
| 41 virtual bool isFileUploadControl() const { return true; } | 41 virtual bool isFileUploadControl() const { return true; } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 64 bool allowsMultipleFiles(); | 64 bool allowsMultipleFiles(); |
| 65 #if ENABLE(DIRECTORY_UPLOAD) | 65 #if ENABLE(DIRECTORY_UPLOAD) |
| 66 bool allowsDirectoryUpload(); | 66 bool allowsDirectoryUpload(); |
| 67 #endif | 67 #endif |
| 68 String acceptTypes(); | 68 String acceptTypes(); |
| 69 void chooseIconForFiles(FileChooser*, const Vector<String>&); | 69 void chooseIconForFiles(FileChooser*, const Vector<String>&); |
| 70 | 70 |
| 71 Chrome* chrome() const; | 71 Chrome* chrome() const; |
| 72 int maxFilenameWidth() const; | 72 int maxFilenameWidth() const; |
| 73 PassRefPtr<RenderStyle> createButtonStyle(const RenderStyle* parentStyle) co
nst; | 73 PassRefPtr<RenderStyle> createButtonStyle(const RenderStyle* parentStyle) co
nst; |
| 74 |
| 75 virtual VisiblePosition positionForPoint(const IntPoint&); |
| 74 | 76 |
| 75 RefPtr<HTMLInputElement> m_button; | 77 RefPtr<HTMLInputElement> m_button; |
| 76 RefPtr<FileChooser> m_fileChooser; | 78 RefPtr<FileChooser> m_fileChooser; |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 inline RenderFileUploadControl* toRenderFileUploadControl(RenderObject* object) | 81 inline RenderFileUploadControl* toRenderFileUploadControl(RenderObject* object) |
| 80 { | 82 { |
| 81 ASSERT(!object || object->isFileUploadControl()); | 83 ASSERT(!object || object->isFileUploadControl()); |
| 82 return static_cast<RenderFileUploadControl*>(object); | 84 return static_cast<RenderFileUploadControl*>(object); |
| 83 } | 85 } |
| 84 | 86 |
| 85 inline const RenderFileUploadControl* toRenderFileUploadControl(const RenderObje
ct* object) | 87 inline const RenderFileUploadControl* toRenderFileUploadControl(const RenderObje
ct* object) |
| 86 { | 88 { |
| 87 ASSERT(!object || object->isFileUploadControl()); | 89 ASSERT(!object || object->isFileUploadControl()); |
| 88 return static_cast<const RenderFileUploadControl*>(object); | 90 return static_cast<const RenderFileUploadControl*>(object); |
| 89 } | 91 } |
| 90 | 92 |
| 91 // This will catch anyone doing an unnecessary cast. | 93 // This will catch anyone doing an unnecessary cast. |
| 92 void toRenderFileUploadControl(const RenderFileUploadControl*); | 94 void toRenderFileUploadControl(const RenderFileUploadControl*); |
| 93 | 95 |
| 94 } // namespace WebCore | 96 } // namespace WebCore |
| 95 | 97 |
| 96 #endif // RenderFileUploadControl_h | 98 #endif // RenderFileUploadControl_h |
| OLD | NEW |