     constructor: (settings) ->
       @settings = utils.buildSettings settings
       @__files = []
+
+      @finalized = false
+
+      @onFileAdded = $.Callbacks()
+      @onFileRemoved = $.Callbacks()
 
       @__uploadDf = $.Deferred()
       @__infoDf = $.Deferred()

      file for file in @__files # returns copy of @__files

    add: (file) ->
      @__files.push file
      file.progress (progressInfo) =>
        @__fileProgresses[file] = progressInfo.progress
        @__singleFileDf.notify @__progressInfo()

    remove: (file) ->
      if (index = files.indexOf(file)) isnt -1
        file.splice(index, 1)
        # TODO unsubsribe progress

    save: ->
      @__finalize()

          .fail =>
            @__infoDf.reject('info')

    cancel: =>
      @__finalize()
      file.cancel() for file in @__files

    # returns object that act like single file
    asSingle: ->
      pr = @__singleFileDf.promise()
      pr.cancel = @cancel

    __progressInfo: ->
      progress = 0
