blob: a3a7719bfe16c9ab8dec989abb9298322c29d06c [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
Adam Lesinskice5e56e2016-10-21 17:56:45 -070020#include <iostream>
21#include <list>
22#include <sstream>
23
Adam Lesinski1ab598f2015-08-14 14:26:04 -070024#include "Diagnostics.h"
25#include "NameMangler.h"
26#include "Resource.h"
27#include "ResourceValues.h"
28#include "Source.h"
29
Adam Lesinski1ab598f2015-08-14 14:26:04 -070030namespace aapt {
31
32class ResourceTable;
Adam Lesinski64587af2016-02-18 18:33:06 -080033class SymbolTable;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070034
Adam Lesinskib522f042017-04-21 16:57:59 -070035// The type of package to build.
36enum class PackageType {
37 kApp,
38 kSharedLib,
39 kStaticLib,
40};
41
Adam Lesinski1ab598f2015-08-14 14:26:04 -070042struct IAaptContext {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070043 virtual ~IAaptContext() = default;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070044
Adam Lesinskib522f042017-04-21 16:57:59 -070045 virtual PackageType GetPackageType() = 0;
Adam Lesinskice5e56e2016-10-21 17:56:45 -070046 virtual SymbolTable* GetExternalSymbols() = 0;
47 virtual IDiagnostics* GetDiagnostics() = 0;
48 virtual const std::string& GetCompilationPackage() = 0;
49 virtual uint8_t GetPackageId() = 0;
50 virtual NameMangler* GetNameMangler() = 0;
51 virtual bool IsVerbose() = 0;
52 virtual int GetMinSdkVersion() = 0;
Chris Warrington481f0272018-02-06 14:03:39 +000053 virtual bool IsAutoNamespace() = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070054};
55
56struct IResourceTableConsumer {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070057 virtual ~IResourceTableConsumer() = default;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070058
Adam Lesinskice5e56e2016-10-21 17:56:45 -070059 virtual bool Consume(IAaptContext* context, ResourceTable* table) = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070060};
61
62namespace xml {
Adam Lesinski5eeaadd2016-08-25 12:26:56 -070063class XmlResource;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070064}
65
Adam Lesinski1ab598f2015-08-14 14:26:04 -070066struct IXmlResourceConsumer {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070067 virtual ~IXmlResourceConsumer() = default;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070068
Adam Lesinskice5e56e2016-10-21 17:56:45 -070069 virtual bool Consume(IAaptContext* context, xml::XmlResource* resource) = 0;
Adam Lesinski1ab598f2015-08-14 14:26:04 -070070};
71
Adam Lesinskicacb28f2016-10-19 12:18:14 -070072} // namespace aapt
Adam Lesinski1ab598f2015-08-14 14:26:04 -070073
74#endif /* AAPT_PROCESS_IRESOURCETABLECONSUMER_H */