1 //====== Copyright 1996-2013, Valve Corporation, All rights reserved. =======
2 //
3 // Purpose: interface to steam ugc
4 //
5 //=============================================================================
6 
7 #ifndef ISTEAMUGC_H
8 #define ISTEAMUGC_H
9 #ifdef _WIN32
10 #pragma once
11 #endif
12 
13 #include "isteamclient.h"
14 
15 // callbacks
16 #if defined( VALVE_CALLBACK_PACK_SMALL )
17 #pragma pack( push, 4 )
18 #elif defined( VALVE_CALLBACK_PACK_LARGE )
19 #pragma pack( push, 8 )
20 #else
21 #error isteamclient.h must be included
22 #endif
23 
24 
25 typedef uint64 UGCQueryHandle_t;
26 typedef uint64 UGCUpdateHandle_t;
27 
28 
29 const UGCQueryHandle_t k_UGCQueryHandleInvalid = 0xffffffffffffffffull;
30 const UGCUpdateHandle_t k_UGCUpdateHandleInvalid = 0xffffffffffffffffull;
31 
32 
33 // Matching UGC types for queries
34 enum EUGCMatchingUGCType
35 {
36 	k_EUGCMatchingUGCType_Items				 = 0,		// both mtx items and ready-to-use items
37 	k_EUGCMatchingUGCType_Items_Mtx			 = 1,
38 	k_EUGCMatchingUGCType_Items_ReadyToUse	 = 2,
39 	k_EUGCMatchingUGCType_Collections		 = 3,
40 	k_EUGCMatchingUGCType_Artwork			 = 4,
41 	k_EUGCMatchingUGCType_Videos			 = 5,
42 	k_EUGCMatchingUGCType_Screenshots		 = 6,
43 	k_EUGCMatchingUGCType_AllGuides			 = 7,		// both web guides and integrated guides
44 	k_EUGCMatchingUGCType_WebGuides			 = 8,
45 	k_EUGCMatchingUGCType_IntegratedGuides	 = 9,
46 	k_EUGCMatchingUGCType_UsableInGame		 = 10,		// ready-to-use items and integrated guides
47 	k_EUGCMatchingUGCType_ControllerBindings = 11,
48 	k_EUGCMatchingUGCType_GameManagedItems	 = 12,		// game managed items (not managed by users)
49 	k_EUGCMatchingUGCType_All				 = ~0,		// return everything
50 };
51 
52 // Different lists of published UGC for a user.
53 // If the current logged in user is different than the specified user, then some options may not be allowed.
54 enum EUserUGCList
55 {
56 	k_EUserUGCList_Published,
57 	k_EUserUGCList_VotedOn,
58 	k_EUserUGCList_VotedUp,
59 	k_EUserUGCList_VotedDown,
60 	k_EUserUGCList_WillVoteLater,
61 	k_EUserUGCList_Favorited,
62 	k_EUserUGCList_Subscribed,
63 	k_EUserUGCList_UsedOrPlayed,
64 	k_EUserUGCList_Followed,
65 };
66 
67 // Sort order for user published UGC lists (defaults to creation order descending)
68 enum EUserUGCListSortOrder
69 {
70 	k_EUserUGCListSortOrder_CreationOrderDesc,
71 	k_EUserUGCListSortOrder_CreationOrderAsc,
72 	k_EUserUGCListSortOrder_TitleAsc,
73 	k_EUserUGCListSortOrder_LastUpdatedDesc,
74 	k_EUserUGCListSortOrder_SubscriptionDateDesc,
75 	k_EUserUGCListSortOrder_VoteScoreDesc,
76 	k_EUserUGCListSortOrder_ForModeration,
77 };
78 
79 // Combination of sorting and filtering for queries across all UGC
80 enum EUGCQuery
81 {
82 	k_EUGCQuery_RankedByVote								  = 0,
83 	k_EUGCQuery_RankedByPublicationDate						  = 1,
84 	k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate		  = 2,
85 	k_EUGCQuery_RankedByTrend								  = 3,
86 	k_EUGCQuery_FavoritedByFriendsRankedByPublicationDate	  = 4,
87 	k_EUGCQuery_CreatedByFriendsRankedByPublicationDate		  = 5,
88 	k_EUGCQuery_RankedByNumTimesReported					  = 6,
89 	k_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate = 7,
90 	k_EUGCQuery_NotYetRated									  = 8,
91 	k_EUGCQuery_RankedByTotalVotesAsc						  = 9,
92 	k_EUGCQuery_RankedByVotesUp								  = 10,
93 	k_EUGCQuery_RankedByTextSearch							  = 11,
94 	k_EUGCQuery_RankedByTotalUniqueSubscriptions			  = 12,
95 	k_EUGCQuery_RankedByPlaytimeTrend						  = 13,
96 	k_EUGCQuery_RankedByTotalPlaytime						  = 14,
97 	k_EUGCQuery_RankedByAveragePlaytimeTrend				  = 15,
98 	k_EUGCQuery_RankedByLifetimeAveragePlaytime				  = 16,
99 	k_EUGCQuery_RankedByPlaytimeSessionsTrend				  = 17,
100 	k_EUGCQuery_RankedByLifetimePlaytimeSessions			  = 18,
101 };
102 
103 enum EItemUpdateStatus
104 {
105 	k_EItemUpdateStatusInvalid 				= 0, // The item update handle was invalid, job might be finished, listen too SubmitItemUpdateResult_t
106 	k_EItemUpdateStatusPreparingConfig 		= 1, // The item update is processing configuration data
107 	k_EItemUpdateStatusPreparingContent		= 2, // The item update is reading and processing content files
108 	k_EItemUpdateStatusUploadingContent		= 3, // The item update is uploading content changes to Steam
109 	k_EItemUpdateStatusUploadingPreviewFile	= 4, // The item update is uploading new preview file image
110 	k_EItemUpdateStatusCommittingChanges	= 5  // The item update is committing all changes
111 };
112 
113 enum EItemState
114 {
115 	k_EItemStateNone			= 0,	// item not tracked on client
116 	k_EItemStateSubscribed		= 1,	// current user is subscribed to this item. Not just cached.
117 	k_EItemStateLegacyItem		= 2,	// item was created with ISteamRemoteStorage
118 	k_EItemStateInstalled		= 4,	// item is installed and usable (but maybe out of date)
119 	k_EItemStateNeedsUpdate		= 8,	// items needs an update. Either because it's not installed yet or creator updated content
120 	k_EItemStateDownloading		= 16,	// item update is currently downloading
121 	k_EItemStateDownloadPending	= 32,	// DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired
122 };
123 
124 enum EItemStatistic
125 {
126 	k_EItemStatistic_NumSubscriptions					 = 0,
127 	k_EItemStatistic_NumFavorites						 = 1,
128 	k_EItemStatistic_NumFollowers						 = 2,
129 	k_EItemStatistic_NumUniqueSubscriptions				 = 3,
130 	k_EItemStatistic_NumUniqueFavorites					 = 4,
131 	k_EItemStatistic_NumUniqueFollowers					 = 5,
132 	k_EItemStatistic_NumUniqueWebsiteViews				 = 6,
133 	k_EItemStatistic_ReportScore						 = 7,
134 	k_EItemStatistic_NumSecondsPlayed					 = 8,
135 	k_EItemStatistic_NumPlaytimeSessions				 = 9,
136 	k_EItemStatistic_NumComments						 = 10,
137 	k_EItemStatistic_NumSecondsPlayedDuringTimePeriod	 = 11,
138 	k_EItemStatistic_NumPlaytimeSessionsDuringTimePeriod = 12,
139 };
140 
141 enum EItemPreviewType
142 {
143 	k_EItemPreviewType_Image							= 0,	// standard image file expected (e.g. jpg, png, gif, etc.)
144 	k_EItemPreviewType_YouTubeVideo						= 1,	// video id is stored
145 	k_EItemPreviewType_Sketchfab						= 2,	// model id is stored
146 	k_EItemPreviewType_EnvironmentMap_HorizontalCross	= 3,	// standard image file expected - cube map in the layout
147 																// +---+---+-------+
148 																// |   |Up |       |
149 																// +---+---+---+---+
150 																// | L | F | R | B |
151 																// +---+---+---+---+
152 																// |   |Dn |       |
153 																// +---+---+---+---+
154 	k_EItemPreviewType_EnvironmentMap_LatLong			= 4,	// standard image file expected
155 	k_EItemPreviewType_ReservedMax						= 255,	// you can specify your own types above this value
156 };
157 
158 const uint32 kNumUGCResultsPerPage = 50;
159 const uint32 k_cchDeveloperMetadataMax = 5000;
160 
161 // Details for a single published file/UGC
162 struct SteamUGCDetails_t
163 {
164 	PublishedFileId_t m_nPublishedFileId;
165 	EResult m_eResult;												// The result of the operation.
166 	EWorkshopFileType m_eFileType;									// Type of the file
167 	AppId_t m_nCreatorAppID;										// ID of the app that created this file.
168 	AppId_t m_nConsumerAppID;										// ID of the app that will consume this file.
169 	char m_rgchTitle[k_cchPublishedDocumentTitleMax];				// title of document
170 	char m_rgchDescription[k_cchPublishedDocumentDescriptionMax];	// description of document
171 	uint64 m_ulSteamIDOwner;										// Steam ID of the user who created this content.
172 	uint32 m_rtimeCreated;											// time when the published file was created
173 	uint32 m_rtimeUpdated;											// time when the published file was last updated
174 	uint32 m_rtimeAddedToUserList;									// time when the user added the published file to their list (not always applicable)
175 	ERemoteStoragePublishedFileVisibility m_eVisibility;			// visibility
176 	bool m_bBanned;													// whether the file was banned
177 	bool m_bAcceptedForUse;											// developer has specifically flagged this item as accepted in the Workshop
178 	bool m_bTagsTruncated;											// whether the list of tags was too long to be returned in the provided buffer
179 	char m_rgchTags[k_cchTagListMax];								// comma separated list of all tags associated with this file
180 	// file/url information
181 	UGCHandle_t m_hFile;											// The handle of the primary file
182 	UGCHandle_t m_hPreviewFile;										// The handle of the preview file
183 	char m_pchFileName[k_cchFilenameMax];							// The cloud filename of the primary file
184 	int32 m_nFileSize;												// Size of the primary file
185 	int32 m_nPreviewFileSize;										// Size of the preview file
186 	char m_rgchURL[k_cchPublishedFileURLMax];						// URL (for a video or a website)
187 	// voting information
188 	uint32 m_unVotesUp;												// number of votes up
189 	uint32 m_unVotesDown;											// number of votes down
190 	float m_flScore;												// calculated score
191 	// collection details
192 	uint32 m_unNumChildren;
193 };
194 
195 //-----------------------------------------------------------------------------
196 // Purpose: Steam UGC support API
197 //-----------------------------------------------------------------------------
198 class ISteamUGC
199 {
200 public:
201 
202 	// Query UGC associated with a user. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.
203 	virtual UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
204 
205 	// Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1.
206 	virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
207 
208 	// Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this)
209 	virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
210 
211 	// Send the query to Steam
212 	CALL_RESULT( SteamUGCQueryCompleted_t )
213 	virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
214 
215 	// Retrieve an individual result after receiving the callback for querying UGC
216 	virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0;
217 	virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0;
218 	virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0;
219 	virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0;
220 	virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint64 *pStatValue ) = 0;
221 	virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0;
222 	virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0;
223 	virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0;
224 	virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
225 
226 	// Release the request to free up memory, after retrieving results
227 	virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
228 
229 	// Options to set for querying UGC
230 	virtual bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName ) = 0;
231 	virtual bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName ) = 0;
232 	virtual bool SetReturnOnlyIDs( UGCQueryHandle_t handle, bool bReturnOnlyIDs ) = 0;
233 	virtual bool SetReturnKeyValueTags( UGCQueryHandle_t handle, bool bReturnKeyValueTags ) = 0;
234 	virtual bool SetReturnLongDescription( UGCQueryHandle_t handle, bool bReturnLongDescription ) = 0;
235 	virtual bool SetReturnMetadata( UGCQueryHandle_t handle, bool bReturnMetadata ) = 0;
236 	virtual bool SetReturnChildren( UGCQueryHandle_t handle, bool bReturnChildren ) = 0;
237 	virtual bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ) = 0;
238 	virtual bool SetReturnTotalOnly( UGCQueryHandle_t handle, bool bReturnTotalOnly ) = 0;
239 	virtual bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint32 unDays ) = 0;
240 	virtual bool SetLanguage( UGCQueryHandle_t handle, const char *pchLanguage ) = 0;
241 	virtual bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ) = 0;
242 
243 	// Options only for querying user UGC
244 	virtual bool SetCloudFileNameFilter( UGCQueryHandle_t handle, const char *pMatchCloudFileName ) = 0;
245 
246 	// Options only for querying all UGC
247 	virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0;
248 	virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0;
249 	virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
250 	virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
251 
252 	// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
253 	virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
254 
255 	// Steam Workshop Creator API
256 	CALL_RESULT( CreateItemResult_t )
257 	virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet
258 
259 	virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate()
260 
261 	virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item
262 	virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item
263 	virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set
264 	virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax)
265 	virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item
266 	virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item
267 	virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder
268 	virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; //  change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size
269 	virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key
270 	virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag.
271 	virtual bool AddItemPreviewFile( UGCUpdateHandle_t handle, const char *pszPreviewFile, EItemPreviewType type ) = 0; //  add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
272 	virtual bool AddItemPreviewVideo( UGCUpdateHandle_t handle, const char *pszVideoID ) = 0; //  add preview video for this item
273 	virtual bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint32 index, const char *pszPreviewFile ) = 0; //  updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
274 	virtual bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint32 index, const char *pszVideoID ) = 0; //  updates an existing preview video for this item
275 	virtual bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted)
276 
277 	CALL_RESULT( SubmitItemUpdateResult_t )
278 	virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate()
279 	virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0;
280 
281 	// Steam Workshop Consumer API
282 	CALL_RESULT( SetUserItemVoteResult_t )
283 	virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0;
284 	CALL_RESULT( GetUserItemVoteResult_t )
285 	virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0;
286 	CALL_RESULT( UserFavoriteItemsListChanged_t )
287 	virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0;
288 	CALL_RESULT( UserFavoriteItemsListChanged_t )
289 	virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0;
290 	CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t )
291 	virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP
292 	CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t )
293 	virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits
294 	virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items
295 	virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs
296 
297 	// get EItemState flags about item on this client
298 	virtual uint32 GetItemState( PublishedFileId_t nPublishedFileID ) = 0;
299 
300 	// get info about currently installed content on disc for items that have k_EItemStateInstalled set
301 	// if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder)
302 	virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0;
303 
304 	// get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once
305 	virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0;
306 
307 	// download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed,
308 	// then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time.
309 	// If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP.
310 	virtual bool DownloadItem( PublishedFileId_t nPublishedFileID, bool bHighPriority ) = 0;
311 
312 	// game servers can set a specific workshop folder before issuing any UGC commands.
313 	// This is helpful if you want to support multiple game servers running out of the same install folder
314 	virtual bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const char *pszFolder ) = 0;
315 
316 	// SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends
317 	virtual void SuspendDownloads( bool bSuspend ) = 0;
318 
319 	// usage tracking
320 	CALL_RESULT( StartPlaytimeTrackingResult_t )
321 	virtual SteamAPICall_t StartPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
322 	CALL_RESULT( StopPlaytimeTrackingResult_t )
323 	virtual SteamAPICall_t StopPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
324 	CALL_RESULT( StopPlaytimeTrackingResult_t )
325 	virtual SteamAPICall_t StopPlaytimeTrackingForAllItems() = 0;
326 
327 	// parent-child relationship or dependency management
328 	CALL_RESULT( AddUGCDependencyResult_t )
329 	virtual SteamAPICall_t AddDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0;
330 	CALL_RESULT( RemoveUGCDependencyResult_t )
331 	virtual SteamAPICall_t RemoveDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0;
332 
333 	// add/remove app dependence/requirements (usually DLC)
334 	CALL_RESULT( AddAppDependencyResult_t )
335 	virtual SteamAPICall_t AddAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0;
336 	CALL_RESULT( RemoveAppDependencyResult_t )
337 	virtual SteamAPICall_t RemoveAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0;
338 	// request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times
339 	// until all app dependencies have been returned
340 	CALL_RESULT( GetAppDependenciesResult_t )
341 	virtual SteamAPICall_t GetAppDependencies( PublishedFileId_t nPublishedFileID ) = 0;
342 
343 	// delete the item without prompting the user
344 	CALL_RESULT( DeleteItemResult_t )
345 	virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0;
346 };
347 
348 #define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION010"
349 
350 //-----------------------------------------------------------------------------
351 // Purpose: Callback for querying UGC
352 //-----------------------------------------------------------------------------
353 struct SteamUGCQueryCompleted_t
354 {
355 	enum { k_iCallback = k_iClientUGCCallbacks + 1 };
356 	UGCQueryHandle_t m_handle;
357 	EResult m_eResult;
358 	uint32 m_unNumResultsReturned;
359 	uint32 m_unTotalMatchingResults;
360 	bool m_bCachedData;	// indicates whether this data was retrieved from the local on-disk cache
361 };
362 
363 
364 //-----------------------------------------------------------------------------
365 // Purpose: Callback for requesting details on one piece of UGC
366 //-----------------------------------------------------------------------------
367 struct SteamUGCRequestUGCDetailsResult_t
368 {
369 	enum { k_iCallback = k_iClientUGCCallbacks + 2 };
370 	SteamUGCDetails_t m_details;
371 	bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache
372 };
373 
374 
375 //-----------------------------------------------------------------------------
376 // Purpose: result for ISteamUGC::CreateItem()
377 //-----------------------------------------------------------------------------
378 struct CreateItemResult_t
379 {
380 	enum { k_iCallback = k_iClientUGCCallbacks + 3 };
381 	EResult m_eResult;
382 	PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID
383 	bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
384 };
385 
386 
387 //-----------------------------------------------------------------------------
388 // Purpose: result for ISteamUGC::SubmitItemUpdate()
389 //-----------------------------------------------------------------------------
390 struct SubmitItemUpdateResult_t
391 {
392 	enum { k_iCallback = k_iClientUGCCallbacks + 4 };
393 	EResult m_eResult;
394 	bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
395 	PublishedFileId_t m_nPublishedFileId;
396 };
397 
398 
399 //-----------------------------------------------------------------------------
400 // Purpose: a Workshop item has been installed or updated
401 //-----------------------------------------------------------------------------
402 struct ItemInstalled_t
403 {
404 	enum { k_iCallback = k_iClientUGCCallbacks + 5 };
405 	AppId_t m_unAppID;
406 	PublishedFileId_t m_nPublishedFileId;
407 };
408 
409 
410 //-----------------------------------------------------------------------------
411 // Purpose: result of DownloadItem(), existing item files can be accessed again
412 //-----------------------------------------------------------------------------
413 struct DownloadItemResult_t
414 {
415 	enum { k_iCallback = k_iClientUGCCallbacks + 6 };
416 	AppId_t m_unAppID;
417 	PublishedFileId_t m_nPublishedFileId;
418 	EResult m_eResult;
419 };
420 
421 //-----------------------------------------------------------------------------
422 // Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites()
423 //-----------------------------------------------------------------------------
424 struct UserFavoriteItemsListChanged_t
425 {
426 	enum { k_iCallback = k_iClientUGCCallbacks + 7 };
427 	PublishedFileId_t m_nPublishedFileId;
428 	EResult m_eResult;
429 	bool m_bWasAddRequest;
430 };
431 
432 //-----------------------------------------------------------------------------
433 // Purpose: The result of a call to SetUserItemVote()
434 //-----------------------------------------------------------------------------
435 struct SetUserItemVoteResult_t
436 {
437 	enum { k_iCallback = k_iClientUGCCallbacks + 8 };
438 	PublishedFileId_t m_nPublishedFileId;
439 	EResult m_eResult;
440 	bool m_bVoteUp;
441 };
442 
443 //-----------------------------------------------------------------------------
444 // Purpose: The result of a call to GetUserItemVote()
445 //-----------------------------------------------------------------------------
446 struct GetUserItemVoteResult_t
447 {
448 	enum { k_iCallback = k_iClientUGCCallbacks + 9 };
449 	PublishedFileId_t m_nPublishedFileId;
450 	EResult m_eResult;
451 	bool m_bVotedUp;
452 	bool m_bVotedDown;
453 	bool m_bVoteSkipped;
454 };
455 
456 //-----------------------------------------------------------------------------
457 // Purpose: The result of a call to StartPlaytimeTracking()
458 //-----------------------------------------------------------------------------
459 struct StartPlaytimeTrackingResult_t
460 {
461 	enum { k_iCallback = k_iClientUGCCallbacks + 10 };
462 	EResult m_eResult;
463 };
464 
465 //-----------------------------------------------------------------------------
466 // Purpose: The result of a call to StopPlaytimeTracking()
467 //-----------------------------------------------------------------------------
468 struct StopPlaytimeTrackingResult_t
469 {
470 	enum { k_iCallback = k_iClientUGCCallbacks + 11 };
471 	EResult m_eResult;
472 };
473 
474 //-----------------------------------------------------------------------------
475 // Purpose: The result of a call to AddDependency
476 //-----------------------------------------------------------------------------
477 struct AddUGCDependencyResult_t
478 {
479 	enum { k_iCallback = k_iClientUGCCallbacks + 12 };
480 	EResult m_eResult;
481 	PublishedFileId_t m_nPublishedFileId;
482 	PublishedFileId_t m_nChildPublishedFileId;
483 };
484 
485 //-----------------------------------------------------------------------------
486 // Purpose: The result of a call to RemoveDependency
487 //-----------------------------------------------------------------------------
488 struct RemoveUGCDependencyResult_t
489 {
490 	enum { k_iCallback = k_iClientUGCCallbacks + 13 };
491 	EResult m_eResult;
492 	PublishedFileId_t m_nPublishedFileId;
493 	PublishedFileId_t m_nChildPublishedFileId;
494 };
495 
496 
497 //-----------------------------------------------------------------------------
498 // Purpose: The result of a call to AddAppDependency
499 //-----------------------------------------------------------------------------
500 struct AddAppDependencyResult_t
501 {
502 	enum { k_iCallback = k_iClientUGCCallbacks + 14 };
503 	EResult m_eResult;
504 	PublishedFileId_t m_nPublishedFileId;
505 	AppId_t m_nAppID;
506 };
507 
508 //-----------------------------------------------------------------------------
509 // Purpose: The result of a call to RemoveAppDependency
510 //-----------------------------------------------------------------------------
511 struct RemoveAppDependencyResult_t
512 {
513 	enum { k_iCallback = k_iClientUGCCallbacks + 15 };
514 	EResult m_eResult;
515 	PublishedFileId_t m_nPublishedFileId;
516 	AppId_t m_nAppID;
517 };
518 
519 //-----------------------------------------------------------------------------
520 // Purpose: The result of a call to GetAppDependencies.  Callback may be called
521 //			multiple times until all app dependencies have been returned.
522 //-----------------------------------------------------------------------------
523 struct GetAppDependenciesResult_t
524 {
525 	enum { k_iCallback = k_iClientUGCCallbacks + 16 };
526 	EResult m_eResult;
527 	PublishedFileId_t m_nPublishedFileId;
528 	AppId_t m_rgAppIDs[32];
529 	uint32 m_nNumAppDependencies;		// number returned in this struct
530 	uint32 m_nTotalNumAppDependencies;	// total found
531 };
532 
533 //-----------------------------------------------------------------------------
534 // Purpose: The result of a call to DeleteItem
535 //-----------------------------------------------------------------------------
536 struct DeleteItemResult_t
537 {
538 	enum { k_iCallback = k_iClientUGCCallbacks + 17 };
539 	EResult m_eResult;
540 	PublishedFileId_t m_nPublishedFileId;
541 };
542 
543 #pragma pack( pop )
544 
545 #endif // ISTEAMUGC_H
546