summaryrefslogtreecommitdiff
path: root/test/include/mbgl/test/stub_style_observer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/include/mbgl/test/stub_style_observer.hpp')
-rw-r--r--test/include/mbgl/test/stub_style_observer.hpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/test/include/mbgl/test/stub_style_observer.hpp b/test/include/mbgl/test/stub_style_observer.hpp
deleted file mode 100644
index 7236ca74f5..0000000000
--- a/test/include/mbgl/test/stub_style_observer.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef MBGL_TEST_STUB_STYLE_OBSERVER
-#define MBGL_TEST_STUB_STYLE_OBSERVER
-
-#include <mbgl/style/style.hpp>
-
-namespace mbgl {
-
-/**
- * An implementation of Style::Observer that forwards all methods to dynamically-settable lambas.
- */
-class StubStyleObserver : public Style::Observer {
-public:
- void onGlyphsLoaded(const std::string& fontStack, const GlyphRange& glyphRange) override {
- if (glyphsLoaded) glyphsLoaded(fontStack, glyphRange);
- }
-
- void onGlyphsError(const std::string& fontStack, const GlyphRange& glyphRange, std::exception_ptr error) override {
- if (glyphsError) glyphsError(fontStack, glyphRange, error);
- }
-
- void onSpriteLoaded() override {
- if (spriteLoaded) spriteLoaded();
- }
-
- void onSpriteError(std::exception_ptr error) override {
- if (spriteError) spriteError(error);
- }
-
- void onSourceLoaded(Source& source) override {
- if (sourceLoaded) sourceLoaded(source);
- }
-
- void onSourceError(Source& source, std::exception_ptr error) override {
- if (sourceError) sourceError(source, error);
- }
-
- void onTileLoaded(Source& source, const TileID& tileID, bool isNewTile) override {
- if (tileLoaded) tileLoaded(source, tileID, isNewTile);
- }
-
- void onTileError(Source& source, const TileID& tileID, std::exception_ptr error) override {
- if (tileError) tileError(source, tileID, error);
- }
-
- void onResourceLoaded() override {
- if (resourceLoaded) resourceLoaded();
- };
-
- void onResourceError(std::exception_ptr error) override {
- if (resourceError) resourceError(error);
- };
-
- std::function<void (const std::string& fontStack, const GlyphRange&)> glyphsLoaded;
- std::function<void (const std::string& fontStack, const GlyphRange&, std::exception_ptr)> glyphsError;
- std::function<void ()> spriteLoaded;
- std::function<void (std::exception_ptr)> spriteError;
- std::function<void (Source&)> sourceLoaded;
- std::function<void (Source&, std::exception_ptr)> sourceError;
- std::function<void (Source&, const TileID&, bool isNewTile)> tileLoaded;
- std::function<void (Source&, const TileID&, std::exception_ptr)> tileError;
- std::function<void ()> resourceLoaded;
- std::function<void (std::exception_ptr)> resourceError;
-};
-
-} // namespace mbgl
-
-#endif