]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/dialup.tex
added copy constr
[wxWidgets.git] / docs / latex / wx / dialup.tex
CommitLineData
f6bcfd97
BP
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: dialup.tex
3%% Purpose: wxDialUpManager documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 08.04.00
7%% RCS-ID: $Id$
8%% Copyright: (c) Vadim Zeitlin
8795498c 9%% License: wxWindows license
f6bcfd97
BP
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxDialUpManager}}\label{wxdialupmanager}
13
2edb0bde 14This class encapsulates functions dealing with verifying the connection status
f6bcfd97
BP
15of the workstation (connected to the Internet via a direct connection,
16connected through a modem or not connected at all) and to establish this
17connection if possible/required (i.e. in the case of the modem).
18
19The program may also wish to be notified about the change in the connection
20status (for example, to perform some action when the user connects to the
21network the next time or, on the contrary, to stop receiving data from the net
22when the user hangs up the modem). For this, you need to use one of the event
23macros described below.
24
fc2171bd 25This class is different from other wxWidgets classes in that there is at most
f6bcfd97
BP
26one instance of this class in the program accessed via
27\helpref{wxDialUpManager::Create()}{wxdialupmanagercreate} and you can't
28create the objects of this class directly.
29
30\wxheading{Derived from}
31
32No base class
33
34\wxheading{Include files}
35
36<wx/dialup.h>
37
a7af285d
VZ
38\wxheading{Library}
39
40\helpref{wxCore}{librarieslist}
41
f6bcfd97
BP
42\wxheading{Event table macros}
43
44To be notified about the change in the network connection status, use these
45event handler macros to direct input to member functions that take a
46\helpref{wxDialUpEvent}{wxdialupevent} argument.
47
48\twocolwidtha{7cm}
49\begin{twocollist}\itemsep=0pt
50\twocolitem{{\bf EVT\_DIALUP\_CONNECTED(func)}}{A connection with the network was established.}
51\twocolitem{{\bf EVT\_DIALUP\_DISCONNECTED(func)}}{The connection with the network was lost.}
52\end{twocollist}%
53
54\wxheading{See also}
55
56\helpref{dialup sample}{sampledialup}\\
57\helpref{wxDialUpEvent}{wxdialupevent}
58
59\latexignore{\rtfignore{\wxheading{Members}}}
60
61\membersection{wxDialUpManager::Create}\label{wxdialupmanagercreate}
62
63\func{wxDialUpManager*}{Create}{\void}
64
65This function should create and return the object of the platform-specific
66class derived from wxDialUpManager. You should delete the pointer when you are
67done with it.
68
69\membersection{wxDialUpManager::IsOk}\label{wxdialupmanagerisok}
70
71\constfunc{bool}{IsOk}{\void}
72
cc81d32f
VS
73Returns {\tt true} if the dialup manager was initialized correctly. If this
74function returns {\tt false}, no other functions will work neither, so it is a
f6bcfd97
BP
75good idea to call this function and check its result before calling any other
76wxDialUpManager methods
77
78\membersection{wxDialUpManager::\destruct{wxDialUpManager}}\label{wxdialupmanagerdtor}
79
80\func{}{\destruct{wxDialUpManager}}{\void}
81
82Destructor.
83
84\membersection{wxDialUpManager::GetISPNames}\label{wxdialupmanagergetispnames}
85
86\constfunc{size\_t}{GetISPNames}{\param{wxArrayString\& }{names}}
87
88This function is only implemented under Windows.
89
90Fills the array with the names of all possible values for the first
91parameter to \helpref{Dial()}{wxdialupmanagerdial} on this machine and returns
92their number (may be $0$).
93
94\membersection{wxDialUpManager::Dial}\label{wxdialupmanagerdial}
95
cc81d32f 96\func{bool}{Dial}{\param{const wxString\& }{nameOfISP = wxEmptyString}, \param{const wxString\& }{username = wxEmptyString}, \param{const wxString\& }{password = wxEmptyString}, \param{bool }{async = true}}
f6bcfd97 97
2edb0bde 98Dial the given ISP, use {\it username} and {\it password} to authenticate.
f6bcfd97
BP
99
100The parameters are only used under Windows currently, for Unix you should use
101\helpref{SetConnectCommand}{wxdialupmanagersetconnectcommand} to customize this
102functions behaviour.
103
104If no {\it nameOfISP} is given, the function will select the default one
105(proposing the user to choose among all connections defined on this machine)
106and if no username and/or password are given, the function will try to do
107without them, but will ask the user if really needed.
108
cc81d32f
VS
109If {\it async} parameter is {\tt false}, the function waits until the end of dialing
110and returns {\tt true} upon successful completion.
f6bcfd97 111
cc81d32f 112If {\it async} is {\tt true}, the function only initiates the connection and
f6bcfd97
BP
113returns immediately - the result is reported via events (an event is sent
114anyhow, but if dialing failed it will be a DISCONNECTED one).
115
116\membersection{wxDialUpManager::IsDialing}\label{wxdialupmanagerisdialing}
117
118\constfunc{bool}{IsDialing}{\void}
119
cc81d32f 120Returns true if (async) dialing is in progress.
f6bcfd97
BP
121
122\wxheading{See also}
123
124\helpref{Dial}{wxdialupmanagerdial}
125
126\membersection{wxDialUpManager::CancelDialing}\label{wxdialupmanagercanceldialing}
127
128\func{bool}{CancelDialing}{\void}
129
130Cancel dialing the number initiated with \helpref{Dial}{wxdialupmanagerdial}
cc81d32f 131with async parameter equal to {\tt true}.
f6bcfd97
BP
132
133Note that this won't result in DISCONNECTED event being sent.
134
135\wxheading{See also}
136
137\helpref{IsDialing}{wxdialupmanagerisdialing}
138
139\membersection{wxDialUpManager::HangUp}\label{wxdialupmanagerhangup}
140
141\func{bool}{HangUp}{\void}
142
143Hang up the currently active dial up connection.
144
145\membersection{wxDialUpManager::IsAlwaysOnline}\label{wxdialupmanagerisalwaysonline}
146
147\constfunc{bool}{IsAlwaysOnline}{\void}
148
cc81d32f 149Returns {\tt true} if the computer has a permanent network connection (i.e. is
f6bcfd97
BP
150on a LAN) and so there is no need to use Dial() function to go online.
151
152{\bf NB:} this functions tries to guess the result and it is not always
153guaranteed to be correct, so it is better to ask user for
154confirmation or give him a possibility to override it.
155
156\membersection{wxDialUpManager::IsOnline}\label{wxdialupmanagerisonline}
157
158\constfunc{bool}{IsOnline}{\void}
159
cc81d32f 160Returns {\tt true} if the computer is connected to the network: under Windows,
f6bcfd97
BP
161this just means that a RAS connection exists, under Unix we check that
162the "well-known host" (as specified by
163\helpref{SetWellKnownHost}{wxdialupmanagersetwellknownhost}) is reachable.
164
165\membersection{wxDialUpManager::SetOnlineStatus}\label{wxdialupmanagersetonlinestatus}
166
cc81d32f 167\func{void}{SetOnlineStatus}{\param{bool }{isOnline = true}}
f6bcfd97
BP
168
169Sometimes the built-in logic for determining the online status may fail,
170so, in general, the user should be allowed to override it. This function
171allows to forcefully set the online status - whatever our internal
172algorithm may think about it.
173
174\wxheading{See also}
175
176\helpref{IsOnline}{wxdialupmanagerisonline}
177
178\membersection{wxDialUpManager::EnableAutoCheckOnlineStatus}\label{wxdialupmanagerenableautocheckonlinestatus}
179
180\func{bool}{EnableAutoCheckOnlineStatus}{\param{size\_t }{nSeconds = 60}}
181
2edb0bde 182Enable automatic checks for the connection status and sending of
f6bcfd97
BP
183{\tt wxEVT\_DIALUP\_CONNECTED/wxEVT\_DIALUP\_DISCONNECTED} events. The interval
184parameter is only for Unix where we do the check manually and specifies how
185often should we repeat the check (each minute by default). Under Windows, the
186notification about the change of connection status is sent by the system and so
187we don't do any polling and this parameter is ignored.
188
cc81d32f 189Returns {\tt false} if couldn't set up automatic check for online status.
f6bcfd97
BP
190
191\membersection{wxDialUpManager::DisableAutoCheckOnlineStatus}\label{wxdialupmanagerdisableautocheckonlinestatus}
192
193\func{void}{DisableAutoCheckOnlineStatus}{\void}
194
195Disable automatic check for connection status change - notice that the
196{\tt wxEVT\_DIALUP\_XXX} events won't be sent any more neither.
197
198\membersection{wxDialUpManager::SetWellKnownHost}\label{wxdialupmanagersetwellknownhost}
199
200\func{void}{SetWellKnownHost}{\param{const wxString\& }{hostname}, \param{int }{portno = 80}}
201
202This method is for Unix only.
203
204Under Unix, the value of well-known host is used to check whether we're
205connected to the internet. It is unused under Windows, but this function
206is always safe to call. The default value is {\tt www.yahoo.com:80}.
207
208\membersection{wxDialUpManager::SetConnectCommand}\label{wxdialupmanagersetconnectcommand}
209
0e10e38d 210\func{void}{SetConnectCommand}{\param{const wxString\& }{commandDial = wxT("/usr/bin/pon")}, \param{const wxString\& }{commandHangup = wxT("/usr/bin/poff")}}
f6bcfd97
BP
211
212This method is for Unix only.
213
214Sets the commands to start up the network and to hang up again.
215
216\wxheading{See also}
217
218\helpref{Dial}{wxdialupmanagerdial}
219