1*88af15cfSAndrew Lindesay /* 2*88af15cfSAndrew Lindesay * Copyright 2023, Andrew Lindesay <apl@lindesay.co.nz>. 3*88af15cfSAndrew Lindesay * All rights reserved. Distributed under the terms of the MIT License. 4*88af15cfSAndrew Lindesay */ 5*88af15cfSAndrew Lindesay #include "CacheScreenshotProcess.h" 6*88af15cfSAndrew Lindesay 7*88af15cfSAndrew Lindesay #include <Catalog.h> 8*88af15cfSAndrew Lindesay 9*88af15cfSAndrew Lindesay #include "Model.h" 10*88af15cfSAndrew Lindesay 11*88af15cfSAndrew Lindesay 12*88af15cfSAndrew Lindesay #undef B_TRANSLATION_CONTEXT 13*88af15cfSAndrew Lindesay #define B_TRANSLATION_CONTEXT "CacheScreenshotProcess" 14*88af15cfSAndrew Lindesay 15*88af15cfSAndrew Lindesay CacheScreenshotProcess(Model * model,ScreenshotCoordinate & screenshotCoordinate)16*88af15cfSAndrew LindesayCacheScreenshotProcess::CacheScreenshotProcess(Model *model, 17*88af15cfSAndrew Lindesay ScreenshotCoordinate& screenshotCoordinate) 18*88af15cfSAndrew Lindesay : 19*88af15cfSAndrew Lindesay fModel(model), 20*88af15cfSAndrew Lindesay fScreenshotCoordinate(screenshotCoordinate) 21*88af15cfSAndrew Lindesay { 22*88af15cfSAndrew Lindesay } 23*88af15cfSAndrew Lindesay 24*88af15cfSAndrew Lindesay ~CacheScreenshotProcess()25*88af15cfSAndrew LindesayCacheScreenshotProcess::~CacheScreenshotProcess() 26*88af15cfSAndrew Lindesay { 27*88af15cfSAndrew Lindesay } 28*88af15cfSAndrew Lindesay 29*88af15cfSAndrew Lindesay 30*88af15cfSAndrew Lindesay const char* Name() const31*88af15cfSAndrew LindesayCacheScreenshotProcess::Name() const 32*88af15cfSAndrew Lindesay { 33*88af15cfSAndrew Lindesay return "CacheScreenshotProcess"; 34*88af15cfSAndrew Lindesay } 35*88af15cfSAndrew Lindesay 36*88af15cfSAndrew Lindesay 37*88af15cfSAndrew Lindesay const char* Description() const38*88af15cfSAndrew LindesayCacheScreenshotProcess::Description() const 39*88af15cfSAndrew Lindesay { 40*88af15cfSAndrew Lindesay return B_TRANSLATE("Fetching screenshot"); 41*88af15cfSAndrew Lindesay } 42*88af15cfSAndrew Lindesay 43*88af15cfSAndrew Lindesay 44*88af15cfSAndrew Lindesay status_t RunInternal()45*88af15cfSAndrew LindesayCacheScreenshotProcess::RunInternal() 46*88af15cfSAndrew Lindesay { 47*88af15cfSAndrew Lindesay return fModel->GetPackageScreenshotRepository()->CacheScreenshot(fScreenshotCoordinate); 48*88af15cfSAndrew Lindesay }