Main Page | Modules | Files | Functions | Code Elements | Data Structures | Deprecated

tc/preferences.h

Go to the documentation of this file.
00001 /*==============================================================================
00002                 Copyright (c) 2003-2005 UGS Corporation
00003                    Unpublished - All Rights Reserved
00004  ==============================================================================*/
00005 
00014 /*  */
00015 
00016 #ifndef PREFERENCES_H
00017 #define PREFERENCES_H
00018 
00019 #include <unidefs.h>
00020 #include <tc/libtc_exports.h>
00021 
00061 typedef enum TC_preference_search_scope_e{
00062     TC_preference_all,                   
00063     TC_preference_user,                  
00064     TC_preference_role,                  
00065     TC_preference_group,                 
00066     TC_preference_site,                  
00067     TC_preference_system,                
00068     TC_preference_cots_location,         
00069     TC_preference_overlay_location,      
00070     TC_preference_env_variable_location  
00071 } TC_preference_search_scope_t;
00072 
00076 typedef enum PREF_import_actions_e
00077 {
00078     PREF_import_action_skip,         
00079     PREF_import_action_override,     
00080     PREF_import_action_merge         
00081 } PREF_import_actions_t;
00082 
00086 typedef enum PREF_preference_type_e {
00087     PREF_preference_string,          
00088     PREF_preference_logical,         
00089     PREF_preference_integer,         
00090     PREF_preference_double,          
00091     PREF_preference_date             
00092 } PREF_preference_type_t;
00093 
00097 typedef struct {
00098     char*                          preferenceName;        
00099     char*                          preferenceCategory;    
00100     char*                          preferenceDescription; 
00101     TC_preference_search_scope_t   preferenceScope;       
00102     PREF_preference_type_t         preferenceType;        
00103     logical                        isArray;               
00104     logical                        isDisabled;            
00105 } PREF_preference_definition_t, *PREF_preference_definition_p_t;
00106 
00110 typedef struct {
00111     char*  contextName;
00112     int    numberOfValues;
00113     char** values;
00114 } PREF_preference_context_values_t, *PREF_preference_context_values_p_t;
00115 
00121 typedef struct {
00122     PREF_preference_definition_t      preferenceDefinition;
00123     int                               numberOfContexts;
00124     PREF_preference_context_values_t* contextValues;
00125 } PREF_preference_object_t, *PREF_preference_object_p_t;
00126 
00127 #ifdef __cplusplus
00128 extern "C"{
00129 #endif
00130 
00134     extern TC_API int PREF_initialize(void);
00135 
00139     extern TC_API int PREF_reinitialize();
00140 
00162     extern TC_API int PREF_set_search_scope(
00163         TC_preference_search_scope_t  scope   
00164         );
00165 
00172     extern TC_API int PREF_ask_search_scope(
00173         TC_preference_search_scope_t* scope   
00174         );
00175 
00176 
00195     extern TC_API int PREF_set_protection_scope(
00196         const char*                         preference_name,        
00197         TC_preference_search_scope_t        protection_scope         
00198         );
00199 
00216     extern TC_API int PREF_set_protection_scopes(
00217         int                                   preference_count,     
00218         const char**                          preference_names,     
00219         TC_preference_search_scope_t          protection_scopes[]   
00220         );
00221 
00234     extern TC_API int PREF_ask_protection_scope(
00235         const char*                         preference_name,        
00236         TC_preference_search_scope_t*       protection_scope        
00237         );
00238 
00239 
00252     extern TC_API int PREF_ask_protection_scopes(
00253         int                                 preference_count,       
00254         const char**                        preference_names,       
00255         TC_preference_search_scope_t**      protection_scopes        
00256         );
00257 
00258 
00271     extern TC_API int PREF_set_environment_set_flag(
00272         const char*                         preference_name,        
00273         logical                             flag                    
00274         );
00275 
00288     extern TC_API int PREF_set_environment_set_flags(
00289         int                                 preference_count,       
00290         const char**                        preference_names,       
00291         const logical                       flag[]                  
00292         );
00293 
00304     extern TC_API int PREF_ask_environment_set_flag(
00305         const char*                         preference_name,        
00306         logical*                            flag                    
00307         );
00308 
00319     extern TC_API int PREF_ask_environment_set_flags(
00320         int                                 preference_count,       
00321         const char**                        preference_names,       
00322         logical**                           flags                   
00323         );
00324 
00325 
00331     extern TC_API int PREF_ask_value_count(
00332         const char*     preference_name,    
00333         int*            value_count         
00334         );
00335 
00352     extern TC_API int PREF_ask_value_count_at_location(
00353         const char*                         preference_name,        
00354         TC_preference_search_scope_t        location,               
00355         int*                                value_count             
00356         );
00357 
00358 
00362     extern TC_API int PREF_set_char_values(
00363         const char*     preference_name,    
00364         int             value_count,        
00365         char*           values[]            
00366         );
00367 
00368 
00399     extern TC_API int PREF_set_char_values_at_location(
00400         const char*                         preference_name,        
00401         TC_preference_search_scope_t        location,               
00402         int                                 value_count,            
00403         char*                               values[]                
00404         );
00405 
00411     extern TC_API int PREF_ask_char_value(
00412         const char*     preference_name,    
00413         int             index,              
00414         char**          value               
00415         );
00416 
00417 
00426     extern TC_API int PREF_ask_char_values(
00427         const char*     preference_name,    
00428         int*            count,              
00429         char***         value               
00430         );
00431 
00448     extern TC_API int PREF_ask_char_value_at_location(
00449         const char*                         preference_name,        
00450         TC_preference_search_scope_t        location,               
00451         int                                 index,                  
00452         char**                              value                   
00453         );
00454 
00475     extern TC_API int PREF_ask_char_values_at_location(
00476         const char*                         preference_name,        
00477         TC_preference_search_scope_t        location,               
00478         int*                                count,                  
00479         char***                             values                  
00480         );
00481 
00482 
00487     extern TC_API int PREF_set_int_values(
00488         const char*     preference_name,    
00489         int             value_count,        
00490         int             values[]            
00491         );
00492 
00524     extern TC_API int PREF_set_int_values_at_location(
00525         const char*                         preference_name,        
00526         TC_preference_search_scope_t        location,               
00527         int                                 value_count,            
00528         int                                 values[]                
00529         );
00530 
00535     extern TC_API int PREF_ask_int_value(
00536         const char*     preference_name,    
00537         int             index,              
00538         int*            value               
00539         );
00540 
00544     extern TC_API int PREF_ask_int_values(
00545         const char*     preference_name,    
00546         int*            value_count,        
00547         int**           values              
00548         );
00549 
00550 
00568     extern TC_API int PREF_ask_int_value_at_location(
00569         const char*                         preference_name,        
00570         TC_preference_search_scope_t        location,               
00571         int                                 index,                  
00572         int*                                value                   
00573         );
00574 
00590     extern TC_API int PREF_ask_int_values_at_location(
00591         const char*                         preference_name,        
00592         TC_preference_search_scope_t        location,               
00593         int*                                value_count,            
00594         int**                               values                  
00595         );
00596 
00601     extern TC_API int PREF_set_double_values(
00602         const char*     preference_name,    
00603         int             value_count,        
00604         double          values[]            
00605         );
00606 
00638     extern TC_API int PREF_set_double_values_at_location(
00639         const char*                         preference_name,        
00640         TC_preference_search_scope_t        location,               
00641         int                                 value_count,            
00642         double                              values[]                
00643         );
00644 
00645 
00650     extern TC_API int PREF_ask_double_value(
00651         const char*     preference_name,    
00652         int             index,              
00653         double*         value               
00654         );
00655 
00659     extern TC_API int PREF_ask_double_values(
00660         const char*     preference_name,    
00661         int*            value_count,        
00662         double**        values              
00663         );
00664 
00665 
00683     extern TC_API int PREF_ask_double_value_at_location(
00684         const char*                         preference_name,        
00685         TC_preference_search_scope_t        location,               
00686         int                                 index,                  
00687         double*                             value                   
00688         );
00689 
00705     extern TC_API int PREF_ask_double_values_at_location(
00706         const char*                         preference_name,        
00707         TC_preference_search_scope_t        location,               
00708         int*                                value_count,            
00709         double**                            values                  
00710         );
00711 
00731     extern TC_API int PREF_set_logical_value(
00732         const char*                         preference_name,        
00733         logical                             value                   
00734         );
00735 
00755     extern TC_API int PREF_set_logical_values(
00756         const char*                          preference_name,        
00757         int                                  value_count,            
00758         logical                              values[]                
00759         );
00760 
00792     extern TC_API int PREF_set_logical_values_at_location(
00793         const char*                         preference_name,        
00794         TC_preference_search_scope_t        location,               
00795         int                                 value_count,            
00796         logical                             values[]                
00797         );
00798 
00799 
00815     extern TC_API int PREF_ask_logical_value(
00816         const char*     preference_name,    
00817         int             index,              
00818         logical*        value               
00819         );
00820 
00834     extern TC_API int PREF_ask_logical_values(
00835         const char*     preference_name,    
00836         int*            value_count,        
00837         logical**       values              
00838         );
00839 
00857     extern TC_API int PREF_ask_logical_value_at_location(
00858         const char*                         preference_name,        
00859         TC_preference_search_scope_t        location,               
00860         int                                 index,                  
00861         logical*                            value                   
00862         );
00863 
00881     extern TC_API int PREF_ask_logical_values_at_location(
00882         const char*                         preference_name,        
00883         TC_preference_search_scope_t        location,               
00884         int*                                value_count,            
00885         logical**                           values                  
00886         );
00887 
00888 
00889 
00969     extern TC_API int PREF_set_definition(
00970         const char* preference_name,                          
00971         PREF_preference_object_t preference_object,           
00972         logical env_variable_enabled                            
00973         );
00974 
00975 
00999     extern TC_API int PREF_delete_definition(
01000         int nb_of_preferences,                  
01001         const char** preference_names,          
01002         logical delete_all_custom_definitions   
01003         );
01004 
01005 
01018     extern TC_API int PREF_refresh(
01019         const char*     preference_name     
01020         );
01021 
01038     extern TC_API int PREF_export_preference_list(
01039         int                             preference_count,   
01040         char**                          preference_names,   
01041         TC_preference_search_scope_t    location,           
01042         const char*                     output_file_name    
01043         );
01044 
01063     extern TC_API int PREF_export_preferences(
01064         TC_preference_search_scope_t    location,           
01065         const char*                     output_file_name    
01066         );
01067 
01068 
01086     extern TC_API int PREF_export_preferences_with_category(
01087         TC_preference_search_scope_t location,             
01088         int                          number_of_categories, 
01089         char**                       categories,           
01090         const char*                  output_file_name      
01091         );
01092 
01126     extern TC_API int PREF_import_preferences(
01127         TC_preference_search_scope_t    location,     
01128         const char*                     input_xml,    
01129         PREF_import_actions_t           action        
01130         );
01131 
01165     extern TC_API int PREF_import_preferences_with_category(
01166         TC_preference_search_scope_t location,   
01167         const char*                  input_xml,  
01168         int                          number_of_categories, 
01169         char**                       category_names,       
01170         PREF_import_actions_t        action      
01171         );
01172 
01183     extern TC_API int PREF_delete_preference(
01184         const char*                     preference_name      
01185         );
01186 
01187 
01204     extern TC_API int PREF_delete_preference_at_location(
01205         const char*                     preference_name,     
01206         TC_preference_search_scope_t    location             
01207         );
01208 
01209 
01218     extern TC_API int PREF_delete_non_session_preference(
01219         char* preference_name,        
01220         tag_t object                  
01221         );
01222 
01231     extern TC_API int PREF_lock_site_preferences( );
01232 
01239     extern TC_API int PREF_unlock_site_preferences( );
01240 
01243 #ifdef __cplusplus
01244 }
01245 #endif
01246 
01247 
01248 #include <tc/libtc_undef.h>
01249 #endif
01250