11ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski/*
21ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * Copyright (C) 2015 The Android Open Source Project
31ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski *
41ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * Licensed under the Apache License, Version 2.0 (the "License");
51ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * you may not use this file except in compliance with the License.
61ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * You may obtain a copy of the License at
71ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski *
81ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski *      http://www.apache.org/licenses/LICENSE-2.0
91ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski *
101ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * Unless required by applicable law or agreed to in writing, software
111ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * distributed under the License is distributed on an "AS IS" BASIS,
121ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * See the License for the specific language governing permissions and
141ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski * limitations under the License.
151ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski */
161ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
171ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#ifndef AAPT_PROCESS_IRESOURCETABLECONSUMER_H
181ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#define AAPT_PROCESS_IRESOURCETABLECONSUMER_H
191ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
201ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#include "Diagnostics.h"
211ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#include "NameMangler.h"
221ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#include "Resource.h"
231ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#include "ResourceValues.h"
241ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#include "Source.h"
251ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
261ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#include <iostream>
271ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#include <list>
281ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#include <sstream>
291ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
301ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinskinamespace aapt {
311ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
321ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinskiclass ResourceTable;
3364587af8179affd38ee26543b748f2d63b7f67bbAdam Lesinskiclass SymbolTable;
341ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
351ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinskistruct IAaptContext {
361ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski    virtual ~IAaptContext() = default;
371ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
3864587af8179affd38ee26543b748f2d63b7f67bbAdam Lesinski    virtual SymbolTable* getExternalSymbols() = 0;
391ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski    virtual IDiagnostics* getDiagnostics() = 0;
4064587af8179affd38ee26543b748f2d63b7f67bbAdam Lesinski    virtual const std::u16string& getCompilationPackage() = 0;
411ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski    virtual uint8_t getPackageId() = 0;
421ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski    virtual NameMangler* getNameMangler() = 0;
43355f285ffd000f6cfe76680eb22d010546d124bbAdam Lesinski    virtual bool verbose() = 0;
441ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski};
451ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
461ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinskistruct IResourceTableConsumer {
471ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski    virtual ~IResourceTableConsumer() = default;
481ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
491ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski    virtual bool consume(IAaptContext* context, ResourceTable* table) = 0;
501ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski};
511ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
521ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinskinamespace xml {
53467f171315f9c2037fcd3eb5edcfabc40671bf7bAdam Lesinskistruct XmlResource;
541ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski}
551ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
561ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinskistruct IXmlResourceConsumer {
571ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski    virtual ~IXmlResourceConsumer() = default;
581ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
59467f171315f9c2037fcd3eb5edcfabc40671bf7bAdam Lesinski    virtual bool consume(IAaptContext* context, xml::XmlResource* resource) = 0;
601ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski};
611ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
621ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski} // namespace aapt
631ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski
641ab598f46c3ff520a67f9d80194847741f3467abAdam Lesinski#endif /* AAPT_PROCESS_IRESOURCETABLECONSUMER_H */
65