00001 //----------------------------------------------------------------------------------------
00011 // RCS-ID: $Id: plucker_controller.h,v 1.17 2002/09/27 13:28:41 robertoconnor Exp $
00012 //----------------------------------------------------------------------------------------
00013
00014 //----------------------------------------------------------------------------------------
00015 // Begin single inclusion of this .h file condition
00016 //----------------------------------------------------------------------------------------
00017
00018 #ifndef _PLUCKER_CONTROLLER_H_
00019 #define _PLUCKER_CONTROLLER_H_
00020
00021 //----------------------------------------------------------------------------------------
00022 // GCC interface
00023 //----------------------------------------------------------------------------------------
00024
00025 #if defined(__GNUG__) && ! defined(__APPLE__)
00026 #pragma interface "plucker_controller.h"
00027 #endif
00028
00029 //----------------------------------------------------------------------------------------
00030 // Shared defines
00031 //----------------------------------------------------------------------------------------
00032
00033 #include "plucker_defines.h"
00034
00035 //----------------------------------------------------------------------------------------
00036 // Headers
00037 //----------------------------------------------------------------------------------------
00038
00039 #include "wx/datetime.h" // wxDateTime
00040 #include "palm_installer.h"
00041 #include "channel_type.h"
00042
00043 //----------------------------------------------------------------------------------------
00044 // Class definition: plucker_wizard_base
00045 //----------------------------------------------------------------------------------------
00046
00048
00052 class plucker_controller
00053 {
00054
00055 public:
00056
00058 plucker_controller();
00059
00061 ~plucker_controller();
00062
00064 static plucker_controller* get();
00065
00067
00070 static plucker_controller* set( plucker_controller* desired_plucker_controller );
00071
00073
00077 wxString add_channel( channel_type& channel );
00078
00080
00084 bool delete_channel( const wxString& channel_section );
00085
00087
00091 bool delete_channels( wxArrayString& channel_sections );
00092
00094
00099 bool update_channel( const wxString& channel_section,
00100 bool install = TRUE
00101 );
00102
00104
00109 bool update_channels( wxArrayString& channel_sections,
00110 bool install = TRUE
00111 );
00112
00114
00118 bool update_all_channels( bool install = TRUE );
00119
00121
00125 bool update_due_channels( bool install = TRUE );
00126
00128
00138 bool create_new_channel_subdirectory( const wxString& channel_section,
00139 bool copy_template_files = TRUE
00140 );
00141
00143
00156 bool delete_channel_subdirectory( const wxString& channel_section );
00157
00159
00162 void get_all_channels( wxArrayString& channel_sections );
00163
00165
00168 void get_due_channels( wxArrayString& channel_sections );
00169
00171
00179 void get_channel_sections_by_doc_names( wxArrayString& doc_names,
00180 wxArrayString& channel_sections
00181 );
00183
00187 wxDateTime get_next_autoupdate();
00188
00190
00193 int get_autoupdate_mode();
00194
00196
00203 bool install_channels( wxArrayString& channel_sections );
00204
00206
00210 bool is_channel_due( const wxString& channel_section );
00211
00213
00216 bool is_any_channel_due();
00217
00219
00223 bool is_channel_update_enabled( const wxString& channel_section );
00224
00226
00232 wxDateTime get_channel_due_datetime( const wxString& channel_section, const bool shall_increment = TRUE );
00233
00235
00238 void set_channel_update_base( const wxString& channel_section );
00239
00241
00249 bool get_is_new_update_execution_allowed();
00250
00252
00263 void set_is_new_update_execution_allowed( bool is_allowed );
00264
00266
00276 bool is_all_criteria_met_to_execute_an_autoupdate();
00277
00278
00279
00280 private:
00281
00282 // Singleton instance of plucker_controller
00283 static plucker_controller* ms_instance;
00284
00286 bool copy_file_between_channels( const wxString& from_section,
00287 const wxString& to_section,
00288 const wxString& filename,
00289 bool overwrite = TRUE );
00290
00292 bool execute_plucker_build( const wxString& channel_section );
00293
00295 wxDateTime get_incremented_channel_due_datetime( const wxString& channel_section,
00296 int increments=1 );
00297
00299
00302 bool create_channels_directory();
00303
00305
00309 bool create_pluckerhome_directory();
00310
00312 void create_channel_template_section_and_subdirectory();
00313
00315
00319 bool m_is_new_update_execution_allowed;
00320
00322 palm_installer* m_palm_installer;
00323
00324 };
00325
00326 //----------------------------------------------------------------------------------------
00327 // End single inclusion of this .h file condition
00328 //----------------------------------------------------------------------------------------
00329
00330 #endif //PLUCKER_CONTROLLER_H
00331
00332