OpGenericDownload Class Reference

#include <gendwnd.h>

Inheritance diagram for OpGenericDownload:

DownloadOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpGenericDownload ()
virtual ~OpGenericDownload ()
virtual BOOL OnDocChangingMsg (Document *pChangingDoc, DocChangingMsg::DocState State)
 End (abort) the operation when for instance the current document has been destroyed while downloading.

Static Public Member Functions

static BOOL Init ()
static OpState GetState (String_256 *, OpDescriptor *)

Protected Member Functions

virtual void OnDownloadSuccess ()
 Function called when the download has finished and is success.
virtual void OnDownloadFail ()
 Function called when the download has failed.
virtual void OnDownloadAbort ()
 Function called when the use abort download.

Detailed Description

Definition at line 151 of file gendwnd.h.


Constructor & Destructor Documentation

OpGenericDownload::OpGenericDownload  )  [inline]
 

Definition at line 156 of file gendwnd.h.

00156 {};

virtual OpGenericDownload::~OpGenericDownload  )  [inline, virtual]
 

Definition at line 157 of file gendwnd.h.

00157 {};


Member Function Documentation

OpState OpGenericDownload::GetState String_256 ,
OpDescriptor
[static]
 

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/04/97
Parameters:
[INPUTS] 
Returns:

Errors:

Reimplemented from DownloadOp.

Definition at line 192 of file gendwnd.cpp.

00193 {
00194     OpState OpSt;
00195     return(OpSt);
00196 }

BOOL OpGenericDownload::Init void   )  [static]
 

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/04/97
Parameters:
[INPUTS] 
Returns:
TRUE if the Init worked ok

Errors:

Reimplemented from DownloadOp.

Definition at line 163 of file gendwnd.cpp.

00164 {
00165     return RegisterOpDescriptor(
00166         0,                                  // Tool ID
00167         _R(IDS_OPGENERICDOWNLOAD),                      // String resource ID
00168         CC_RUNTIME_CLASS(OpGenericDownload),    // Runtime class
00169         OPTOKEN_OPGENERICDOWNLOAD,                  // Token string
00170         OpGenericDownload::GetState,            // GetState function
00171         0,                                  // Help ID
00172         0,                                  // Bubble ID
00173         0,                                  // Resource ID
00174         0                                   // Control ID
00175     );
00176 }

BOOL OpGenericDownload::OnDocChangingMsg Document pChangingDoc,
DocChangingMsg::DocState  State
[virtual]
 

End (abort) the operation when for instance the current document has been destroyed while downloading.

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/05/97
Parameters:
pChangingDoc - [INPUTS] State -
Returns:

Errors:

Reimplemented from MessageHandler.

Definition at line 214 of file gendwnd.cpp.

00215 {
00216     GenericDownloadParam* pGenericParam = (GenericDownloadParam*) pParam;
00217     Document* pCurDoc = pGenericParam->pDoc;
00218 
00219     if (pParam != NULL)
00220     {
00221         if (State == DocChangingMsg::ABOUTTODIE && pChangingDoc == pCurDoc)
00222         {
00223 //          Document::SetSelectedViewAndSpread(pCurDoc);
00224 //          SelOperation* Op = pGenericParam->m_Op;
00225 //          ((OpMenuImport*)Op)->EndImport();
00226 
00227             // end of the download op
00228             FailAndExecute(); 
00229             End();
00230         }
00231     }
00232 
00233     return TRUE;
00234 }

void OpGenericDownload::OnDownloadAbort  )  [protected, virtual]
 

Function called when the use abort download.

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/05/97
Parameters:
[INPUTS] 
Returns:

Errors:

Reimplemented from DownloadOp.

Definition at line 323 of file gendwnd.cpp.

00324 {
00325 
00326     // get a pointer to the OpParam so that I can retrieve some useful information
00327     GenericDownloadParam* pGenericParam = (GenericDownloadParam*) pParam;
00328 
00329     String_256 GenericFile = pGenericParam->strURL;
00330     if (IsUserName("Olivier"))
00331         TRACE1("OpGenericDownload::OnDownloadAbort(), file = %s\n", (TCHAR*)GenericFile);
00332 
00333     // stop the import op
00334     SelOperation* Op = pGenericParam->m_Op;
00335     ((OpMenuImport*)Op)->EndImport();
00336 }

void OpGenericDownload::OnDownloadFail  )  [protected, virtual]
 

Function called when the download has failed.

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com> (rewritten by Graham)
Date:
28/04/97
Parameters:
[INPUTS] 
Returns:

Errors:

Reimplemented from DownloadOp.

Definition at line 287 of file gendwnd.cpp.

00288 {
00289     //First get a pointer to the parameters
00290     GenericDownloadParam* pGenParam = (GenericDownloadParam*) pParam;
00291 
00292     if (pGenParam==NULL)
00293     {
00294         ERROR2RAW("OpBitmapDownload::OnDownloadFail - no download parameters");
00295         return;
00296     }
00297 
00298     //Get the URL which the user typed
00299     String_256 strURL=pGenParam->strURL;
00300 
00301     //And put it up as a message
00302     String_256 strMessage;
00303     strMessage.MakeMsg(_R(IDS_HTML_DOWNLOADFAILED), &strURL);
00304     Error::SetError(0, strMessage, 0);
00305     InformError();
00306 
00307 }

void OpGenericDownload::OnDownloadSuccess  )  [protected, virtual]
 

Function called when the download has finished and is success.

Author:
Olivier_Gascoin (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/04/97
Parameters:
[INPUTS] 
Returns:

Errors:

Reimplemented from DownloadOp.

Definition at line 251 of file gendwnd.cpp.

00252 {
00253     // get a pointer to the OpParam so that I can retrieve some useful information
00254     GenericDownloadParam* pGenericParam = (GenericDownloadParam*) pParam;
00255 
00256     String_256 GenericFile = (pGenericParam->file).GetFileName();
00257     if (IsUserName("Olivier"))
00258         TRACE1("OpGenericDownload::OnDownloadSuccess(), file = %s\n", (TCHAR*)GenericFile);
00259 
00260     Filter* pFilter = pGenericParam->m_pFilter;
00261     PathName Path = pGenericParam->file;
00262     String_256 URL = pGenericParam->strURL;
00263     SelOperation* Op = pGenericParam->m_Op;
00264 
00265     // call the DoImport function from OpMenuImport class
00266     ((OpMenuImport*)Op)->DoImport(Path, pFilter, &URL);
00267 
00268     // remove the temporary file
00269     remove((TCHAR*) (String_256) Path.GetPath());
00270 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:15 2007 for Camelot by  doxygen 1.4.4