193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)/*
293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Copyright (C) 2009 Google Inc. All rights reserved.
393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without
593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * modification, are permitted provided that the following conditions are
693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * met:
793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Redistributions of source code must retain the above copyright
993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * notice, this list of conditions and the following disclaimer.
1093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Redistributions in binary form must reproduce the above
1193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer
1293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * in the documentation and/or other materials provided with the
1393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * distribution.
1493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Neither the name of Google Inc. nor the names of its
1593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * contributors may be used to endorse or promote products derived from
1693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * this software without specific prior written permission.
1793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
1893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) */
3093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#ifndef WebMimeRegistry_h
3293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#define WebMimeRegistry_h
3393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "WebCommon.h"
3593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink {
37e1f1df5f01594c0e62e751e4b46e779b85c2faa5Torne (Richard Coles)class WebString;
3893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebMimeRegistry {
4093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)public:
4193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    enum SupportsType { IsNotSupported, IsSupported, MayBeSupported };
4293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4351b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual SupportsType supportsMIMEType(const blink::WebString& mimeType) = 0;
4451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual SupportsType supportsImageMIMEType(const blink::WebString& mimeType) = 0;
4551b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual SupportsType supportsJavaScriptMIMEType(const blink::WebString& mimeType) = 0;
4651b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual SupportsType supportsMediaMIMEType(const blink::WebString& mimeType, const blink::WebString& codecs, const blink::WebString& keySystem) = 0;
4793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4851b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual bool supportsMediaSourceMIMEType(const blink::WebString& mimeType, const blink::WebString& codecs) = 0;
4993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
5051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual SupportsType supportsNonImageMIMEType(const blink::WebString& mimeType) = 0;
5193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
5251b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual blink::WebString mimeTypeForExtension(const blink::WebString& fileExtension) = 0;
5351b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual blink::WebString wellKnownMimeTypeForExtension(const blink::WebString& fileExtension) = 0;
5451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)    virtual blink::WebString mimeTypeFromFile(const blink::WebString& filePath) = 0;
5593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
5693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)protected:
5793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    ~WebMimeRegistry() { }
5893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)};
5993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
6051b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink
6193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
6293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#endif
63