]> git.saurik.com Git - wxWidgets.git/blob - wxPython/contrib/activex/wxie/IEHtmlStream.h
Assert correction.
[wxWidgets.git] / wxPython / contrib / activex / wxie / IEHtmlStream.h
1 /*
2 wxActiveX Library Licence, Version 3
3 ====================================
4
5 Copyright (C) 2003 Lindsay Mathieson [, ...]
6
7 Everyone is permitted to copy and distribute verbatim copies
8 of this licence document, but changing it is not allowed.
9
10 wxActiveX LIBRARY LICENCE
11 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12
13 This library is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Library General Public Licence as published by
15 the Free Software Foundation; either version 2 of the Licence, or (at
16 your option) any later version.
17
18 This library is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
21 General Public Licence for more details.
22
23 You should have received a copy of the GNU Library General Public Licence
24 along with this software, usually in a file named COPYING.LIB. If not,
25 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
26 Boston, MA 02111-1307 USA.
27
28 EXCEPTION NOTICE
29
30 1. As a special exception, the copyright holders of this library give
31 permission for additional uses of the text contained in this release of
32 the library as licenced under the wxActiveX Library Licence, applying
33 either version 3 of the Licence, or (at your option) any later version of
34 the Licence as published by the copyright holders of version 3 of the
35 Licence document.
36
37 2. The exception is that you may use, copy, link, modify and distribute
38 under the user's own terms, binary object code versions of works based
39 on the Library.
40
41 3. If you copy code from files distributed under the terms of the GNU
42 General Public Licence or the GNU Library General Public Licence into a
43 copy of this library, as this licence permits, the exception does not
44 apply to the code that you add in this way. To avoid misleading anyone as
45 to the status of such modified files, you must delete this exception
46 notice from such code and/or adjust the licensing conditions notice
47 accordingly.
48
49 4. If you write modifications of your own for this library, it is your
50 choice whether to permit this exception to apply to your modifications.
51 If you do not wish that, you must delete the exception notice from such
52 code and/or adjust the licensing conditions notice accordingly.
53 */
54
55 // This module contains the declarations of the stream adapters and such that
56 // used to be in IEHtmlWin.cpp, so that they can be used independently in the
57 // wxPython wrappers...
58
59
60 #ifndef _IEHTMLSTREAM_H_
61 #define _IEHTMLSTREAM_H_
62
63
64 class IStreamAdaptorBase : public IStream
65 {
66 private:
67 DECLARE_OLE_UNKNOWN(IStreamAdaptorBase);
68
69 public:
70 string prepend;
71
72 IStreamAdaptorBase() {}
73 virtual ~IStreamAdaptorBase() {}
74
75 virtual int Read(char *buf, int cb) = 0;
76
77 // ISequentialStream
78 HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead);
79
80 HRESULT STDMETHODCALLTYPE Write(const void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbWritten) {return E_NOTIMPL;}
81
82 // IStream
83 HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER __RPC_FAR *plibNewPosition) {return E_NOTIMPL;}
84 HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize) {return E_NOTIMPL;}
85 HRESULT STDMETHODCALLTYPE CopyTo(IStream __RPC_FAR *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER __RPC_FAR *pcbRead, ULARGE_INTEGER __RPC_FAR *pcbWritten) {return E_NOTIMPL;}
86 HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags) {return E_NOTIMPL;}
87 HRESULT STDMETHODCALLTYPE Revert(void) {return E_NOTIMPL;}
88 HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;}
89 HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;}
90 HRESULT STDMETHODCALLTYPE Stat(STATSTG __RPC_FAR *pstatstg, DWORD grfStatFlag) {return E_NOTIMPL;}
91 HRESULT STDMETHODCALLTYPE Clone(IStream __RPC_FAR *__RPC_FAR *ppstm) {return E_NOTIMPL;}
92 };
93
94
95
96 class IStreamAdaptor : public IStreamAdaptorBase
97 {
98 private:
99 istream *m_is;
100
101 public:
102 IStreamAdaptor(istream *is);
103 ~IStreamAdaptor();
104 int Read(char *buf, int cb);
105 };
106
107
108
109 class IwxStreamAdaptor : public IStreamAdaptorBase
110 {
111 private:
112 wxInputStream *m_is;
113
114 public:
115 IwxStreamAdaptor(wxInputStream *is);
116 ~IwxStreamAdaptor();
117 int Read(char *buf, int cb);
118 };
119
120
121 class wxOwnedMemInputStream : public wxMemoryInputStream
122 {
123 public:
124 char *m_data;
125
126 wxOwnedMemInputStream(char *data, size_t len);
127 ~wxOwnedMemInputStream();
128 };
129
130
131 wxAutoOleInterface<IHTMLTxtRange> wxieGetSelRange(IOleObject *oleObject);
132
133 #endif