forked from jonmmorgan/wxwebconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnsutils.h
115 lines (87 loc) · 4.12 KB
/
nsutils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
///////////////////////////////////////////////////////////////////////////////
// Name: nsutils.h
// Purpose: wxwebconnect: embedded web browser control library
// Author: Benjamin I. Williams
// Modified by:
// Created: 2006-10-08
// RCS-ID:
// Copyright: (C) Copyright 2006-2010, Kirix Corporation, All Rights Reserved.
// Licence: wxWindows Library Licence, Version 3.1
///////////////////////////////////////////////////////////////////////////////
#ifndef __WXWEBCONNECT_NSUTILS_H
#define __WXWEBCONNECT_NSUTILS_H
wxString ns2wx(nsEmbedCString& str);
wxString ns2wx(nsEmbedString& str);
wxString ns2wx(const PRUnichar* str);
void wx2ns(const wxString& wxstr, nsEmbedString& nsstr);
void wx2ns(const wxString& wxstr, nsEmbedCString& nsstr);
PRUnichar* wxToUnichar(const wxString& wxstr);
void freeUnichar(PRUnichar* p);
ns_smartptr<nsIWindowWatcher> nsGetWindowWatcherService();
ns_smartptr<nsIPrefService> nsGetPrefService();
ns_smartptr<nsIPrefBranch> nsGetPrefBranch(const wxString& branch_name);
ns_smartptr<nsIProperties> nsGetDirectoryService();
ns_smartptr<nsISupports> nsGetService(const char* contract_id);
ns_smartptr<nsISupports> nsCreateInstance(const char* contract_id);
ns_smartptr<nsISupports> nsCreateInstance(const nsCID& cid);
ns_smartptr<nsILocalFile> nsNewLocalFile(const wxString& filename);
ns_smartptr<nsIURI> nsNewURI(const wxString& spec);
class wxWebProgressBase;
class ProgressListenerAdaptor : public nsITransfer
{
public:
NS_DECL_ISUPPORTS
ProgressListenerAdaptor(wxWebProgressBase* progress);
~ProgressListenerAdaptor();
void ClearProgressReference()
{
m_progress = NULL;
}
NS_IMETHODIMP Init(nsIURI* source,
nsIURI* target,
const nsAString& display_name,
nsIMIMEInfo* mime_info,
PRTime start_time,
nsILocalFile* temp_file,
nsICancelable* cancelable);
NS_IMETHOD OnStateChange(nsIWebProgress* web_progress,
nsIRequest* request,
PRUint32 state_flags,
nsresult status);
NS_IMETHOD OnProgressChange(nsIWebProgress* web_progress,
nsIRequest* request,
PRInt32 cur_self_progress,
PRInt32 max_self_progress,
PRInt32 cur_total_progress,
PRInt32 max_total_progress);
NS_IMETHOD OnProgressChange64(
nsIWebProgress* web_progress,
nsIRequest* request,
PRInt64 cur_self_progress,
PRInt64 max_self_progress,
PRInt64 cur_total_progress,
PRInt64 max_total_progress);
NS_IMETHOD OnLocationChange(
nsIWebProgress* web_progress,
nsIRequest* request,
nsIURI* location);
NS_IMETHOD OnStatusChange(
nsIWebProgress* web_progress,
nsIRequest* request,
nsresult status,
const PRUnichar* message);
NS_IMETHOD OnSecurityChange(
nsIWebProgress* web_progress,
nsIRequest* request,
PRUint32 state);
NS_IMETHOD OnRefreshAttempted(
nsIWebProgress* web_progress,
nsIURI* refresh_uri,
PRInt32 millis,
PRBool same_uri,
PRBool *retval);
public:
wxWebProgressBase* m_progress;
};
nsIWebProgressListener* CreateProgressListenerAdaptor(wxWebProgressBase* progress);
#endif