browser/engine/inc/Screenshot.h
changeset 0 c316ab048e9d
equal deleted inserted replaced
-1:000000000000 0:c316ab048e9d
       
     1 /*
       
     2  * Name        : Screenshot.h
       
     3  * Description : Performs screenshot and bitmap conversion
       
     4  * Project     : This file is part of OpenMAR, an Open Mobile Augmented Reality browser
       
     5  * Website     : http://OpenMAR.org
       
     6  *
       
     7  * Copyright (c) 2010 David Caabeiro
       
     8  *
       
     9  * All rights reserved. This program and the accompanying materials are made available 
       
    10  * under the terms of the Eclipse Public License v1.0 which accompanies this 
       
    11  * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
       
    12  *
       
    13  */
       
    14 
       
    15 #ifndef SCREENSHOT_H_
       
    16 #define SCREENSHOT_H_
       
    17 
       
    18 #include <e32base.h>
       
    19 #include <gdi.h>
       
    20 
       
    21 class TSize;
       
    22 
       
    23 class CFbsBitmap;
       
    24 class CFbsBitmapDevice;
       
    25 class CFbsBitGc;
       
    26 
       
    27 class CImageEncoder;
       
    28 
       
    29 class CScreenshot : public CActive
       
    30 {
       
    31 public:
       
    32     class MObserver
       
    33     {
       
    34     public:
       
    35         virtual void ScreenshotReadyL(TInt aError, const TDesC& aFilename) = 0;
       
    36     };
       
    37 
       
    38 public:
       
    39     static CScreenshot* NewL(MObserver& aObserver, const TSize& aSize, const TDisplayMode& aDisplayMode);
       
    40     ~CScreenshot();
       
    41 
       
    42 protected:
       
    43     CScreenshot(MObserver& aObserver);
       
    44     void ConstructL(const TSize& aSize, const TDisplayMode& aDisplayMode);
       
    45 
       
    46 public:
       
    47     void RequestL(const CFbsBitmap& aSourceBitmap, const TSize& aSize);
       
    48 
       
    49 protected:
       
    50     void RunL();
       
    51     void DoCancel();
       
    52 
       
    53 private:
       
    54     MObserver& iObserver;
       
    55 
       
    56     CFbsBitmap* iBitmap;
       
    57     CFbsBitmapDevice* iBitmapDevice;
       
    58     CFbsBitGc* iBitmapContext;
       
    59 
       
    60     TFileName iFilename;
       
    61     CImageEncoder* iEncoder;
       
    62 };
       
    63 
       
    64 #endif