Home | History | Annotate | Download | only in ports
      1 /*
      2  * Copyright (C) 2006 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef SkStream_Win_DEFINED
     18 #define SkStream_Win_DEFINED
     19 
     20 #ifndef SK_BUILD_FOR_WIN
     21 #error "only valid for windows and wince builds"
     22 #endif
     23 
     24 #ifndef SkStream_DEFINED
     25 #include "SkStream.h"
     26 #endif
     27 #include "SkString.h"
     28 #include "Wininet.h"
     29 
     30 /** \cond ZERO */
     31 class SkURLStream : public SkStream {
     32 public:
     33     SkURLStream(const char url[] = NULL);
     34     virtual ~SkURLStream();
     35 
     36     /** Close the current URL, and open a new URL.
     37         If URL is null, just close the current URL.
     38     */
     39     void setURL(const char url[]);
     40 
     41     // overrides
     42     virtual bool rewind();
     43     virtual size_t read(void* buffer, size_t size);
     44 
     45 private:
     46     SkString fURL;
     47     HINTERNET fConnection;
     48     HINTERNET fURLStream;
     49 };
     50 
     51 /** \endcond */
     52 #endif // SkStream_Win_DEFINED
     53 
     54