--[[----------------------------------------------------------------------------

NmbLocalCameraProfileStatus.lua

--------------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2018 Adobe Systems Incorporated
All Rights Reserved.

NOTICE: All information contained herein is, and remain the property of
Adobe Systems Incorporated and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Adobe Systems
Incorporated and its suppliers and may be covered by U.S. and Foreign
Patents, patents in process, and are protected by trade secret or copyright
law.  Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Adobe Systems Incorporated.

--------------------------------------------------------------------------------]]

	-- wf.core
local WFCloseSupport = require 'WFCloseSupport'
local KSJsonEncoder = require 'KSJsonEncoder'

	-- WF.core.lua.threading
local WFWorkerThread = require 'WFWorkerThread'

	--
local Rx = require "Rx"
local WFRxRunUntilDone = require "WFRxRunUntilDone"

--------------------------------------------------------------------------------

local function forwardToWorker( self, apiName, ... )

	return self._worker:request( apiName, ... )

end

--==============================================================================

local NmbLocalCameraProfileStatus = {
	
	_worker = false,
	
	WFCloseSupport.addCloseSupportMethods,
}

--------------------------------------------------------------------------------

function NmbLocalCameraProfileStatus:__init( workerThreadArgs )
	
	workerThreadArgs = KSJsonEncoder.encodeOzUploadJson( workerThreadArgs )
	
	local cameraProfileStatusWorkerName = 
		string.format( "NmbLocalCameraProfileStatusWorker.lua",
			workerThreadArgs )
	
	self:setOwned {
		_worker = WFWorkerThread( cameraProfileStatusWorkerName,
								workerThreadArgs )
	}
end

--------------------------------------------------------------------------------

function NmbLocalCameraProfileStatus:populateMissingProfileInfo()

	return forwardToWorker( self, "populateMissingProfileInfo" )
		:call( WFRxRunUntilDone )

end


--------------------------------------------------------------------------------

function NmbLocalCameraProfileStatus:getCameraProfileRefreshStream()

	return forwardToWorker( self, "getCameraProfileRefreshStream" )

end

--------------------------------------------------------------------------------

function NmbLocalCameraProfileStatus:noteNewStandardProfiles( profilesAdded )

	return forwardToWorker( self, "noteNewStandardProfiles", profilesAdded )

end

--==============================================================================

return Rx.Class( 'NmbLocalCameraProfileStatus', 
					NmbLocalCameraProfileStatus )
