Home | History | Annotate | Download | only in android
      1 /*
      2  * Copyright 2009, The Android Open Source Project
      3  *
      4  * Redistribution and use in source and binary forms, with or without
      5  * modification, are permitted provided that the following conditions
      6  * are met:
      7  *  * Redistributions of source code must retain the above copyright
      8  *    notice, this list of conditions and the following disclaimer.
      9  *  * Redistributions in binary form must reproduce the above copyright
     10  *    notice, this list of conditions and the following disclaimer in the
     11  *    documentation and/or other materials provided with the distribution.
     12  *
     13  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
     14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
     17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
     21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     24  */
     25 #define LOG_TAG "WebCore"
     26 
     27 #include "config.h"
     28 
     29 #define ANDROID_COMPILE_HACK
     30 
     31 #include "AXObjectCache.h"
     32 #include "CachedPage.h"
     33 #include "CachedResource.h"
     34 #include "Clipboard.h"
     35 #include "Console.h"
     36 #include "ContextMenu.h"
     37 #include "ContextMenuItem.h"
     38 #include "CookieJar.h"
     39 #include "CookieStorage.h"
     40 #include "Cursor.h"
     41 #include "Database.h"
     42 #include "DocumentFragment.h"
     43 #include "DocumentLoader.h"
     44 #include "EditCommand.h"
     45 #include "Editor.h"
     46 #include "File.h"
     47 #include "Font.h"
     48 #include "Frame.h"
     49 #include "FrameLoadRequest.h"
     50 #include "FrameLoader.h"
     51 #include "FrameView.h"
     52 #include "GraphicsContext.h"
     53 #include "HTMLFrameOwnerElement.h"
     54 #include "HTMLKeygenElement.h"
     55 #include "History.h"
     56 #include "Icon.h"
     57 #include "IconDatabase.h"
     58 #include "IconLoader.h"
     59 #include "IntPoint.h"
     60 #include "KURL.h"
     61 #include "Language.h"
     62 #include "LocalizedStrings.h"
     63 #include "MainResourceLoader.h"
     64 #include "Node.h"
     65 #include "NotImplemented.h"
     66 #include "PageCache.h"
     67 #include "Pasteboard.h"
     68 #include "Path.h"
     69 #include "ResourceError.h"
     70 #include "ResourceHandle.h"
     71 #include "ResourceLoader.h"
     72 #include "Screen.h"
     73 #include "Scrollbar.h"
     74 #include "ScrollbarTheme.h"
     75 #include "SmartReplace.h"
     76 #include "Widget.h"
     77 #include <stdio.h>
     78 #include <stdlib.h>
     79 #include <wtf/Assertions.h>
     80 #include <wtf/MainThread.h>
     81 #include <wtf/text/CString.h>
     82 
     83 using namespace WebCore;
     84 
     85 /********************************************************/
     86 /* Completely empty stubs (mostly to allow DRT to run): */
     87 /********************************************************/
     88 
     89 namespace WebCore {
     90 
     91 // This function tells the bridge that a resource was loaded from the cache and thus
     92 // the app may update progress with the amount of data loaded.
     93 void CheckCacheObjectStatus(CachedResourceLoader*, CachedResource*)
     94 {
     95     ASSERT_NOT_REACHED();
     96     notImplemented();
     97 }
     98 
     99 // This class is used in conjunction with the File Upload form element, and
    100 // therefore relates to the above. When a file has been selected, an icon
    101 // representing the file type can be rendered next to the filename on the
    102 // web page. The icon for the file is encapsulated within this class.
    103 Icon::~Icon() { }
    104 void Icon::paint(GraphicsContext*, const IntRect&) { }
    105 
    106 }  // namespace WebCore
    107 
    108 // FIXME, no support for spelling yet.
    109 Pasteboard* Pasteboard::generalPasteboard()
    110 {
    111     return new Pasteboard();
    112 }
    113 
    114 void Pasteboard::writeSelection(Range*, bool, Frame*)
    115 {
    116     notImplemented();
    117 }
    118 
    119 void Pasteboard::writePlainText(const String&)
    120 {
    121     notImplemented();
    122 }
    123 
    124 void Pasteboard::writeURL(const KURL&, const String&, Frame*)
    125 {
    126     notImplemented();
    127 }
    128 
    129 void Pasteboard::clear()
    130 {
    131     notImplemented();
    132 }
    133 
    134 bool Pasteboard::canSmartReplace()
    135 {
    136     notImplemented();
    137     return false;
    138 }
    139 
    140 PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame*, PassRefPtr<Range>, bool, bool&)
    141 {
    142     notImplemented();
    143     return 0;
    144 }
    145 
    146 String Pasteboard::plainText(Frame*)
    147 {
    148     notImplemented();
    149     return String();
    150 }
    151 
    152 Pasteboard::Pasteboard()
    153 {
    154     notImplemented();
    155 }
    156 
    157 ContextMenu::ContextMenu()
    158 {
    159     ASSERT_NOT_REACHED();
    160     notImplemented();
    161 }
    162 
    163 ContextMenu::~ContextMenu()
    164 {
    165     ASSERT_NOT_REACHED();
    166     notImplemented();
    167 }
    168 
    169 void ContextMenu::appendItem(ContextMenuItem&)
    170 {
    171     ASSERT_NOT_REACHED();
    172     notImplemented();
    173 }
    174 
    175 void ContextMenu::setPlatformDescription(PlatformMenuDescription menu)
    176 {
    177     ASSERT_NOT_REACHED();
    178     m_platformDescription = menu;
    179 }
    180 
    181 PlatformMenuDescription ContextMenu::platformDescription() const
    182 {
    183     ASSERT_NOT_REACHED();
    184     return m_platformDescription;
    185 }
    186 
    187 ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription)
    188 {
    189     ASSERT_NOT_REACHED();
    190     notImplemented();
    191 }
    192 
    193 ContextMenuItem::ContextMenuItem(ContextMenu*)
    194 {
    195     ASSERT_NOT_REACHED();
    196     notImplemented();
    197 }
    198 
    199 ContextMenuItem::ContextMenuItem(ContextMenuItemType, ContextMenuAction, const String&, ContextMenu*)
    200 {
    201     ASSERT_NOT_REACHED();
    202     notImplemented();
    203 }
    204 
    205 ContextMenuItem::~ContextMenuItem()
    206 {
    207     ASSERT_NOT_REACHED();
    208     notImplemented();
    209 }
    210 
    211 PlatformMenuItemDescription ContextMenuItem::releasePlatformDescription()
    212 {
    213     ASSERT_NOT_REACHED();
    214     notImplemented();
    215     return m_platformDescription;
    216 }
    217 
    218 ContextMenuItemType ContextMenuItem::type() const
    219 {
    220     ASSERT_NOT_REACHED();
    221     notImplemented();
    222     return ActionType;
    223 }
    224 
    225 void ContextMenuItem::setType(ContextMenuItemType)
    226 {
    227     ASSERT_NOT_REACHED();
    228     notImplemented();
    229 }
    230 
    231 ContextMenuAction ContextMenuItem::action() const
    232 {
    233     ASSERT_NOT_REACHED();
    234     notImplemented();
    235     return ContextMenuItemTagNoAction;
    236 }
    237 
    238 void ContextMenuItem::setAction(ContextMenuAction)
    239 {
    240     ASSERT_NOT_REACHED();
    241     notImplemented();
    242 }
    243 
    244 String ContextMenuItem::title() const
    245 {
    246     ASSERT_NOT_REACHED();
    247     notImplemented();
    248     return String();
    249 }
    250 
    251 void ContextMenuItem::setTitle(const String&)
    252 {
    253     ASSERT_NOT_REACHED();
    254     notImplemented();
    255 }
    256 
    257 PlatformMenuDescription ContextMenuItem::platformSubMenu() const
    258 {
    259     ASSERT_NOT_REACHED();
    260     notImplemented();
    261     return 0;
    262 }
    263 
    264 void ContextMenuItem::setSubMenu(ContextMenu*)
    265 {
    266     ASSERT_NOT_REACHED();
    267     notImplemented();
    268 }
    269 
    270 void ContextMenuItem::setChecked(bool)
    271 {
    272     ASSERT_NOT_REACHED();
    273     notImplemented();
    274 }
    275 
    276 void ContextMenuItem::setEnabled(bool)
    277 {
    278     ASSERT_NOT_REACHED();
    279     notImplemented();
    280 }
    281 
    282 // systemBeep() is called by the Editor to indicate that there was nothing to copy, and may be called from
    283 // other places too.
    284 void systemBeep()
    285 {
    286     notImplemented();
    287 }
    288 
    289 void* WebCore::Frame::dragImageForSelection()
    290 {
    291     return 0;
    292 }
    293 
    294 void WebCore::Pasteboard::writeImage(WebCore::Node*, WebCore::KURL const&, WTF::String const&) {}
    295 
    296 namespace WebCore {
    297 
    298 IntSize dragImageSize(void*)
    299 {
    300     return IntSize(0, 0);
    301 }
    302 
    303 void deleteDragImage(void*) {}
    304 void* createDragImageFromImage(Image*)
    305 {
    306     return 0;
    307 }
    308 
    309 void* dissolveDragImageToFraction(void*, float)
    310 {
    311     return 0;
    312 }
    313 
    314 void* createDragImageIconForCachedImage(CachedImage*)
    315 {
    316     return 0;
    317 }
    318 
    319 Cursor dummyCursor;
    320 const Cursor& zoomInCursor()
    321 {
    322     return dummyCursor;
    323 }
    324 
    325 const Cursor& zoomOutCursor()
    326 {
    327     return dummyCursor;
    328 }
    329 
    330 const Cursor& notAllowedCursor()
    331 {
    332     return dummyCursor;
    333 }
    334 
    335 void* scaleDragImage(void*, FloatSize)
    336 {
    337     return 0;
    338 }
    339 
    340 String searchMenuRecentSearchesText()
    341 {
    342     return String();
    343 }
    344 
    345 String searchMenuNoRecentSearchesText()
    346 {
    347     return String();
    348 }
    349 
    350 String searchMenuClearRecentSearchesText()
    351 {
    352     return String();
    353 }
    354 
    355 Vector<String> supportedKeySizes()
    356 {
    357     notImplemented();
    358     return Vector<String>();
    359 }
    360 
    361 } // namespace WebCore
    362 
    363 namespace WebCore {
    364 // isCharacterSmartReplaceExempt is defined in SmartReplaceICU.cpp; in theory, we could use that one
    365 //      but we don't support all of the required icu functions
    366 bool isCharacterSmartReplaceExempt(UChar32, bool)
    367 {
    368     notImplemented();
    369     return false;
    370 }
    371 
    372 }  // WebCore
    373 
    374 int MakeDataExecutable;
    375 
    376 String KURL::fileSystemPath() const
    377 {
    378     notImplemented();
    379     return String();
    380 }
    381 
    382 
    383 PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&)
    384 {
    385     notImplemented();
    386     return 0;
    387 }
    388 
    389 
    390 char* dirname(const char*)
    391 {
    392     notImplemented();
    393     return 0;
    394 }
    395 
    396     // new as of SVN change 38068, Nov 5, 2008
    397 namespace WebCore {
    398 void prefetchDNS(const String&)
    399 {
    400     notImplemented();
    401 }
    402 
    403 PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&)
    404 {
    405     notImplemented();
    406     return 0;
    407 }
    408 
    409 // ScrollbarTheme::nativeTheme() is called by RenderTextControl::calcPrefWidths()
    410 // like this: scrollbarSize = ScrollbarTheme::nativeTheme()->scrollbarThickness();
    411 // with this comment:
    412 // // FIXME: We should get the size of the scrollbar from the RenderTheme instead.
    413 // since our text control doesn't have scrollbars, the default size of 0 width should be
    414 // ok. notImplemented() is commented out below so that we can find other unresolved
    415 // unimplemented functions.
    416 ScrollbarTheme* ScrollbarTheme::nativeTheme()
    417 {
    418     /* notImplemented(); */
    419     static ScrollbarTheme theme;
    420     return &theme;
    421 }
    422 
    423 }  // namespace WebCore
    424 
    425 AXObjectCache::~AXObjectCache()
    426 {
    427     notImplemented();
    428 }
    429 
    430 // This value turns on or off the Mac specific Accessibility support.
    431 bool AXObjectCache::gAccessibilityEnabled = false;
    432 bool AXObjectCache::gAccessibilityEnhancedUserInterfaceEnabled = false;
    433 
    434 void AXObjectCache::childrenChanged(RenderObject*)
    435 {
    436     notImplemented();
    437 }
    438 
    439 void AXObjectCache::remove(RenderObject*)
    440 {
    441     notImplemented();
    442 }
    443 
    444 void AXObjectCache::remove(Widget*)
    445 {
    446     notImplemented();
    447 }
    448 
    449 namespace WebCore {
    450 
    451 void setCookieStoragePrivateBrowsingEnabled(bool)
    452 {
    453     notImplemented();
    454 }
    455 
    456 void startObservingCookieChanges()
    457 {
    458     notImplemented();
    459 }
    460 
    461 void stopObservingCookieChanges()
    462 {
    463     notImplemented();
    464 }
    465 
    466 } // namespace WebCore
    467