blob: a7e752a42125deab11a5b8980cc28c5055424909 [file] [log] [blame]
Adam Lesinski1ab598f2015-08-14 14:26:04 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef AAPT_PROCESS_IRESOURCETABLECONSUMER_H
18#define AAPT_PROCESS_IRESOURCETABLECONSUMER_H
19
20#include "Diagnostics.h"
21#include "NameMangler.h"
22#include "Resource.h"
23#include "ResourceValues.h"
24#include "Source.h"
25
26#include <iostream>
27#include <list>
28#include <sstream>
29
30namespace aapt {
31
32class ResourceTable;
Adam Lesinski64587af2016-02-18 18:33:06 -080033class SymbolTable;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070034
35struct IAaptContext {
36 virtual ~IAaptContext() = default;
37
Adam Lesinski64587af2016-02-18 18:33:06 -080038 virtual SymbolTable* getExternalSymbols() = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070039 virtual IDiagnostics* getDiagnostics() = 0;
Adam Lesinskid0f116b2016-07-08 15:00:32 -070040 virtual const std::string& getCompilationPackage() = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070041 virtual uint8_t getPackageId() = 0;
42 virtual NameMangler* getNameMangler() = 0;
Adam Lesinski355f2852016-02-13 20:26:45 -080043 virtual bool verbose() = 0;
Adam Lesinskifb6312f2016-06-28 14:40:32 -070044 virtual int getMinSdkVersion() = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070045};
46
47struct IResourceTableConsumer {
48 virtual ~IResourceTableConsumer() = default;
49
50 virtual bool consume(IAaptContext* context, ResourceTable* table) = 0;
51};
52
53namespace xml {
Adam Lesinski5eeaadd2016-08-25 12:26:56 -070054class XmlResource;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070055}
56
Adam Lesinski1ab598f2015-08-14 14:26:04 -070057struct IXmlResourceConsumer {
58 virtual ~IXmlResourceConsumer() = default;
59
Adam Lesinski467f1712015-11-16 17:35:44 -080060 virtual bool consume(IAaptContext* context, xml::XmlResource* resource) = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070061};
62
63} // namespace aapt
64
65#endif /* AAPT_PROCESS_IRESOURCETABLECONSUMER_H */