Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

plucker_controller Class Reference

Class to controls API functions that are performed on plucker channels. More...

#include <plucker_controller.h>

List of all members.


Public Methods

  plucker_controller ()
  Contructor.

  ~plucker_controller ()
  Destructor.

wxString  add_channel (channel_type &channel)
  Add a channel.

bool  delete_channel (const wxString &channel_section)
  Delete a channel.

bool  delete_channels (wxArrayString &channel_sections)
  Delete some channels.

bool  update_channel (const wxString &channel_section, bool install=TRUE)
  Update a channel.

bool  update_channels (wxArrayString &channel_sections, bool install=TRUE)
  Update some channels.

bool  update_all_channels (bool install=TRUE)
  Update all channels.

bool  update_due_channels (bool install=TRUE)
  Update due channels.

bool  create_new_channel_subdirectory (const wxString &channel_section, bool copy_template_files=TRUE)
  Creates a new subdirectory for a channel.

bool  delete_channel_subdirectory (const wxString &channel_section)
  Deletes the subdirectory of a channel.

void  get_all_channels (wxArrayString &channel_sections)
  Get a list of all channels.

void  get_due_channels (wxArrayString &channel_sections)
  Get a list of all due channels.

void  get_channel_sections_by_doc_names (wxArrayString &doc_names, wxArrayString &channel_sections)
  Get an array of channel sections that match the array of doc_names.

wxDateTime  get_next_autoupdate ()
  Get time of next autoupdate.

int  get_autoupdate_mode ()
  Get the autoupdate mode.

bool  install_channels (wxArrayString &channel_sections)
  Install the channels.

bool  is_channel_due (const wxString &channel_section)
  Find out if this channel is currently due.

bool  is_any_channel_due ()
  Find out if there are currently any due channels.

bool  is_channel_update_enabled (const wxString &channel_section)
  Queries whether or not a channel is update behaviour enabled.

wxDateTime  get_channel_due_datetime (const wxString &channel_section, const bool shall_increment=TRUE)
  Get the datetime at which a channel became due or will become due.

void  set_channel_update_base (const wxString &channel_section)
  Sets a new update_base key of a channel.

bool  get_is_new_update_execution_allowed ()
  Query whether we are allowing or forbidding a new execution of autoupdates.

void  set_is_new_update_execution_allowed (bool is_allowed)
  Set whether we are allowing or forbidding a new execution of autoupdates.

bool  is_all_criteria_met_to_execute_an_autoupdate ()
  Check the 3 criteria needed for an autoupdate event to start:.


Static Public Methods

plucker_controller *  get ()
  Gets the global object or creates one if none exists.

plucker_controller *  set (plucker_controller *desired_plucker_controller)
  Sets the global object and returns a pointer to previous one (may be NULL).


Detailed Description

Class to controls API functions that are performed on plucker channels.

A modular non-visual class, describing API functions for the actions that can be performed on plucker channels: add, delete, update, etc.


Member Function Documentation

wxString plucker_controller::add_channel channel_type   channel
 

Add a channel.

Parameters:
channel  A channel_type class to be added.
Returns :
The configuration_section of the created channel.
bool plucker_controller::create_new_channel_subdirectory const wxString &    channel_section,
bool    copy_template_files = TRUE
 

Creates a new subdirectory for a channel.

Also makes a cache subdirectory inside the newly created directory for the channels directory.

Parameters:
channel_section  The configuration file section of channel which requires a new subdirectory. Subdirectory usally made in the channels directory, and will be the same name as the channel_section .
copy_template_files  TRUE means to copy over the home.html or exclusion.html and whatever other template files over from the NEW_CHANNEL_TEMPLATE subdirectory over to the new directory.
Returns :
TRUE if creation was successful.
bool plucker_controller::delete_channel const wxString &    channel_section
 

Delete a channel.

Parameters:
channel_section  The configuration file section of channel to be deleted.
Returns :
TRUE if deletion successful.
bool plucker_controller::delete_channel_subdirectory const wxString &    channel_section
 

Deletes the subdirectory of a channel.

Deletes the subdirectory called "channel_section" directory from channels directory Note: wxWindows docs says RmDir() won't work under VMS.

A recursive delete on the whole directory won't work, so we just have to cd to cache, delete all the cache; then delete cache, then cd up and delete *.* from there (home.html and exclusion list), then finally delete the channel subdir.

Todo:
OPTIONAL: could fork whether or not to leave the directory if there is something else in it, like their images, etc.
Parameters:
channel_section  The configuration file section of channel which requires its subdirectory to be deleted.
Returns :
TRUE if deletion was successful.
bool plucker_controller::delete_channels wxArrayString &    channel_sections
 

Delete some channels.

Parameters:
channel_sections  The configuration file sections of channels to be deleted.
Returns :
TRUE if deletions successful.
void plucker_controller::get_all_channels wxArrayString &    channel_sections
 

Get a list of all channels.

Parameters:
channel_sections  The array in which to store the configuration file sections.
int plucker_controller::get_autoupdate_mode  
 

Get the autoupdate mode.

Returns :
The autoupdate mode (a define).
wxDateTime plucker_controller::get_channel_due_datetime const wxString &    channel_section,
const bool    shall_increment = TRUE
 

Get the datetime at which a channel became due or will become due.

Properly accounts for a update_base datetime in the future.

Parameters:
channel_section  The configuration file section of channel to be updated.
shall_increment  TRUE if value should be an incremented one instead of raw value from ini.
Returns :
The due datetime.
void plucker_controller::get_channel_sections_by_doc_names wxArrayString &    doc_names,
wxArrayString &    channel_sections
 

Get an array of channel sections that match the array of doc_names.

Since doc_name is not unique, there can be multiple sections for a doc_name. Don't expect the channel sections to thus always have the same index, or number of array entries. Used for example in commandline updating by channel name.

Parameters:
doc_names  Array of input doc_names to look up.
channel_sections  Array to store the channel_sections.
void plucker_controller::get_due_channels wxArrayString &    channel_sections
 

Get a list of all due channels.

Parameters:
channel_sections  The array in which to store the configuration file sections.
bool plucker_controller::get_is_new_update_execution_allowed  
 

Query whether we are allowing or forbidding a new execution of autoupdates.

Gets the member value of whether we are allowing or forbidding a new execution of updates (because the app hasn't finished its load initization yet, it is already executing an update, or some GUI component like a preferences/channel dialog is displayed) and should hold off until that is done first.

Returns :
TRUE if a new update execution is allowed.
wxDateTime plucker_controller::get_next_autoupdate  
 

Get time of next autoupdate.

Returns :
Date and time of the next scheduled autoupdate.
Todo:
Implement this function.
bool plucker_controller::install_channels wxArrayString &    channel_sections
 

Install the channels.

Different approaches for GTK users, since more convenient to assemble a list and do them all at once, so only have to hit HotSync button once in pilot-xfer.

Parameters:
channel_sections  Channel sections in config file to be installed.
Returns :
TRUE if installation successful.
bool plucker_controller::is_all_criteria_met_to_execute_an_autoupdate  
 

Check the 3 criteria needed for an autoupdate event to start:.

There are 3 criteria required for an autoupdate to start:

  1. Is it allowed, via plucker_controller::set_is_new_update_execution_allowed() status?
  2. Are we in an autoupdate mode that permits autoupdate behaviour?
  3. Are any channels due?
Returns :
TRUE if all criteria have been met.
bool plucker_controller::is_any_channel_due  
 

Find out if there are currently any due channels.

Returns :
TRUE if there is at least one due channel.
bool plucker_controller::is_channel_due const wxString &    channel_section
 

Find out if this channel is currently due.

Parameters:
channel_section  The configuration file section of channel to be examined.
Returns :
TRUE if this channel is due.
bool plucker_controller::is_channel_update_enabled const wxString &    channel_section
 

Queries whether or not a channel is update behaviour enabled.

Parameters:
channel_section  The configuration file section of channel to be examined.
Returns :
TRUE if update successful.
plucker_controller* plucker_controller::set plucker_controller *    desired_plucker_controller [static]
 

Sets the global object and returns a pointer to previous one (may be NULL).

Parameters:
desired_plucker_controller  The new plucker_controller
void plucker_controller::set_channel_update_base const wxString &    channel_section
 

Sets a new update_base key of a channel.

Parameters:
channel_section  The configuration file section of channel to be examined.
void plucker_controller::set_is_new_update_execution_allowed bool    is_allowed
 

Set whether we are allowing or forbidding a new execution of autoupdates.

Gets the member value of whether we are allowing or forbidding a new execution of updates (because the app hasn't finished its load initization yet, it is already executing an update, or some GUI component like a preferences/channel dialog is displayed) and should hold off until that is done first.

Note that in plucker_controller::plucker_controller() it was initialized to FALSE, and at the end of the_app::OnInit() it was set to TRUE.

Parameters:
TRUE  if a new update execution is allowed.
bool plucker_controller::update_all_channels bool    install = TRUE
 

Update all channels.

Parameters:
install  TRUE if channels should also be installed, after update.
Returns :
TRUE if updates successful.
bool plucker_controller::update_channel const wxString &    channel_section,
bool    install = TRUE
 

Update a channel.

Parameters:
channel_section  The configuration file section of channel to be updated.
install  TRUE if channels should also be installed, after update.
Returns :
TRUE if update successful.
bool plucker_controller::update_channels wxArrayString &    channel_sections,
bool    install = TRUE
 

Update some channels.

Parameters:
channel_sections  The configuration file sections of channels to be updated.
install  TRUE if channels should also be installed, after update.
Returns :
TRUE if updates successful.
bool plucker_controller::update_due_channels bool    install = TRUE
 

Update due channels.

Parameters:
install  TRUE if channels should also be installed, after update.
Returns :
TRUE if updates successful.