URLImportDlg Class Reference

#include <urldlg.h>

Inheritance diagram for URLImportDlg:

DialogOp Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 URLImportDlg ()
 Default constructor.
void DoWithParam (OpDescriptor *, OpParam *Param)
 Creates then opens the dialog in response to a request from the user and allows values to be passed in and returned to the caller via the URLImportDlgParam class.
void Do (OpDescriptor *)
 Creates then opens the dialog in response to a request from the user.
virtual MsgResult Message (Msg *Message)
 Handles all messages.

Static Public Member Functions

static BOOL Init ()
 URLImportDlg Init method.
static BOOL OpenAndGetURL (WebAddress *purlToReturn)
 Starts up the Import from Internet dialog box.
static OpState GetState (String_256 *, OpDescriptor *)
 URLImportDlg GetState method.

Static Public Attributes

static CDlgResID IDD = _R(IDD_URLIMPORT)
static const CDlgMode Mode = MODAL

Protected Member Functions

void OnCreate ()
 Handles a message that the dialog has just been created.
void OnCommit ()
 Handles a message that the "Import" button has been clicked.
void OnURLChanged ()
 Handles a message that the user has typed in the "URL" field.

Static Protected Attributes

static WebAddress ms_url = WebAddress()
static BOOL DialogWasCancelled = FALSE
static BOOL DontHandleNextMessage = FALSE

Detailed Description

Definition at line 120 of file urldlg.h.


Constructor & Destructor Documentation

URLImportDlg::URLImportDlg  ) 
 

Default constructor.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 182 of file urldlg.cpp.

00182                           : DialogOp(URLImportDlg::IDD, URLImportDlg::Mode) 
00183 {
00184 
00185 }


Member Function Documentation

void URLImportDlg::Do OpDescriptor  )  [virtual]
 

Creates then opens the dialog in response to a request from the user.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 444 of file urldlg.cpp.

00445 {
00446     BOOL ok;
00447     
00448     // Force the dialog box to be created, as it is modal it will be opened via a message
00449     ok = Create();
00450 
00451     if ( !ok )
00452     {
00453         // Could not create the dialog box so call inform error 
00454         InformError();
00455         End();      
00456     }
00457 }

void URLImportDlg::DoWithParam OpDescriptor ,
OpParam Param
[virtual]
 

Creates then opens the dialog in response to a request from the user and allows values to be passed in and returned to the caller via the URLImportDlgParam class.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 476 of file urldlg.cpp.

00477 {
00478     BOOL ok;
00479     
00480     // Force the dialog box to be created, as it is modal it will be opened via a message
00481     ok = Create();
00482 
00483     if ( !ok )
00484     {
00485         // Could not create the dialog box so call inform error 
00486         InformError();
00487         End();         // End the operation 
00488     }
00489 }

OpState URLImportDlg::GetState String_256 ,
OpDescriptor
[static]
 

URLImportDlg GetState method.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 385 of file urldlg.cpp.

00386 {    
00387     OpState OpSt;
00388     return(OpSt);
00389 }

BOOL URLImportDlg::Init void   )  [static]
 

URLImportDlg Init method.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 409 of file urldlg.cpp.

00410 {
00411     BOOL InitOK;
00412 
00413     InitOK = RegisterOpDescriptor(
00414                                 0,                  /* Tool ID */
00415                                 _R(IDS_URLIMPORT),
00416                                 CC_RUNTIME_CLASS(URLImportDlg),
00417                                 OPTOKEN_URLIMPORTDLG,
00418                                 GetState,
00419                                 _R(IDH_Command_Import_from_Web),    /* help ID */
00420                                 0,                  /* bubble help */
00421                                 0,                  /* resource ID */
00422                                 0                   /* control ID */
00423                                 );
00424 
00425     return (InitOK);
00426 }

MsgResult URLImportDlg::Message Msg Message  )  [virtual]
 

Handles all messages.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-
This function simply maps the message to one of our message handling functions below.

Returns:
Errors: -
See also:
-

Reimplemented from DialogOp.

Definition at line 207 of file urldlg.cpp.

00208 {   
00209     //If the message came from within our dialog 
00210     if (IS_OUR_DIALOG_MSG(Message))
00211     {
00212         //Then cast it into a dialog message and handle it
00213         DialogMsg* Msg = (DialogMsg*)Message;
00214 
00215         //If this flag gets set, we should close the dialog
00216         BOOL EndDialog = FALSE;
00217 
00218         //Now pass the message to a message handling function
00219         switch (Msg->DlgMsg)
00220         {
00221             case DIM_CREATE:
00222                 OnCreate();
00223                 break;
00224 
00225             case DIM_COMMIT:
00226                 OnCommit();
00227                 EndDialog=TRUE;
00228                 break;
00229 
00230             case DIM_CANCEL:
00231                 DialogWasCancelled=TRUE;
00232                 EndDialog = TRUE;
00233                 break;
00234 
00235             case DIM_LFT_BN_CLICKED:
00236                 // A control on the dialog box has been clicked...
00237                 if(Msg->GadgetID==_R(IDC_URLIMPORT_IMPORT))
00238                 {
00239                     OnCommit();
00240                     EndDialog=TRUE;
00241                 }
00242                 break;
00243 
00244 
00245             case DIM_TEXT_CHANGED:
00246                 // The user has typed in an edit field
00247                 switch (Msg->GadgetID)
00248                 {
00249                     case _R(IDC_URLIMPORT_URL):
00250                         if (URLImportDlg::DontHandleNextMessage)
00251                             URLImportDlg::DontHandleNextMessage=FALSE;
00252                         else
00253                             OnURLChanged();
00254                         break;
00255                                         
00256                 }
00257                 break;
00258 
00259         }
00260 
00261         //And end the dialog if necessary
00262         if (EndDialog) 
00263         {
00264             Close();        
00265             End();          
00266         }
00267     }
00268 
00269     //Now pass the message down to the base class
00270     return DialogOp::Message(Message); 
00271 }

void URLImportDlg::OnCommit  )  [protected]
 

Handles a message that the "Import" button has been clicked.

void URLImportDlg::OnCommit()

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
URLImportDlg::Message()

Definition at line 325 of file urldlg.cpp.

00326 {   
00327     //Get the string from the edit field
00328     String_256 strUser=GetStringGadgetValue(_R(IDC_URLIMPORT_URL));
00329 
00330     //Now we want to correct this string. To do this we
00331     //need to set up some correction flags
00332     WebCorrectFlags wcfToUse;
00333     wcfToUse.SetForURLImport();
00334 
00335     //Now make a Web Address object out of the string
00336     //This will correct the string appropriately
00337     WebAddress urlToFetch(strUser, wcfToUse);
00338 
00339     //And set our member variable
00340     ms_url=urlToFetch;
00341 
00342 
00343 }

void URLImportDlg::OnCreate  )  [protected]
 

Handles a message that the dialog has just been created.

void URLImportDlg::OnCreate()

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
URLImportDlg::Message()

Definition at line 302 of file urldlg.cpp.

00303 {   
00304     //Put the keyboard focus in the edit field
00305     SetKeyboardFocus(_R(IDC_URLIMPORT_URL));
00306 }

void URLImportDlg::OnURLChanged  )  [protected]
 

Handles a message that the user has typed in the "URL" field.

void URLImportDlg::OnURLChanged()

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
URLImportDlg::Message()

Definition at line 362 of file urldlg.cpp.

00363 {   
00364     //Does nothing at present
00365     //We may need to handle this if we want the Import... button to be greyed
00366     //until the user types in the field
00367 }

BOOL URLImportDlg::OpenAndGetURL WebAddress purlToReturn  )  [static]
 

Starts up the Import from Internet dialog box.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/6/97
Parameters:
- [INPUTS]
purlToReturn Pointer to a Web Address object [OUTPUTS]
Returns:
TRUE - Import was pressed FALSE - Cancel was pressed

Errors: -

See also:
-

Definition at line 147 of file urldlg.cpp.

00148 {
00149     //Say that the dialog wasn't cancelled
00150     DialogWasCancelled=FALSE;
00151 
00152     //Find the dialog's op descriptor
00153     OpDescriptor *OpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(URLImportDlg));
00154 
00155     //And start up the dialog
00156     if (OpDesc != NULL)
00157         OpDesc->Invoke();
00158 
00159     //And return the member variable
00160     *purlToReturn=URLImportDlg::ms_url;
00161 
00162     return !DialogWasCancelled;
00163 }


Member Data Documentation

BOOL URLImportDlg::DialogWasCancelled = FALSE [static, protected]
 

Definition at line 156 of file urldlg.h.

BOOL URLImportDlg::DontHandleNextMessage = FALSE [static, protected]
 

Definition at line 157 of file urldlg.h.

CDlgResID URLImportDlg::IDD = _R(IDD_URLIMPORT) [static]
 

Definition at line 162 of file urldlg.h.

const CDlgMode URLImportDlg::Mode = MODAL [static]
 

Definition at line 163 of file urldlg.h.

WebAddress URLImportDlg::ms_url = WebAddress() [static, protected]
 

Definition at line 154 of file urldlg.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:43 2007 for Camelot by  doxygen 1.4.4