mirror of
				https://bitbucket.org/chromiumembedded/cef
				synced 2025-06-05 21:39:12 +02:00 
			
		
		
		
	Add DLL build support and wrapper that allows clients to transparently switch between static and dynamic CEF builds.
- The libcef project now builds libcef_static.lib instead of libcef.lib. - The libcef_dll project builds libcef.lib and libcef.dll. This DLL exports the new CEF C API defined in cef_capi.h, cef_nplugin_capi.h, cef_string.h and cef_string_map.h. - The libcef_dll_wrapper project builds libcef_dll_wrapper.lib. This static library wraps the new C API calls with an implementation of the CEF C++ interface as defined in cef.h and cef_nplugin.h. - The cefclient project now uses the DLL instead of the static library. - Type definitions have been moved from cef.h to cef_types.h so that they can be shared by both cef.h and cef_capi.h. This change required some enumeration member name modifications throughout the code base. - Fixed variable naming inconsistencies. - Added CefVariant::GetArraySize() method and _NPN_ArrayObjectGetVectorSize() function. - Remove the ProjectSection(WebsiteProperties) sections from cef.sln to improve VS2005 performance. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@16 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
		
							
								
								
									
										85
									
								
								libcef_dll/ctocpp/request_ctocpp.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										85
									
								
								libcef_dll/ctocpp/request_ctocpp.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,85 @@
 | 
			
		||||
// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights
 | 
			
		||||
// reserved. Use of this source code is governed by a BSD-style license that
 | 
			
		||||
// can be found in the LICENSE file.
 | 
			
		||||
 | 
			
		||||
#ifndef _REQUEST_CTOCPP_H
 | 
			
		||||
#define _REQUEST_CTOCPP_H
 | 
			
		||||
 | 
			
		||||
#ifndef USING_CEF_SHARED
 | 
			
		||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
 | 
			
		||||
#else // USING_CEF_SHARED
 | 
			
		||||
 | 
			
		||||
#include "cef.h"
 | 
			
		||||
#include "cef_capi.h"
 | 
			
		||||
#include "ctocpp.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Wrap a C request structure with a C++ request class.
 | 
			
		||||
// This class may be instantiated and accessed wrapper-side only.
 | 
			
		||||
class CefRequestCToCpp : public CefCToCpp<CefRequest, cef_request_t>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  CefRequestCToCpp(cef_request_t* str)
 | 
			
		||||
    : CefCToCpp<CefRequest, cef_request_t>(str) {}
 | 
			
		||||
  virtual ~CefRequestCToCpp() {}
 | 
			
		||||
 | 
			
		||||
   // CefRequest methods
 | 
			
		||||
  virtual std::wstring GetURL();
 | 
			
		||||
  virtual void SetURL(const std::wstring& url);
 | 
			
		||||
  virtual std::wstring GetFrame();
 | 
			
		||||
  virtual void SetFrame(const std::wstring& url);
 | 
			
		||||
  virtual std::wstring GetMethod();
 | 
			
		||||
  virtual void SetMethod(const std::wstring& method);
 | 
			
		||||
  virtual CefRefPtr<CefPostData> GetPostData();
 | 
			
		||||
  virtual void SetPostData(CefRefPtr<CefPostData> postData);
 | 
			
		||||
  virtual void GetHeaderMap(HeaderMap& headerMap);
 | 
			
		||||
  virtual void SetHeaderMap(const HeaderMap& headerMap);
 | 
			
		||||
  virtual void Set(const std::wstring& url,
 | 
			
		||||
                   const std::wstring& frame,
 | 
			
		||||
                   const std::wstring& method,
 | 
			
		||||
                   CefRefPtr<CefPostData> postData,
 | 
			
		||||
                   const HeaderMap& headerMap);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Wrap a C post data structure with a C++ post data class.
 | 
			
		||||
// This class may be instantiated and accessed wrapper-side only.
 | 
			
		||||
class CefPostDataCToCpp : public CefCToCpp<CefPostData, cef_post_data_t>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  CefPostDataCToCpp(cef_post_data_t* str)
 | 
			
		||||
    : CefCToCpp<CefPostData, cef_post_data_t>(str) {}
 | 
			
		||||
  virtual ~CefPostDataCToCpp() {}
 | 
			
		||||
 | 
			
		||||
  // CefPostData methods
 | 
			
		||||
  virtual size_t GetElementCount();
 | 
			
		||||
  virtual void GetElements(ElementVector& elements);
 | 
			
		||||
  virtual bool RemoveElement(CefRefPtr<CefPostDataElement> element);
 | 
			
		||||
  virtual bool AddElement(CefRefPtr<CefPostDataElement> element);
 | 
			
		||||
  virtual void RemoveElements();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Wrap a C post data element structure with a C++ post data element class.
 | 
			
		||||
// This class may be instantiated and accessed wrapper-side only.
 | 
			
		||||
class CefPostDataElementCToCpp :
 | 
			
		||||
    public CefCToCpp<CefPostDataElement, cef_post_data_element_t>
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
  CefPostDataElementCToCpp(cef_post_data_element_t* str)
 | 
			
		||||
    : CefCToCpp<CefPostDataElement, cef_post_data_element_t>(str) {}
 | 
			
		||||
  virtual ~CefPostDataElementCToCpp() {}
 | 
			
		||||
 | 
			
		||||
  // CefPostDataElement methods
 | 
			
		||||
  virtual void SetToEmpty();
 | 
			
		||||
  virtual void SetToFile(const std::wstring& fileName);
 | 
			
		||||
  virtual void SetToBytes(size_t size, const void* bytes);
 | 
			
		||||
  virtual Type GetType();
 | 
			
		||||
  virtual std::wstring GetFile();
 | 
			
		||||
  virtual size_t GetBytesCount();
 | 
			
		||||
  virtual size_t GetBytes(size_t size, void *bytes);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif // USING_CEF_SHARED
 | 
			
		||||
#endif // _REQUEST_CTOCPP_H
 | 
			
		||||
		Reference in New Issue
	
	Block a user