#include <libsswf.h>
Public Types | |
enum | url_method_t { URL_METHOD_UNDEFINED = -1, URL_METHOD_NOVARIABLE = 0, URL_METHOD_NOVARIABLES = URL_METHOD_NOVARIABLE, URL_METHOD_GET = 1, URL_METHOD_POST = 2 } |
The different methods which can be used with the ActionURL. More... | |
Public Member Functions | |
ActionURL (TagBase *tag, action_t action=ACTION_URL) | |
Initialize the ActionURL action. | |
void | SetMethod (url_method_t method) |
Set the method used to pass the URL to the browser. | |
void | SetURL (const char *url, const char *target) |
Set the URL and target names. | |
Private Member Functions | |
virtual Action * | Duplicate (void) const |
Create a clone of this action. | |
virtual ErrorManager::error_code_t | ParseData (const Data &data) |
Parse the action extraneous data from the Data buffer. | |
virtual ErrorManager::error_code_t | SaveData (Data &data, Data &nested_data) |
Save the action extraneous data in the Data buffer. | |
Private Attributes | |
url_method_t | f_method |
char * | f_target |
char * | f_url |
Use the SetURL() or SetMethod() functions to setup this action appropriately.
If the ActionURL does not automatically choose which of the ACTION_URL or ACTION_URL2 to save it is because the former does not use the stack whereas the latter does. Thus this action by itself cannot know which action to save.
The ActionURL can pass the data to the server with a GET, a POST or with no variable.
sswf::ActionURL::URL_METHOD_NOVARIABLE
sswf::ActionURL::URL_METHOD_NOVARIABLES
The constructor defines default values to the different variable members. It sets the URL to none, the target to none and the method to URL_METHOD_NOVARIABLES.
This function can be called with either ACTION_URL or ACTION_URL2.
[in] | tag | The tag in which this action is being added |
[in] | action | The SWF action to save this action |
References sswf::Action::ACTION_URL, sswf::Action::ACTION_URL2, sswf::assert(), f_method, f_target, f_url, and URL_METHOD_NOVARIABLES.
Referenced by Duplicate().
Action * ActionURL::Duplicate | ( | void | ) | const [private, virtual] |
This function creates a new ActionURL object and copy the URL, target and method in it. Finally, it returns the pointer to the new action.
Reimplemented from sswf::Action.
References ActionURL(), sswf::Action::f_action, f_method, f_target, f_url, SetMethod(), SetURL(), and sswf::Action::Tag().
ErrorManager::error_code_t ActionURL::ParseData | ( | const Data & | data | ) | [private, virtual] |
This function parses the URL/target information (ACTION_URL) or the method (ACTION_URL2) from the specified Data buffer.
[in] | data | The Data buffer from which the URL information is parse |
Reimplemented from sswf::Action.
References sswf::Action::ACTION_URL, sswf::ErrorManager::ERROR_CODE_NONE, sswf::Action::f_action, f_method, f_target, f_url, sswf::Data::GetByte(), and sswf::Data::GetString().
ErrorManager::error_code_t ActionURL::SaveData | ( | Data & | data, | |
Data & | nested_data | |||
) | [private, virtual] |
This function saves the URL/target information (ACTION_URL) or the method (ACTION_URL2) in the specified Data buffer.
[in] | data | The Data buffer where the URL information is saved |
[in] | nested_data | There is no nested data in an ActionURL |
Reimplemented from sswf::Action.
References sswf::Action::ACTION_URL, sswf::ErrorManager::ERROR_CODE_NONE, sswf::Action::f_action, f_method, f_target, f_url, sswf::ErrorManager::KeepFirst(), sswf::Data::PutByte(), and sswf::Action::SaveString().
void ActionURL::SetMethod | ( | url_method_t | method | ) |
Set the method to use execute the URL, this assumes that you defined this action as an ACTION_URL2. This is one of the following values:
URL_METHOD_NOVARIABLE or URL_METHOD_NOVARIABLES URL_METHOD_GET URL_METHOD_POST
[in] | method | One of the available methods |
References f_method.
Referenced by Duplicate().
void ActionURL::SetURL | ( | const char * | url, | |
const char * | target | |||
) |
This function is used to define a valid URL and target.
The target can be the name of a window or set to '_top' to replace the content of the current window.
This function assumes that you defined the action as ACTION_URL.
[in] | url | A standard URL (i.e. http://sswf.m2osw.com) |
[in] | target | A window name or a standard HTML target |
References f_target, f_url, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
Referenced by Duplicate().
url_method_t sswf::ActionURL::f_method [private] |
Referenced by ActionURL(), Duplicate(), ParseData(), SaveData(), and SetMethod().
char* sswf::ActionURL::f_target [private] |
Referenced by ActionURL(), Duplicate(), ParseData(), SaveData(), and SetURL().
char* sswf::ActionURL::f_url [private] |
Referenced by ActionURL(), Duplicate(), ParseData(), SaveData(), and SetURL().