/**
  * Copyright 2016 Dropbox, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *    http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */

package djinni

import java.io._

import djinni.ast._
import djinni.generatorTools._

class SwiftBridgingHeaderGenerator(spec: Spec) extends Generator(spec) {
  val marshal = new ObjcMarshal(spec)

  override def generateEnum(origin: String, ident: Ident, doc: Doc, e: Enum) {
    spec.objcSwiftBridgingHeaderWriter.get.write("#import \"" + marshal.headerName(ident) + "\"\n")
  }

  override def generateInterface(origin: String, ident: Ident, doc: Doc, typeParams: Seq[TypeParam], i: Interface) {
    spec.objcSwiftBridgingHeaderWriter.get.write("#import \"" + marshal.headerName(ident) + "\"\n")
  }

  override def generateRecord(origin: String, ident: Ident, doc: Doc, params: Seq[TypeParam], r: Record) {
    spec.objcSwiftBridgingHeaderWriter.get.write("#import \"" + marshal.headerName(ident) + "\"\n")
  }
}

object SwiftBridgingHeaderGenerator {
  def writeAutogenerationWarning(writer: Writer) {
    writer.write("// AUTOGENERATED FILE - DO NOT MODIFY!\n")
    writer.write("// This file generated by Djinni\n\n")
  }
}