include/alp/mediaselector_api.h

Go to the documentation of this file.
00001 /*********************************************************************************************************
00002  * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved.
00003         *Copyright © 2006-2007, ACCESS Systems Americas, Inc. a member of the ACCESS Co., Ltd group of companies.
00004         *ACCESS, ACCESS Linux Platform, ACCESS Powered, ACCESS Desktop, Palm Desktop, Palm OS, Garnet, Graffiti,
00005         *Hiker, HotSync, iMessenger, HandMail, MultiMail Deluxe, Netfront and certain other trade names, trademarks
00006         *and logos are trademarks which may be registered in the United States, France, Germany, Japan, the
00007         *United Kingdom, and other countries and are either owned by ACCESS Systems Americas, Inc. or its affiliates,
00008         *or are licensed on an exclusive basis by ACCESS Systems Americas, Inc. (“ACCESS”) from Palm Trademark Holding
00009         *Company, LLC.    These marks may not be used in connection with any product or service that does not belong
00010         *to ACCESS (except as expressly permitted by a license with ACCESS), in any manner that is likely to cause
00011         *confusion among customers, or in any manner that disparages or discredits ACCESS or its affiliates or licensor.
00012  ********************************************************************************************************/
00024 /*      Sections:
00025         Section 1   Definitions used across the whole media selector subsystem.
00026         Section 2   mediacatd public API. (Primarily) methods that communicate with mediacatd.
00027         Section 3   mediaselector_dml public API. Methods for reading and writing metadata.
00028         Section 4   mediafile public API. Methods for manipulating mount-point-independent filenames.
00029 */        
00030         
00031 #ifndef __ALP_MEDIA_SELECTOR_API_H
00032 #define __ALP_MEDIA_SELECTOR_API_H
00033 
00034 #include <errno.h>
00035 
00036 #include <sqlite3.h>
00037 #include <stdint.h>
00038 #include <stdbool.h>
00039 #include <string.h>
00040 
00041 #include <glib/gtypes.h>
00042 
00043 #include <alp/sal.h>
00044 #include <alp/types.h>
00045 #include <alp/sysclass.h>
00046 #include <alp/volumesvcs_types.h>
00047 
00048 #if (__GNUC__ >= 3)
00049 #define DEPRECATED  __attribute__((__deprecated__))
00050 #else
00051 #define DEPRECATED
00052 #endif /* __GNUC__ */
00053                 
00054 G_BEGIN_DECLS
00055         
00056 /* @addtogroup ALP_MEDIA_SELECTOR Media Selector infrastructure
00057  *  @ingroup ALP_MULTIMEDIA
00058  * This is the public API for the ALP Media Selector infrastructure: 
00059  *      1) the cataloger daemon (mediacatd);
00060  *      2) the (user-process) data access library (mediaselector_dml); and
00061  *      3) the (user-process) media utilities library (mediafile).
00062  *  @{
00063 */
00064 
00065 //
00066 //  Section 1:   Definitions used across the whole media selector subsystem
00067 //
00068 
00069 // 1.1: error messages
00070 
00080 #define ALP_STATUS_MS_MISC  0x00000000 
00081 #define ALP_STATUS_MS_CAT   0x00010000 
00082 #define ALP_STATUS_MS_IPC   0x00020000 
00083 #define ALP_STATUS_MS_DML   0x00030000 
00084 #define ALP_STATUS_MS_FILE  0x00040000 
00085 #define ALP_STATUS_MS_UI    0x00050000 
00086         
00087 #define ALP_STATUS_MS_MISC_ERROR (ALP_CLASS_MEDIASELECTOR | ALP_STATUS_MS_MISC) 
00088 #define ALP_STATUS_MS_CAT_ERROR  (ALP_CLASS_MEDIASELECTOR | ALP_STATUS_MS_CAT)  
00089 #define ALP_STATUS_MS_DML_ERROR  (ALP_CLASS_MEDIASELECTOR | ALP_STATUS_MS_DML)  
00090 #define ALP_STATUS_MS_IPC_ERROR  (ALP_CLASS_MEDIASELECTOR | ALP_STATUS_MS_IPC)  
00091 #define ALP_STATUS_MS_FILE_ERROR (ALP_CLASS_MEDIASELECTOR | ALP_STATUS_MS_FILE) 
00092 #define ALP_STATUS_MS_UI_ERROR   (ALP_CLASS_MEDIASELECTOR | ALP_STATUS_MS_UI)   
00093         
00094 // Cataloger and IPC errors
00095 //
00096 // NOTE: If you change any of these error codes, be sure to change the error_strings library under platform/servers/mediacatd
00097         
00099 enum
00100 {
00101     ALP_STATUS_MS_CAT_OK = ALP_STATUS_OK,                           
00102     ALP_STATUS_MS_CAT_NO_COMM = ALP_STATUS_MS_CAT_ERROR + 1,        
00103     ALP_STATUS_MS_CAT_DB_DONE,                                      
00104     ALP_STATUS_MS_CAT_INVALID_PATH,                                 
00105     ALP_STATUS_MS_CAT_NOT_SUPPORTED,                                
00106     ALP_STATUS_MS_CAT_DB_ERROR,                                     
00107     ALP_STATUS_MS_CAT_NOTIFICATION_ERROR,                           
00108     ALP_STATUS_MS_CAT_FILE_NOT_FOUND,                               
00109     ALP_STATUS_MS_CAT_FILE_IO_ERROR,                                
00110     ALP_STATUS_MS_CAT_INTERNAL_ERROR,                               
00111     ALP_STATUS_MS_CAT_NO_MEMORY,                                    
00112     ALP_STATUS_MS_CAT_BAD_PARAMETER,                                
00113     ALP_STATUS_MS_CAT_USER_ABORT,                                   
00114     ALP_STATUS_MS_CAT_TARGET_FILE_EXISTS,                           
00118     ALP_STATUS_MS_CAT_UNKNOWN_SOURCE_FILE,                          
00119     ALP_STATUS_MS_CAT_TARGET_NAME_COLLISION,                        
00120 };
00121 
00123 enum
00124 {
00125     ALP_STATUS_MS_IPC_NOT_MOUNTED = ALP_STATUS_MS_IPC_ERROR + 1,    
00126     ALP_STATUS_MS_IPC_INVALID_OPERATION                             
00127 };
00128 
00129 // DML errors
00130 
00132 enum
00133 {
00134     ALP_STATUS_MS_OK = ALP_STATUS_OK,                              
00135     ALP_STATUS_MS_DML_UNIMPLEMENTED = ALP_STATUS_MS_DML_ERROR + 1, 
00136     ALP_STATUS_MS_DML_NO_RECORDS,                                  
00137     ALP_STATUS_MS_DML_NO_MORE_RECORDS,                             
00138     ALP_STATUS_MS_DML_NO_MEM,                                      
00139     ALP_STATUS_MS_DML_INTERNAL_ERR,                                
00140     ALP_STATUS_MS_DML_DATABASE_ERR,                                
00141     ALP_STATUS_MS_DML_BAD_PARAM,                                   
00142     ALP_STATUS_MS_DML_COLUMN_INVALID,                              
00143     ALP_STATUS_MS_DML_COLUMN_MISMATCH,                             
00144     ALP_STATUS_MS_DML_NOT_A_NUMBER,                                
00145     ALP_STATUS_MS_DML_OUT_OF_RANGE,                                
00146     ALP_STATUS_MS_DML_NOT_INDEXED,                                 
00147     ALP_STATUS_MS_DML_SYSTEM_COLUMN,                               
00148     ALP_STATUS_MS_DML_FILE_DOES_NOT_EXIST                          
00149 };
00150 
00151 // MediaFile errors
00152 
00154 enum
00155 {
00156     ALP_STATUS_MF_UNAVAILABLE = ALP_STATUS_MS_FILE_ERROR + 1,       
00157     ALP_STATUS_MF_INVALID_PARAM,                                    
00158     ALP_STATUS_MF_PENDING                                           
00159 };
00160 
00162 enum AlpMsStatus
00163 {
00164     ALP_MS_STATUS_OK = 0,                                           
00165     ALP_MS_STATUS_BAD_PARAMETER = ALP_STATUS_MS_UI_ERROR + 1        
00166 };
00167         
00169                                 
00170 // 1.2: Media selector widget
00171 
00179 // MediaSelector widget properties
00180 #define ALP_MS_PROP_CATEGORY            "category"          
00181 #define ALP_MS_PROP_FILTER                      "filter"            
00182 #define ALP_MS_PROP_VIEW_MODE           "view_mode"         
00183 #define ALP_MS_PROP_SORTBY                      "sortby"            
00184 #define ALP_MS_PROP_MATCH                       "match"             
00185 #define ALP_MS_PROP_MATCH_FIELD         "match_field"       
00186 #define ALP_MS_PROP_SORT_ASCENDING      "sort_ascending"    
00187 #define ALP_MS_PROP_ICON_SPACING        "icon_spacing"          
00188 #define ALP_MS_PROP_ICON_MARGIN         "icon_margin"           
00189 #define ALP_MS_PROP_POPUP_MENU      "ms_popup_menu"     
00190 
00191 // MediaSelector signals
00192 #define ALP_MS_SIGNAL_SELECTION_CHANGED   "selection_changed"   
00193 #define ALP_MS_SIGNAL_SELECTION_ACTIVATED "selection_activated" 
00194 
00195 // Common category selections
00196 #define ALP_MS_CATEGORY_AUDIO           "audio"       
00197 #define ALP_MS_CATEGORY_AUDIO_PIC   "audio_pic"   
00198 #define ALP_MS_CATEGORY_VIDEO           "video"       
00199 #define ALP_MS_CATEGORY_IMAGE           "image"       
00200 #define ALP_MS_CATEGORY_ALL             "all"         
00201 #define ALP_MS_CATEGORY_RINGTONE        "ringtone"    
00202 #define ALP_MS_CATEGORY_DOCUMENT        "application" 
00203 #define ALP_MS_CATEGORY_APPLICATION "application" 
00204 #define ALP_MS_CATEGORY_VOICE           "voice"       
00205 #define ALP_MS_CATEGORY_OTHER           "other"       
00206 #define ALP_MS_CATEGORY_COLLECTION      "collection"  
00207         
00208 // Common sortby selections 
00209 #define ALP_MS_SORTBY_SIZE                      "size"       
00210 #define ALP_MS_SORTBY_NAME                      "name"       
00211 #define ALP_MS_SORTBY_LOCATION          "location"   
00212 #define ALP_MS_SORTBY_TYPE                      "type"       
00213 #define ALP_MS_SORTBY_TIME                      "mtime"      
00214 
00215 
00216 enum AlpMediaSelectorViewModeType
00217 {
00218     ALP_MS_SINGLE_VIEW = 0,                     
00219     ALP_MS_MULTI_VIEW,                          
00220     ALP_MS_GALLERY_VIEW                         
00221 };
00222 
00224 enum AlpMsSorts
00225 {
00226     ALP_MS_SORT_DESCENDING = 0,                 
00227     ALP_MS_SORT_ASCENDING,                      
00228 };
00229 
00231                 
00232 //        
00233 //  Section 2:   mediacatd public API
00234 //
00235                 
00247 // 2.1: macros and constants
00248 
00249 // Standard registered directories
00250 
00264 
00265 #define ALP_MEDIASELECTOR_REGISTERED_DIRECTORY_HOME               "/var/home"
00266 
00268 #define ALP_MEDIASELECTOR_REGISTERED_DIRECTORY_RINGTONES          "/usr/share/sounds/ringtones"
00269 
00271 #define ALP_MEDIASELECTOR_REGISTERED_DIRECTORY_STANDARD_IMAGES    "/usr/share/images"
00272 
00274 #define ALP_MEDIASELECTOR_REGISTERED_DIRECTORY_STANDARD_VIDEO     "/usr/share/video"
00275         
00277         
00278 // Messages sent BY the media cataloger daemon
00279 
00289 #define ALP_MEDIASELECTOR_APP_ID "mediacatd"
00290 
00293 #define ALP_MS_EVENT_PREFIX "/alp/" ALP_MEDIASELECTOR_APP_ID "/"
00294 
00298 #define ALP_MS_REFRESH_CONTENT      ALP_MS_EVENT_PREFIX "refresh"
00299 
00302 #define ALP_NOTIFY_EVENT_MS_REFRESH ALP_MS_REFRESH_CONTENT
00303 
00308 #define ALP_NOTIFY_EVENT_MS_SCANNING_DIRECTORY ALP_MS_EVENT_PREFIX "scanning_directory"
00309 
00315 #define ALP_NOTIFY_EVENT_MS_METADATA_READ_PROGRESS ALP_MS_EVENT_PREFIX "reading_metadata"
00316 
00323 #define MS_READ_PROGRESS_PARTS 10000
00324 
00330 #define ALP_NOTIFY_EVENT_MS_INDEX_FILE ALP_MS_EVENT_PREFIX "index_file"
00331 
00338 #define ALP_NOTIFY_EVENT_MS_UNINDEX_FILE ALP_MS_EVENT_PREFIX "unindex_file"
00339 
00343 #define ALP_NOTIFY_EVENT_MS_FILE_DELETED ALP_MS_EVENT_PREFIX "file_deleted"
00344 
00346 
00347 // Messages sent TO the media cataloger daemon
00348 
00363 #define ALP_NOTIFY_EVENT_DIRECTORY_UPDATED              ALP_MS_EVENT_PREFIX "update_dir"
00364 
00366 
00367 // 2.2: types
00368 
00369 typedef void* AlpMSRegDirH;
00370 
00371 // single file indexing
00372 
00373 // At least one app loads a heaader that #defines Status ....
00374 #ifdef Status
00375 #ifdef  Copy__of__Status__define Status
00376 #warning woop! woop!
00377 #endif
00378 #define Copy__of__Status__define Status
00379 #undef Status
00380 #endif
00381 
00383 #define ALP_MS_CAT_INDEX_FILE_RESULTS_VERSION_1PT0 0x00010000
00384 
00388 enum AlpMsCatIndexFileStatus
00389 {
00390     ALP_MS_CAT_IFS_SUCCESS,                     
00391     ALP_MS_CAT_IFS_FILE_DOES_NOT_EXIST,         
00392     ALP_MS_CAT_IFS_NOT_IN_REGISTERED_DIRECTORY, 
00393     ALP_MS_CAT_IFS_INDEXING_ERROR,              
00394     ALP_MS_CAT_IFS_DATABASE_ERROR,              
00395 };
00396 
00398 typedef struct _AlpNotifyEventIndexFileResultsHeader AlpNotifyEventIndexFileResultsHeader;
00399 struct _AlpNotifyEventIndexFileResultsHeader
00400 {
00401     int                             Version;   
00402     enum AlpMsCatIndexFileStatus    Status;    
00403 };
00404 
00406 typedef struct _AlpNotifyEventIndexFileResults AlpNotifyEventIndexFileResults;
00407 struct _AlpNotifyEventIndexFileResults
00408 {
00409     AlpNotifyEventIndexFileResultsHeader
00410            Header;      
00411     char   Filename[0]; 
00414 };
00415 
00419 #define ALP_MS_CAT_UNINDEX_FILE_RESULTS_VERSION_1PT0 0x00010000
00420         
00424 enum AlpMsCatUnindexFileStatus
00425 {
00426     ALP_MS_CAT_UFS_SUCCESS,             
00427     ALP_MS_CAT_UFS_NOT_INDEXED,         
00428     ALP_MS_CAT_UFS_UNINDEXING_ERROR,    
00429     ALP_MS_CAT_UFS_FILE_DOES_NOT_EXIST  
00430 };
00431 
00433 typedef struct _AlpNotifyEventUnindexFileResultsHeader AlpNotifyEventUnindexFileResultsHeader;
00434 struct _AlpNotifyEventUnindexFileResultsHeader
00435 {
00436     int                             Version; 
00437     enum AlpMsCatUnindexFileStatus  Status;  
00438 };
00439 
00441 typedef struct _AlpNotifyEventUnindexFileResults AlpNotifyEventUnindexFileResults;
00442 struct _AlpNotifyEventUnindexFileResults
00443 {
00444     AlpNotifyEventUnindexFileResultsHeader
00445             Header;      
00446     char    Filename[0]; 
00449 };
00450 
00451 // rename file
00452 
00454 #define FILE_RENAMED_NOTIFICATION_VERSION_1PT0 0x00010000
00455 
00457 #define ALP_NOTIFY_EVENT_MS_RENAME_FILE ALP_MS_EVENT_PREFIX "rename_file"
00458 
00460 typedef struct _AlpNotifyEventFileRenamed AlpNotifyEventFileRenamed;
00461 struct _AlpNotifyEventFileRenamed
00462 {
00463     int Version;    
00464     int UrlOffset;  
00465     int NameOffset; 
00467 };
00468 
00469 // file copy callback
00470 
00481 typedef int (*alp_ms_cat_file_copy_callback)
00482         (const char* destination_filename, const char* source_filename, int64_t bytes_copied, int64_t total_bytes, void* data);
00483 
00484 // 2.3: entry points
00485 
00504     alp_status_t alp_ms_cat_register_directory(const char* path);
00505 
00512     alp_status_t alp_ms_cat_unregister_directory(const char* path);
00513 
00522     alp_status_t alp_ms_cat_get_registered_begin(AlpMSRegDirH* handle);
00523 
00534     alp_status_t alp_ms_cat_get_registered_next_dir(AlpMSRegDirH handle, char** directory);
00535 
00542     alp_status_t alp_ms_cat_get_registered_end(AlpMSRegDirH handle);
00543  
00557     alp_status_t alp_ms_cat_update(const char* path);
00558                                    
00565     bool alp_ms_cat_extension_supported(const char* extension);
00566 
00586     alp_status_t alp_ms_cat_copy_file(const char* new_filename, const char* existing_filename,
00587         alp_ms_cat_file_copy_callback callback, void* data);
00588 
00597     alp_status_t alp_ms_cat_index_file(const char* filename);
00598 
00614     alp_status_t alp_ms_cat_unindex_file(const char* filename);
00615 
00631     alp_status_t alp_ms_cat_rename_file(const char* new_filename, const char* existing_url, const char* notification_app);
00632     
00673 
00674  
00675 //
00676 //  Section 3:   mediaselector_dml public API
00677 //
00678                 
00685 // 3.1: macros and constants
00686         
00687 // Common to all item types
00688 #define ALP_MS_DML_COL_ANY_FILEID                       "file_id"               
00689 
00690 // Audio
00691 #define ALP_MS_DML_COL_AUDIO_TITLE                      "title"                 
00692 #define ALP_MS_DML_COL_AUDIO_ARTIST                     "artist"                
00693 #define ALP_MS_DML_COL_AUDIO_ALBUM                      "album"                 
00694 #define ALP_MS_DML_COL_AUDIO_GENRE                      "genre"                 
00695 #define ALP_MS_DML_COL_AUDIO_YEAR                       "year"                  
00696 #define ALP_MS_DML_COL_AUDIO_DURATION           "duration"              
00697 #define ALP_MS_DML_COL_AUDIO_CTIME                      "ctime"                 
00698 #define ALP_MS_DML_COL_AUDIO_COUNT                      "play_count"    
00699 #define ALP_MS_DML_COL_AUDIO_NOTES                      "notes"                 
00700                 
00701 #define ALP_MS_DML_COL_AUDIO_COMPOSER           "composer"              
00702 #define ALP_MS_DML_COL_AUDIO_BITRATE            "bitrate"       
00703 #define ALP_MS_DML_COL_AUDIO_SAMPLERATE         "samplerate"    
00704 #define ALP_MS_DML_COL_AUDIO_TRACKNUM           "tracknum"              
00705 #define ALP_MS_DML_COL_AUDIO_TOTAL_TRACKS       "totaltracks"   
00706         
00707 // Audio Pic
00708 #define ALP_MS_DML_COL_AUDIO_PIC_PATH           "pic_file_location"   
00709         
00710 // Collection
00711 #define ALP_MS_DML_COL_COLLECTION_TITLE         "title"                 
00712 #define ALP_MS_DML_COL_COLLECTION_COUNT         "count"                 
00713 
00714 // Document
00715 #define ALP_MS_DML_COL_DOCUMENT_TYPE            "mimetype"              
00716 #define ALP_MS_DML_COL_DOCUMENT_NOTES           "notes"                 
00717 #define ALP_MS_DML_COL_DOCUMENT_DESCRIPTION     "title"         
00718 #define ALP_MS_DML_COL_DOCUMENT_TITLE       "title"         
00719         
00720 // Video
00721 #define ALP_MS_DML_COL_VIDEO_TITLE                      "title"                 
00722 #define ALP_MS_DML_COL_VIDEO_GENRE                      "genre"                 
00723 #define ALP_MS_DML_COL_VIDEO_DURATION           "duration"              
00724 #define ALP_MS_DML_COL_VIDEO_CREATION_TIME      "ctime"                 
00725 #define ALP_MS_DML_COL_VIDEO_PLAY_COUNT         "play_count"    
00726 #define ALP_MS_DML_COL_VIDEO_NOTES                      "notes"                 
00727 #define ALP_MS_DML_COL_VIDEO_WIDTH                      "width"                 
00728 #define ALP_MS_DML_COL_VIDEO_HEIGHT                     "height"                
00729 
00730 #define ALP_MS_DML_COL_VIDEO_CTIME                      "ctime"                 
00731         
00732 // Image
00733 #define ALP_MS_DML_COL_IMAGE_TITLE                      "title"                 
00734 #define ALP_MS_DML_COL_IMAGE_WIDTH                      "width"                 
00735 #define ALP_MS_DML_COL_IMAGE_HEIGHT                     "height"                
00736 #define ALP_MS_DML_COL_IMAGE_NOTES                      "notes"                 
00737 
00738 // Ringtone
00739 #define ALP_MS_DML_COL_RINGTONE_DURATION        "duration"              
00740 #define ALP_MS_DML_COL_RINGTONE_TITLE           "title"                 
00741         
00742 // Voice
00743 #define ALP_MS_DML_COL_VOICE_DURATION           "duration"              
00744 #define ALP_MS_DML_COL_VOICE_TITLE              "title"                 
00745 #define ALP_MS_DML_COL_VOICE_BITRATE            "bitrate"               
00746 #define ALP_MS_DML_COL_VOICE_SAMPLERATE         "samplerate"            
00747     
00748 
00749 // Constants for values to be used with alp_ms_dml_item*() api for the item_type parameter.
00750 #define ALP_MS_ITEM_TYPE_AUDIO                  ALP_MS_CATEGORY_AUDIO        
00751 #define ALP_MS_ITEM_TYPE_AUDIO_PIC              ALP_MS_CATEGORY_AUDIO_PIC    
00752 #define ALP_MS_ITEM_TYPE_DOCUMENT               ALP_MS_CATEGORY_APPLICATION  
00753 #define ALP_MS_ITEM_TYPE_APPLICATION    ALP_MS_CATEGORY_APPLICATION  
00754 #define ALP_MS_ITEM_TYPE_VIDEO                  ALP_MS_CATEGORY_VIDEO        
00755 #define ALP_MS_ITEM_TYPE_IMAGE                  ALP_MS_CATEGORY_IMAGE        
00756 #define ALP_MS_ITEM_TYPE_RINGTONE               ALP_MS_CATEGORY_RINGTONE     
00757 #define ALP_MS_ITEM_TYPE_VOICE                  ALP_MS_CATEGORY_VOICE        
00758 
00759 // 3.2: types
00760         
00761 // 3.3: entry points
00762     
00763 // Open and Close
00764 
00769     alp_status_t     alp_ms_dml_open(AlpDmlH *dmlH);
00770 
00775     alp_status_t     alp_ms_dml_flush(AlpDmlH dmlH);
00776 
00781     alp_status_t     alp_ms_dml_close(AlpDmlH dmlH);
00782 
00783 // Write Item
00784   
00797     alp_status_t      alp_ms_dml_item_create(const char* item_type, AlpDmlItemH* itemH, const char* path);
00798 
00803     alp_status_t      alp_ms_dml_item_destroy(AlpDmlItemH itemH);
00804 
00815     alp_status_t      alp_ms_dml_item_set_int32(AlpDmlItemH itemH, const char* dml_column, int32_t* value);
00816 
00827     alp_status_t      alp_ms_dml_item_set_int64(AlpDmlItemH itemH, const char* dml_column, int64_t* value);
00828 
00838     alp_status_t      alp_ms_dml_item_set_string(AlpDmlItemH itemH, const char* dml_column, const char* value);
00839      
00852     alp_status_t     alp_ms_dml_commit_item(AlpDmlH dmlH, AlpDmlItemH itemH);
00853 
00854 // Read Item
00855         
00863     typedef int (*AlpMsCallbackFunction)(void *user_data, int argc, char **argv, char **azColName);
00864 
00873     typedef struct
00874     {
00875         const char *category;      
00876         const char *fields;        
00877     
00878         const char *filter;        
00879     
00880         const char *matchField;    
00881         const char *match;                 
00882 
00883     
00884         const char *regexField;    
00885         const char *regex;                 
00886 
00887         const char *includedCategories;  
00888         const char *excludedCategories;  
00893         const char *sortby;                
00894         bool ascending;                    
00895     
00896         int start;                                 
00897         int limit;                                 
00898     } alp_ms_dml_statement_parameters;
00899     
00905     alp_status_t alp_ms_dml_statement_parameters_clear(alp_ms_dml_statement_parameters* parameters);
00906         
00913     alp_status_t alp_ms_dml_statement_parameters_set_fields(alp_ms_dml_statement_parameters* parameters,
00914             const char *category, const char *fields);
00915 
00923     alp_status_t alp_ms_dml_statement_parameters_set_match(alp_ms_dml_statement_parameters* parameters,
00924             const char *matchField, const char *match);
00925         
00932     alp_status_t alp_ms_dml_statement_parameters_set_regex(alp_ms_dml_statement_parameters* parameters,
00933             const char *regexField, const char *regex);
00934         
00943     alp_status_t alp_ms_dml_statement_parameters_set_select_by_category(alp_ms_dml_statement_parameters* parameters,
00944             const char *includedCategories, const char *excludedCategories);
00945     
00952     alp_status_t alp_ms_dml_statement_parameters_set_sort(alp_ms_dml_statement_parameters* parameters,
00953             const char *sortby, bool ascending);
00954         
00961     alp_status_t alp_ms_dml_statement_parameters_set_skip(alp_ms_dml_statement_parameters* parameters,
00962             int start, int limit);
00963         
00973     alp_status_t alp_ms_dml_statement_build_single_file_filter(const char* filename, char** filter);
00974 
00976     enum alp_ms_dml_statement_exec_offsets
00977     {
00978         alp_ms_dml_statement_exec_location_offset = -2, 
00979         alp_ms_dml_statement_exec_file_id_offset = -1   
00980     };
00981     
00993     alp_status_t alp_ms_dml_statement_exec(AlpDmlH dmlH, 
00994         AlpMsCallbackFunction callback, void* data, alp_ms_dml_statement_parameters* params,
00995         int* numResults                          
00996     );
00997 
00998     //TODO: Reorder the params so all OUT params are last? (Would have to change app code.)
01008     alp_status_t alp_ms_dml_statement_begin(AlpDmlH dmlH, AlpDmlStatementH *stmtH,                 
01009         alp_ms_dml_statement_parameters* params, int* numResults                                
01010     );
01011           
01018     alp_status_t alp_ms_dml_statement_next(AlpDmlStatementH stmtH);
01019     
01025     alp_status_t alp_ms_dml_statement_end(AlpDmlStatementH stmtH);
01026 
01034     alp_status_t alp_ms_dml_statement_get_columns(AlpDmlStatementH stmtH,
01035         int* columnCount, gchar*** columnNames
01036     );
01037 
01049     alp_status_t alp_ms_dml_statement_get_int32(AlpDmlStatementH stmtH, const char* dml_column, int32_t *value);
01050     
01061     alp_status_t alp_ms_dml_statement_get_int64(AlpDmlStatementH stmtH, const char* dml_column, int64_t *value);
01062     
01072     alp_status_t alp_ms_dml_statement_get_string(AlpDmlStatementH stmtH, const char* dml_column, const char **value);
01073 
01080     alp_status_t alp_ms_dml_statement_get_file_url(AlpDmlStatementH stmtH, const char** url);
01081 
01083     
01084 //
01085 // Section 4:   mediafile public API
01086 //        
01087         
01088 // 4.1: macros and constants
01089         
01095 
01096 #define ALP_MF_URL_CARD_PREFIX   "card://"
01097 
01099 #define ALP_MF_URL_DEVICE_PREFIX "file://"
01100 
01102 #define ALP_MF_THUMBNAILER_PSEUDOAPP "background.thumbnailer"
01103     
01104 // 4.2: types
01105     
01106 typedef void* AlpFileMime;
01107 
01108 // 4.3: entry points
01109         
01119     alp_status_t alp_mf_get_media_path(const char* udi, const char* filename, char** outpath);
01120         
01127     alp_status_t alp_mf_get_media_file_type_id(const char* desc, int32_t* ftid);
01128 
01135     alp_status_t alp_mf_get_file_url(const char* full_path, char** urlout);
01136         
01144     alp_status_t alp_mf_get_url_path(const char* url, char** pathout);
01145         
01154     alp_status_t alp_mf_get_path_udi(const char* path, char** udi);
01155         
01163     alp_status_t alp_mf_get_url_udi(const char* url, char** udi);
01164         
01181     alp_status_t alp_mf_get_file_thumbnail_path(const char* path, char** pathout) DEPRECATED;
01182 
01201     alp_status_t alp_mf_get_file_thumbnail_path_extended(const char* path, const char* notification, char** pathout, int* token);
01202 
01210     alp_status_t alp_mf_get_file_icon_path(const char* path, char** pathout);
01211 
01219     alp_status_t alp_mf_get_mime_icon_path(const char* mime, char** pathout);
01220 
01221 // Mime determination for media files.
01222         
01229     alp_status_t alp_mf_mime_init(const char* file, AlpFileMime* handle);
01230 
01236     alp_status_t alp_mf_mime_fini(AlpFileMime handle);
01237         
01244     alp_status_t alp_mf_mime_set_to(AlpFileMime handle, const char* file);
01245         
01255     char* alp_mf_mime_get_supertype(AlpFileMime handle);
01256 
01266     char* alp_mf_mime_get_subtype(AlpFileMime handle);
01267 
01273     char* alp_mf_mime_get_mime_string(AlpFileMime handle);
01274         
01281     bool alp_mf_mime_is_supported(AlpFileMime handle);
01282         
01293     alp_status_t alp_mf_get_mime_for_file(const char* file, char** outmime);
01294         
01296     
01297 G_END_DECLS
01298         
01299 #ifdef Copy__of__Status__define 
01300 #define Status Copy__of__Status__define 
01301 #undef Copy__of__Status__define 
01302 #endif
01303         
01304 #endif        
01305 
01306 // @}   /* ALP_MULTIMEDIA */

Generated on Wed Jul 30 07:06:39 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.