FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
axstream.h
1 /**********************************************************\
2 Original Author: Matthias (nitrogenycs)
3 
4 Created: Feb 28, 2010
5 License: Dual license model; choose one of two:
6  New BSD License
7  http://www.opensource.org/licenses/bsd-license.php
8  - or -
9  GNU Lesser General Public License, version 2.1
10  http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2010 Richard Bateman, Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef H_ACTIVEXSTREAM
17 #define H_ACTIVEXSTREAM
18 
19 #include "BrowserStream.h"
20 #include <set>
21 #include "boost/shared_ptr.hpp"
22 
23 namespace FB { namespace ActiveX {
24  class ActiveXBindStatusCallback;
25  class ActiveXStreamRequest;
26  typedef boost::shared_ptr<ActiveXStreamRequest> ActiveXStreamRequestPtr;
27 
28  class ActiveXStream : public FB::BrowserStream
29  {
30  public:
31  ActiveXStream(const std::string& url, bool cache, bool seekable, size_t internalBufferSize );
32  ActiveXStream(const std::string& url, bool cache, bool seekable, size_t internalBufferSize, const std::string& verbdata );
33  virtual ~ActiveXStream();
34 
35  virtual bool readRanges( const std::vector<Range>& ranges );
36  virtual bool write(const char* data, size_t dataLength, size_t& written);
37  virtual bool close();
38 
39  virtual std::string getVerbData() const;
40 
41  protected:
42  virtual bool init();
43  virtual bool addRequest( const ActiveXStreamRequest& request );
44 
45  virtual size_t signalDataArrived(void* buffer, size_t len, size_t offset);
46  virtual void signalOpened();
47  virtual void signalFailedOpen();
48  virtual void signalCompleted(bool success);
49  virtual void signalRequestCompleted(ActiveXStreamRequestPtr request, bool success);
50  virtual void signalCacheFilename(const std::wstring& cacheFilename);
51 
52  friend class ActiveXBrowserHost;
53  friend class ActiveXBindStatusCallback;
54 
55  protected:
56  std::set< ActiveXStreamRequestPtr > requests;
57  bool closing;
58  std::string data;
59  };
60  typedef boost::shared_ptr<ActiveXStream> ActiveXStreamPtr;
61 } }
62 
63 
64 #endif
65 
This is the abstract base class (interface class) for a browser stream.
Definition: BrowserStream.h:41