1 2/* 3 * Copyright 2006 The Android Open Source Project 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9 10#ifndef SkStream_Win_DEFINED 11#define SkStream_Win_DEFINED 12 13#ifndef SK_BUILD_FOR_WIN 14#error "only valid for windows and wince builds" 15#endif 16 17#ifndef SkStream_DEFINED 18#include "SkStream.h" 19#endif 20#include "SkString.h" 21#include "Wininet.h" 22 23/** \cond ZERO */ 24class SkURLStream : public SkStream { 25public: 26 SkURLStream(const char url[] = NULL); 27 virtual ~SkURLStream(); 28 29 /** Close the current URL, and open a new URL. 30 If URL is null, just close the current URL. 31 */ 32 void setURL(const char url[]); 33 34 // overrides 35 virtual bool rewind(); 36 virtual size_t read(void* buffer, size_t size); 37 38private: 39 SkString fURL; 40 HINTERNET fConnection; 41 HINTERNET fURLStream; 42}; 43 44/** \endcond */ 45#endif // SkStream_Win_DEFINED 46 47