00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef CG_UPNP_AV_CCONTENTDIRECTORY_H
00010 #define CG_UPNP_AV_CCONTENTDIRECTORY_H
00011
00012 #include <cybergarage/upnp/cdevice.h>
00013 #include <cybergarage/upnp/cservice.h>
00014 #include <cybergarage/upnp/caction.h>
00015 #include <cybergarage/xml/cxml.h>
00016
00017
00018
00019
00020 #define CG_UPNP_CDS_SERVICE_TYPE "urn:schemas-upnp-org:service:ContentDirectory"
00021
00022
00023
00024
00025 #define CG_UPNP_CDS_ACTION_GETSEARCHCAPABILITIES "GetSearchCapabilities"
00026 #define CG_UPNP_CDS_ACTION_GETSORTCAPABILITIES "GetSortCapabilities"
00027 #define CG_UPNP_CDS_ACTION_GETSYSTEMUPDATEID "GetSystemUpdateID"
00028 #define CG_UPNP_CDS_ACTION_BROWSE "Browse"
00029
00030
00031
00032
00033 #define CG_UPNP_CDS_ACTION_SEARCH "Search"
00034 #define CG_UPNP_CDS_ACTION_CREATEOBJECT "CreateObject"
00035 #define CG_UPNP_CDS_ACTION_DESTROYOBJECT "DestroyObject"
00036 #define CG_UPNP_CDS_ACTION_UPDATEOBJECT "UpdateObject"
00037 #define CG_UPNP_CDS_ACTION_IMPORTRESOURCE "ImportResource"
00038 #define CG_UPNP_CDS_ACTION_EXPORTRESOURCE "ExportResource"
00039 #define CG_UPNP_CDS_ACTION_STOPTRANSFERRESOURCE "StopTransferResource"
00040 #define CG_UPNP_CDS_ACTION_GETTRANSFERPROGRESS "GetTransferResource"
00041 #define CG_UPNP_CDS_ACTION_DELETERESOURCE "DeleteResource"
00042 #define CG_UPNP_CDS_ACTION_CREATEREFERENCE "CreateReference"
00043
00044
00045
00046
00047
00066 typedef struct _CgUpnpAVCDS
00067 {
00069 CgUpnpService* upnpService;
00070
00072 CgString* sortCaps;
00073
00075 CgString* searchCaps;
00076
00078 CgString* systemUpdateID;
00079
00081 CgXmlNodeList* contentNodeList;
00082
00084 CgThread* fileWatcher;
00085
00086 } CgUpnpAVCDS;
00087
00088
00089
00090
00091
00098 CgUpnpAVCDS* cg_upnp_av_cds_new();
00099
00106 void cg_upnp_av_cds_delete(CgUpnpAVCDS* cds);
00107
00115 void cg_upnp_av_cds_add_directory(CgUpnpAVCDS* cds, CgString* dir);
00116
00124 void cg_upnp_av_cds_remove_directory(CgUpnpAVCDS* cds, CgXmlNode* node);
00125
00126
00127
00128
00129
00137 BOOL cg_upnp_av_cds_action_received(CgUpnpAction *action);
00138
00139
00140
00141
00142
00151 void cg_upnp_av_cds_directory_watcher(CgThread* thread);
00152
00153
00154
00155
00156
00163 #define cg_upnp_av_cds_get_service(cds) cds->service
00164
00165
00166
00167
00168
00175 #define cg_upnp_av_cds_setsortcaps(cds, sort_caps) \
00176 cg_string_setvalue(cds->sortCaps, sort_caps)
00177
00184 #define cg_upnp_av_cds_getsortcaps(cds) \
00185 cg_string_getvalue(cds->sortCaps)
00186
00187
00188
00189
00190
00197 #define cg_upnp_av_cds_setsearchcaps(cds, search_caps) \
00198 cg_string_setvalue(avDevice->sortCaps, search_caps)
00199
00206 #define cg_upnp_av_cds_getsearchcaps(cds) \
00207 cg_string_getvalue(cds->searchCaps)
00208
00209
00210
00211
00212
00219 #define cg_upnp_av_cds_setsystemupdateid(cds, id) \
00220 cg_string_setvalue(cds->systemUpdateID, id)
00221
00228 #define cg_upnp_av_cds_getsystemupdateid(cds) \
00229 cg_string_getvalue(cds->systemUpdateID)
00230
00231 #endif